From 4ec5ea34bfa1eb134b598884e70355301c4a870b Mon Sep 17 00:00:00 2001 From: David Kocik Date: Thu, 15 Oct 2020 18:53:35 +0200 Subject: [PATCH] OSX dock menu items --- src/slic3r/GUI/MainFrame.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 67ccd385e..0a9ba0f09 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -57,24 +57,23 @@ 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 { 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(""), + wxMenu* CreatePopupMenu() override { + wxMenu* menu = new wxMenu; + 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; } };