mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 00:37:51 -06:00
Added item menu 'Edit/Show labels' and removed labels activation from preferences dialog
This commit is contained in:
parent
9f536291b0
commit
3ec4b77dcd
9 changed files with 43 additions and 35 deletions
|
@ -146,7 +146,8 @@ wxMenuItem* append_menu_radio_item(wxMenu* menu, int id, const wxString& string,
|
|||
}
|
||||
|
||||
wxMenuItem* append_menu_check_item(wxMenu* menu, int id, const wxString& string, const wxString& description,
|
||||
std::function<void(wxCommandEvent& event)> cb, wxEvtHandler* event_handler)
|
||||
std::function<void(wxCommandEvent & event)> cb, wxEvtHandler* event_handler,
|
||||
std::function<bool()> const enable_condition, std::function<bool()> const check_condition, wxWindow* parent)
|
||||
{
|
||||
if (id == wxID_ANY)
|
||||
id = wxNewId();
|
||||
|
@ -160,6 +161,13 @@ wxMenuItem* append_menu_check_item(wxMenu* menu, int id, const wxString& string,
|
|||
#endif // __WXMSW__
|
||||
menu->Bind(wxEVT_MENU, cb, id);
|
||||
|
||||
if (parent)
|
||||
parent->Bind(wxEVT_UPDATE_UI, [enable_condition, check_condition](wxUpdateUIEvent& evt)
|
||||
{
|
||||
evt.Enable(enable_condition());
|
||||
evt.Check(check_condition());
|
||||
}, id);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue