OSX dock menu items

This commit is contained in:
David Kocik 2020-10-15 18:53:35 +02:00
parent a8fda7d2f1
commit 4ec5ea34bf

View File

@ -57,24 +57,23 @@ public:
#if 0 #if 0
wxMenu *CreatePopupMenu() override { wxMenu *CreatePopupMenu() override {
wxMenu *menu = new wxMenu; wxMenu *menu = new wxMenu;
int id; append_menu_item(menu, wxID_ANY, _L("Open new instance"), _L("Open a new PrusaSlicer instance"),
auto *item = menu->Append(id = wxNewId(), "&Test menu"); [this](wxCommandEvent&) { start_new_slicer(); }, "", nullptr, [this]() {return wxGetApp().app_config->get("single_instance") != "1"; });
menu->Bind(wxEVT_MENU, [this](wxCommandEvent &) { wxMessageBox("Test menu - PrusaSlicer"); }, id); append_menu_item(menu, wxID_ANY, _L("G-code preview") + dots, _L("Open G-code viewer"),
[this](wxCommandEvent&) { start_new_gcodeviewer_open_file(); }, "", nullptr);
return menu; return menu;
} }
#endif
}; };
class GCodeViewerTaskBarIcon : public wxTaskBarIcon class GCodeViewerTaskBarIcon : public wxTaskBarIcon
{ {
public: public:
GCodeViewerTaskBarIcon(wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE) : wxTaskBarIcon(iconType) {} GCodeViewerTaskBarIcon(wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE) : wxTaskBarIcon(iconType) {}
wxMenu *CreatePopupMenu() override { wxMenu* CreatePopupMenu() override {
wxMenu *menu = new wxMenu; wxMenu* menu = new wxMenu;
//int id; append_menu_item(menu, wxID_ANY, _L("Open PrusaSlicer"), _L("Open a new PrusaSlicer instance"),
//auto *item = menu->Append(id = wxNewId(), "&Test menu");
//menu->Bind(wxEVT_MENU, [this](wxCommandEvent &) { wxMessageBox("Test menu - GCode Viewer"); }, id);
append_menu_item(menu, wxID_ANY, _L("Open PrusaSlicer"), _L(""),
[this](wxCommandEvent&) { start_new_slicer(nullptr, true); }, "", nullptr); [this](wxCommandEvent&) { start_new_slicer(nullptr, true); }, "", nullptr);
append_menu_item(menu, wxID_ANY, _L("G-code preview") + dots, _L("Open new G-code viewer"),
[this](wxCommandEvent&) { start_new_gcodeviewer_open_file(); }, "", nullptr);
return menu; return menu;
} }
}; };