mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Added undo/redo to the "Edit" menu
This commit is contained in:
		
							parent
							
								
									fb725502b7
								
							
						
					
					
						commit
						7b6229289d
					
				
					 3 changed files with 20 additions and 0 deletions
				
			
		|  | @ -502,6 +502,14 @@ void MainFrame::init_menubar() | |||
|             _(L("Deletes all objects")), [this](wxCommandEvent&) { m_plater->reset_with_confirm(); }, | ||||
|             menu_icon("delete_all_menu"), nullptr, [this](){return can_delete_all(); }, this); | ||||
| 
 | ||||
|         editMenu->AppendSeparator(); | ||||
|         append_menu_item(editMenu, wxID_ANY, _(L("&Undo")) + sep + GUI::shortkey_ctrl_prefix() + sep_space + "Z", | ||||
|             _(L("Undo")), [this](wxCommandEvent&) { m_plater->undo(); }, | ||||
|             "undo", nullptr, [this](){return m_plater->can_undo(); }, this); | ||||
|         append_menu_item(editMenu, wxID_ANY, _(L("&Redo")) + sep + GUI::shortkey_ctrl_prefix() + sep_space + "Y", | ||||
|             _(L("Redo")), [this](wxCommandEvent&) { m_plater->redo(); }, | ||||
|             "undo", nullptr, [this](){return m_plater->can_redo(); }, this); | ||||
| 
 | ||||
|         editMenu->AppendSeparator(); | ||||
|         append_menu_item(editMenu, wxID_ANY, _(L("&Copy")) + sep + GUI::shortkey_ctrl_prefix() + sep_space + "C", | ||||
|             _(L("Copy selection to clipboard")), [this](wxCommandEvent&) { m_plater->copy_selection_to_clipboard(); }, | ||||
|  |  | |||
|  | @ -4405,6 +4405,16 @@ bool Plater::can_copy_to_clipboard() const | |||
|     return true; | ||||
| } | ||||
| 
 | ||||
| bool Plater::can_undo() const | ||||
| { | ||||
|     return p->undo_redo_stack.has_undo_snapshot(); | ||||
| } | ||||
| 
 | ||||
| bool Plater::can_redo() const | ||||
| { | ||||
|     return p->undo_redo_stack.has_redo_snapshot(); | ||||
| } | ||||
| 
 | ||||
| SuppressBackgroundProcessingUpdate::SuppressBackgroundProcessingUpdate() : | ||||
|     m_was_running(wxGetApp().plater()->is_background_process_running()) | ||||
| { | ||||
|  |  | |||
|  | @ -222,6 +222,8 @@ public: | |||
|     bool can_layers_editing() const; | ||||
|     bool can_paste_from_clipboard() const; | ||||
|     bool can_copy_to_clipboard() const; | ||||
|     bool can_undo() const; | ||||
|     bool can_redo() const; | ||||
| 
 | ||||
|     void msw_rescale(); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 YuSanka
						YuSanka