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,12 +57,12 @@ public:
#if 0
wxMenu *CreatePopupMenu() override {
wxMenu *menu = new wxMenu;
int id;
auto *item = menu->Append(id = wxNewId(), "&Test menu");
menu->Bind(wxEVT_MENU, [this](wxCommandEvent &) { wxMessageBox("Test menu - PrusaSlicer"); }, id);
append_menu_item(menu, wxID_ANY, _L("Open new instance"), _L("Open a new PrusaSlicer instance"),
[this](wxCommandEvent&) { start_new_slicer(); }, "", nullptr, [this]() {return wxGetApp().app_config->get("single_instance") != "1"; });
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;
}
#endif
};
class GCodeViewerTaskBarIcon : public wxTaskBarIcon
{
@ -70,11 +70,10 @@ public:
GCodeViewerTaskBarIcon(wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE) : wxTaskBarIcon(iconType) {}
wxMenu* CreatePopupMenu() override {
wxMenu* menu = new wxMenu;
//int id;
//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(""),
append_menu_item(menu, wxID_ANY, _L("Open PrusaSlicer"), _L("Open a new PrusaSlicer instance"),
[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;
}
};