Implemented issue #1990
This commit is contained in:
parent
8b73608e9f
commit
0198e71789
2 changed files with 28 additions and 15 deletions
|
@ -96,7 +96,7 @@ ObjectList::ObjectList(wxWindow* parent) :
|
||||||
#endif //__WXMSW__
|
#endif //__WXMSW__
|
||||||
});
|
});
|
||||||
|
|
||||||
// Bind(wxEVT_CHAR, [this](wxKeyEvent& event) { key_event(event); }); // doesn't work on OSX
|
Bind(wxEVT_CHAR, [this](wxKeyEvent& event) { key_event(event); }); // doesn't work on OSX
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
GetMainWindow()->Bind(wxEVT_MOTION, [this](wxMouseEvent& event) {
|
GetMainWindow()->Bind(wxEVT_MOTION, [this](wxMouseEvent& event) {
|
||||||
|
@ -443,8 +443,6 @@ void ObjectList::OnContextMenu(wxDataViewEvent&)
|
||||||
if (is_windows10())
|
if (is_windows10())
|
||||||
fix_through_netfabb();
|
fix_through_netfabb();
|
||||||
}
|
}
|
||||||
else if (title == _("Extruder"))
|
|
||||||
show_extruder_selection_menu();
|
|
||||||
|
|
||||||
#ifndef __WXMSW__
|
#ifndef __WXMSW__
|
||||||
GetMainWindow()->SetToolTip(""); // hide tooltip
|
GetMainWindow()->SetToolTip(""); // hide tooltip
|
||||||
|
@ -458,7 +456,7 @@ void ObjectList::show_context_menu()
|
||||||
if (selected_instances_of_same_object())
|
if (selected_instances_of_same_object())
|
||||||
wxGetApp().plater()->PopupMenu(&m_menu_instance);
|
wxGetApp().plater()->PopupMenu(&m_menu_instance);
|
||||||
else
|
else
|
||||||
show_extruder_selection_menu();
|
show_multi_selection_menu();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -990,10 +988,14 @@ wxMenuItem* ObjectList::append_menu_item_instance_to_object(wxMenu* menu)
|
||||||
[this](wxCommandEvent&) { split_instances(); }, "", menu);
|
[this](wxCommandEvent&) { split_instances(); }, "", menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectList::append_menu_item_rename(wxMenu* menu)
|
void ObjectList::append_menu_items_osx(wxMenu* menu)
|
||||||
{
|
{
|
||||||
|
append_menu_item(menu, wxID_ANY, _(L("Delete item")), "",
|
||||||
|
[this](wxCommandEvent&) { remove(); }, "", menu);
|
||||||
|
|
||||||
append_menu_item(menu, wxID_ANY, _(L("Rename")), "",
|
append_menu_item(menu, wxID_ANY, _(L("Rename")), "",
|
||||||
[this](wxCommandEvent&) { rename_item(); }, "", menu);
|
[this](wxCommandEvent&) { rename_item(); }, "", menu);
|
||||||
|
|
||||||
menu->AppendSeparator();
|
menu->AppendSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1016,7 +1018,7 @@ void ObjectList::append_menu_item_export_stl(wxMenu* menu) const
|
||||||
void ObjectList::create_object_popupmenu(wxMenu *menu)
|
void ObjectList::create_object_popupmenu(wxMenu *menu)
|
||||||
{
|
{
|
||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
append_menu_item_rename(menu);
|
append_menu_items_osx(menu);
|
||||||
#endif // __WXOSX__
|
#endif // __WXOSX__
|
||||||
|
|
||||||
append_menu_item_export_stl(menu);
|
append_menu_item_export_stl(menu);
|
||||||
|
@ -1037,7 +1039,7 @@ void ObjectList::create_object_popupmenu(wxMenu *menu)
|
||||||
void ObjectList::create_sla_object_popupmenu(wxMenu *menu)
|
void ObjectList::create_sla_object_popupmenu(wxMenu *menu)
|
||||||
{
|
{
|
||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
append_menu_item_rename(menu);
|
append_menu_items_osx(menu);
|
||||||
#endif // __WXOSX__
|
#endif // __WXOSX__
|
||||||
|
|
||||||
append_menu_item_export_stl(menu);
|
append_menu_item_export_stl(menu);
|
||||||
|
@ -1049,7 +1051,7 @@ void ObjectList::create_sla_object_popupmenu(wxMenu *menu)
|
||||||
void ObjectList::create_part_popupmenu(wxMenu *menu)
|
void ObjectList::create_part_popupmenu(wxMenu *menu)
|
||||||
{
|
{
|
||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
append_menu_item_rename(menu);
|
append_menu_items_osx(menu);
|
||||||
#endif // __WXOSX__
|
#endif // __WXOSX__
|
||||||
|
|
||||||
append_menu_item_fix_through_netfabb(menu);
|
append_menu_item_fix_through_netfabb(menu);
|
||||||
|
@ -1857,8 +1859,11 @@ void ObjectList::remove()
|
||||||
{
|
{
|
||||||
if (m_objects_model->GetParent(item) == wxDataViewItem(0))
|
if (m_objects_model->GetParent(item) == wxDataViewItem(0))
|
||||||
delete_from_model_and_list(itObject, m_objects_model->GetIdByItem(item), -1);
|
delete_from_model_and_list(itObject, m_objects_model->GetIdByItem(item), -1);
|
||||||
else
|
else {
|
||||||
|
if (sels.size() == 1)
|
||||||
|
select_item(m_objects_model->GetParent(item));
|
||||||
del_subobject_item(item);
|
del_subobject_item(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2358,7 +2363,7 @@ void ObjectList::OnEditingDone(wxDataViewEvent &event)
|
||||||
_(L("the following characters are not allowed:")) + " <>:/\\|?*\"");
|
_(L("the following characters are not allowed:")) + " <>:/\\|?*\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectList::show_extruder_selection_menu()
|
void ObjectList::show_multi_selection_menu()
|
||||||
{
|
{
|
||||||
wxDataViewItemArray sels;
|
wxDataViewItemArray sels;
|
||||||
GetSelections(sels);
|
GetSelections(sels);
|
||||||
|
@ -2369,9 +2374,17 @@ void ObjectList::show_extruder_selection_menu()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxMenu* menu = new wxMenu();
|
wxMenu* menu = new wxMenu();
|
||||||
append_menu_item(menu, wxID_ANY, _(L("Set extruder for selected items")),
|
|
||||||
_(L("Select extruder number for selected objects and/or parts")),
|
#ifdef __WXOSX__
|
||||||
[this](wxCommandEvent&) { extruder_selection(); }, "", menu);
|
append_menu_item(menu, wxID_ANY, _(L("Delete items")), "",
|
||||||
|
[this](wxCommandEvent&) { remove(); }, "", menu);
|
||||||
|
#endif //__WXOSX__
|
||||||
|
|
||||||
|
if (extruders_count() > 1)
|
||||||
|
append_menu_item(menu, wxID_ANY, _(L("Set extruder for selected items")),
|
||||||
|
_(L("Select extruder number for selected objects and/or parts")),
|
||||||
|
[this](wxCommandEvent&) { extruder_selection(); }, "", menu);
|
||||||
|
|
||||||
PopupMenu(menu);
|
PopupMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,7 @@ public:
|
||||||
wxMenuItem* append_menu_item_settings(wxMenu* menu);
|
wxMenuItem* append_menu_item_settings(wxMenu* menu);
|
||||||
wxMenuItem* append_menu_item_change_type(wxMenu* menu);
|
wxMenuItem* append_menu_item_change_type(wxMenu* menu);
|
||||||
wxMenuItem* append_menu_item_instance_to_object(wxMenu* menu);
|
wxMenuItem* append_menu_item_instance_to_object(wxMenu* menu);
|
||||||
void append_menu_item_rename(wxMenu* menu);
|
void append_menu_items_osx(wxMenu* menu);
|
||||||
void append_menu_item_fix_through_netfabb(wxMenu* menu);
|
void append_menu_item_fix_through_netfabb(wxMenu* menu);
|
||||||
void append_menu_item_export_stl(wxMenu* menu) const ;
|
void append_menu_item_export_stl(wxMenu* menu) const ;
|
||||||
void create_object_popupmenu(wxMenu *menu);
|
void create_object_popupmenu(wxMenu *menu);
|
||||||
|
@ -283,7 +283,7 @@ private:
|
||||||
void ItemValueChanged(wxDataViewEvent &event);
|
void ItemValueChanged(wxDataViewEvent &event);
|
||||||
void OnEditingDone(wxDataViewEvent &event);
|
void OnEditingDone(wxDataViewEvent &event);
|
||||||
|
|
||||||
void show_extruder_selection_menu();
|
void show_multi_selection_menu();
|
||||||
void extruder_selection();
|
void extruder_selection();
|
||||||
void set_extruder_for_selected_items(const int extruder) const ;
|
void set_extruder_for_selected_items(const int extruder) const ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue