mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Merge branch 'master' of https://github.com/prusa3d/Slic3r into dev
This commit is contained in:
		
						commit
						622e86d9e4
					
				
					 2 changed files with 9 additions and 16 deletions
				
			
		|  | @ -231,20 +231,17 @@ namespace Slic3r { namespace GUI { | |||
| 		temp->Bind(wxEVT_TEXT, ([this](wxCommandEvent& evt) | ||||
| 		{ | ||||
| #ifdef __WXGTK__ | ||||
|             if (bChangedValueEvent) | ||||
|                 change_field_value(evt); | ||||
|             else | ||||
| 			    bChangedValueEvent = true; | ||||
| #else | ||||
| 			on_change_field(); | ||||
| 			if (bChangedValueEvent) | ||||
| #endif //__WXGTK__
 | ||||
| 			on_change_field(); | ||||
| 		}), temp->GetId()); | ||||
| 
 | ||||
| #ifdef __WXGTK__ | ||||
|         // to correct value update on GTK we should call on_change_field() on 
 | ||||
|         // wxEVT_KEY_UP or wxEVT_TEXT_PASTE instead of wxEVT_TEXT
 | ||||
|         // to correct value updating on GTK we should:
 | ||||
|         // call on_change_field() on wxEVT_KEY_UP instead of wxEVT_TEXT
 | ||||
|         // and prevent value updating on wxEVT_KEY_DOWN
 | ||||
|         temp->Bind(wxEVT_KEY_DOWN, &TextCtrl::change_field_value, this); | ||||
|         temp->Bind(wxEVT_KEY_UP, &TextCtrl::change_field_value, this); | ||||
|         temp->Bind(wxEVT_TEXT_PASTE, &TextCtrl::change_field_value, this); | ||||
| #endif //__WXGTK__
 | ||||
| 
 | ||||
| 		// select all text using Ctrl+A
 | ||||
|  | @ -273,12 +270,8 @@ namespace Slic3r { namespace GUI { | |||
| #ifdef __WXGTK__ | ||||
|     void TextCtrl::change_field_value(wxEvent& event) | ||||
|     { | ||||
|         if (event.GetEventType() == wxEVT_TEXT_PASTE) | ||||
|             bChangedValueEvent = true; | ||||
|         else if (bChangedValueEvent) { | ||||
|             on_change_field(); | ||||
|             bChangedValueEvent = false; | ||||
|         } | ||||
|     	if (bChangedValueEvent = event.GetEventType()==wxEVT_KEY_UP) | ||||
|     		on_change_field(); | ||||
|         event.Skip(); | ||||
|     }; | ||||
| #endif //__WXGTK__
 | ||||
|  |  | |||
|  | @ -235,7 +235,7 @@ inline bool is_sizer_field(const t_field& obj) { return !is_bad_field(obj) && ob | |||
| class TextCtrl : public Field { | ||||
|     using Field::Field; | ||||
| #ifdef __WXGTK__ | ||||
| 	bool	bChangedValueEvent = false; | ||||
| 	bool	bChangedValueEvent = true; | ||||
|     void    change_field_value(wxEvent& event); | ||||
| #endif //__WXGTK__
 | ||||
| public: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Enrico Turri
						Enrico Turri