diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index fdec4a9c2..d9adcf60b 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -191,7 +191,7 @@ ObjectList::ObjectList(wxWindow* parent) : // Bind(wxEVT_KEY_DOWN, &ObjectList::OnChar, this); { // Accelerators - wxAcceleratorEntry entries[8]; + wxAcceleratorEntry entries[10]; entries[0].Set(wxACCEL_CTRL, (int) 'C', wxID_COPY); entries[1].Set(wxACCEL_CTRL, (int) 'X', wxID_CUT); entries[2].Set(wxACCEL_CTRL, (int) 'V', wxID_PASTE); @@ -200,7 +200,9 @@ ObjectList::ObjectList(wxWindow* parent) : entries[5].Set(wxACCEL_CTRL, (int) 'Y', wxID_REDO); entries[6].Set(wxACCEL_NORMAL, WXK_DELETE, wxID_DELETE); entries[7].Set(wxACCEL_NORMAL, WXK_BACK, wxID_DELETE); - wxAcceleratorTable accel(8, entries); + entries[8].Set(wxACCEL_NORMAL, int('+'), wxID_ADD); + entries[9].Set(wxACCEL_NORMAL, int('-'), wxID_REMOVE); + wxAcceleratorTable accel(10, entries); SetAcceleratorTable(accel); this->Bind(wxEVT_MENU, [this](wxCommandEvent &evt) { this->copy(); }, wxID_COPY); @@ -209,6 +211,8 @@ ObjectList::ObjectList(wxWindow* parent) : this->Bind(wxEVT_MENU, [this](wxCommandEvent &evt) { this->remove(); }, wxID_DELETE); this->Bind(wxEVT_MENU, [this](wxCommandEvent &evt) { this->undo(); }, wxID_UNDO); this->Bind(wxEVT_MENU, [this](wxCommandEvent &evt) { this->redo(); }, wxID_REDO); + this->Bind(wxEVT_MENU, [this](wxCommandEvent &evt) { this->increase_instance(); }, wxID_ADD); + this->Bind(wxEVT_MENU, [this](wxCommandEvent &evt) { this->decrease_instance(); }, wxID_REMOVE); } #else //__WXOSX__ Bind(wxEVT_CHAR, [this](wxKeyEvent& event) { key_event(event); }); // doesn't work on OSX @@ -1092,6 +1096,16 @@ void ObjectList::redo() wxGetApp().plater()->redo(); } +void ObjectList::increase_instances() +{ + wxGetApp().plater()->increase_instances(1); +} + +void ObjectList::decrease_instances() +{ + wxGetApp().plater()->decrease_instances(1); +} + #ifndef __WXOSX__ void ObjectList::key_event(wxKeyEvent& event) { @@ -1116,6 +1130,10 @@ void ObjectList::key_event(wxKeyEvent& event) redo(); else if (wxGetKeyState(wxKeyCode('Z')) && wxGetKeyState(WXK_CONTROL)) undo(); + else if (event.GetUnicodeKey() == '+') + increase_instances(); + else if (event.GetUnicodeKey() == '-') + decrease_instances(); else event.Skip(); } diff --git a/src/slic3r/GUI/GUI_ObjectList.hpp b/src/slic3r/GUI/GUI_ObjectList.hpp index c8bdd2d2c..011da676d 100644 --- a/src/slic3r/GUI/GUI_ObjectList.hpp +++ b/src/slic3r/GUI/GUI_ObjectList.hpp @@ -257,6 +257,8 @@ public: bool paste_from_clipboard(); void undo(); void redo(); + void increase_instances(); + void decrease_instances(); void get_settings_choice(const wxString& category_name); void get_freq_settings_choice(const wxString& bundle_name);