mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 00:37:51 -06:00
Unified append_submenu() function and modified append_menu_item() function
This commit is contained in:
parent
7dea8b1c47
commit
ea7216c019
5 changed files with 39 additions and 27 deletions
|
@ -327,24 +327,6 @@ void GUI_App::CallAfter(std::function<void()> cb)
|
|||
callback_register.unlock();
|
||||
}
|
||||
|
||||
wxMenuItem* GUI_App::append_submenu(wxMenu* menu,
|
||||
wxMenu* sub_menu,
|
||||
int id,
|
||||
const wxString& string,
|
||||
const wxString& description,
|
||||
const std::string& icon)
|
||||
{
|
||||
if (id == wxID_ANY)
|
||||
id = wxNewId();
|
||||
auto item = new wxMenuItem(menu, id, string, description);
|
||||
if (!icon.empty())
|
||||
item->SetBitmap(wxBitmap(Slic3r::var(icon), wxBITMAP_TYPE_PNG));
|
||||
item->SetSubMenu(sub_menu);
|
||||
menu->Append(item);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
void GUI_App::window_pos_save(wxTopLevelWindow* window, const std::string &name)
|
||||
{
|
||||
if (name.empty()) { return; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue