mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Fixed first binding for "Split to parts" menu item in ObjectList
This commit is contained in:
		
							parent
							
								
									9ff4cb01e2
								
							
						
					
					
						commit
						b6852d8bf2
					
				
					 3 changed files with 22 additions and 15 deletions
				
			
		|  | @ -64,12 +64,6 @@ ObjectList::ObjectList(wxWindow* parent) : | |||
| 
 | ||||
|     init_icons(); | ||||
| 
 | ||||
|     // create popup menus for object and part
 | ||||
|     create_object_popupmenu(&m_menu_object); | ||||
|     create_part_popupmenu(&m_menu_part); | ||||
|     create_sla_object_popupmenu(&m_menu_sla_object); | ||||
|     create_instance_popupmenu(&m_menu_instance); | ||||
| 
 | ||||
|     // describe control behavior 
 | ||||
|     Bind(wxEVT_DATAVIEW_SELECTION_CHANGED, [this](wxEvent& event) { | ||||
|         selection_changed(); | ||||
|  | @ -141,6 +135,15 @@ void ObjectList::create_objects_ctrl() | |||
|         wxALIGN_CENTER_HORIZONTAL, wxDATAVIEW_COL_RESIZABLE); | ||||
| } | ||||
| 
 | ||||
| void ObjectList::create_popup_menus() | ||||
| { | ||||
|     // create popup menus for object and part
 | ||||
|     create_object_popupmenu(&m_menu_object); | ||||
|     create_part_popupmenu(&m_menu_part); | ||||
|     create_sla_object_popupmenu(&m_menu_sla_object); | ||||
|     create_instance_popupmenu(&m_menu_instance); | ||||
| } | ||||
| 
 | ||||
| void ObjectList::set_tooltip_for_item(const wxPoint& pt) | ||||
| { | ||||
|     wxDataViewItem item; | ||||
|  | @ -421,9 +424,6 @@ void ObjectList::show_context_menu() | |||
|     if (multiple_selection() && selected_instances_of_same_object()) | ||||
|     { | ||||
|         wxGetApp().plater()->PopupMenu(&m_menu_instance); | ||||
| 
 | ||||
|         wxGetApp().plater()->Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { | ||||
|             evt.Enable(can_split_instances()); }, m_menu_item_split_instances->GetId()); | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|  | @ -442,12 +442,6 @@ void ObjectList::show_context_menu() | |||
|             append_menu_item_settings(menu); | ||||
| 
 | ||||
|         wxGetApp().plater()->PopupMenu(menu); | ||||
| 
 | ||||
|         wxGetApp().plater()->Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { | ||||
|             evt.Enable(is_splittable()); }, m_menu_item_split->GetId()); | ||||
| 
 | ||||
|         wxGetApp().plater()->Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { | ||||
|             evt.Enable(is_splittable()); }, m_menu_item_split_part->GetId()); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  | @ -973,6 +967,9 @@ void ObjectList::create_object_popupmenu(wxMenu *menu) | |||
|     // rest of a object_menu will be added later in:
 | ||||
|     // - append_menu_items_add_volume() -> for "Add (volumes)"
 | ||||
|     // - append_menu_item_settings() -> for "Add (settings)"
 | ||||
| 
 | ||||
|     wxGetApp().plater()->Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { | ||||
|         evt.Enable(is_splittable()); }, m_menu_item_split->GetId()); | ||||
| } | ||||
| 
 | ||||
| void ObjectList::create_sla_object_popupmenu(wxMenu *menu) | ||||
|  | @ -991,11 +988,17 @@ void ObjectList::create_part_popupmenu(wxMenu *menu) | |||
| 
 | ||||
|     // rest of a object_sla_menu will be added later in:
 | ||||
|     // - append_menu_item_settings() -> for "Add (settings)"
 | ||||
| 
 | ||||
|     wxGetApp().plater()->Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { | ||||
|             evt.Enable(is_splittable()); }, m_menu_item_split_part->GetId()); | ||||
| } | ||||
| 
 | ||||
| void ObjectList::create_instance_popupmenu(wxMenu*menu) | ||||
| { | ||||
|     m_menu_item_split_instances = append_menu_item_instance_to_object(menu); | ||||
| 
 | ||||
|     wxGetApp().plater()->Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { | ||||
|         evt.Enable(can_split_instances()); }, m_menu_item_split_instances->GetId()); | ||||
| } | ||||
| 
 | ||||
| wxMenu* ObjectList::create_settings_popupmenu(wxMenu *parent_menu) | ||||
|  |  | |||
|  | @ -153,6 +153,7 @@ public: | |||
| 
 | ||||
| 
 | ||||
|     void                create_objects_ctrl(); | ||||
|     void                create_popup_menus(); | ||||
|     wxDataViewColumn*   create_objects_list_extruder_column(int extruders_count); | ||||
|     void                update_objects_list_extruder_column(int extruders_count); | ||||
|     // show/hide "Extruder" column for Objects List
 | ||||
|  |  | |||
|  | @ -22,6 +22,7 @@ | |||
| #include "AppConfig.hpp" | ||||
| #include "PrintHostDialogs.hpp" | ||||
| #include "wxExtensions.hpp" | ||||
| #include "GUI_ObjectList.hpp" | ||||
| #include "I18N.hpp" | ||||
| 
 | ||||
| #include <fstream> | ||||
|  | @ -132,6 +133,8 @@ void MainFrame::init_tabpanel() | |||
|     wxGetApp().plater_ = m_plater; | ||||
|     m_tabpanel->AddPage(m_plater, _(L("Plater"))); | ||||
| 
 | ||||
|     wxGetApp().obj_list()->create_popup_menus(); | ||||
| 
 | ||||
|     // The following event is emited by Tab implementation on config value change.
 | ||||
|     Bind(EVT_TAB_VALUE_CHANGED, &MainFrame::on_value_changed, this); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 YuSanka
						YuSanka