mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 20:51:12 -06:00 
			
		
		
		
	MSW specific: ObjectList: Fixed eternal Editor Control
Steps to reproduce of a bug: 1. Add object 2. Click the Cog icon with the left mouse button 3. DoubleClick on name of object > An Editor Control appears that cannot be deleted any way
This commit is contained in:
		
							parent
							
								
									34c4b74af4
								
							
						
					
					
						commit
						3db4804e47
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		|  | @ -197,6 +197,17 @@ wxWindow* BitmapTextRenderer::CreateEditorCtrl(wxWindow* parent, wxRect labelRec | |||
|         labelRect.SetWidth(labelRect.GetWidth() - bmp_width); | ||||
|     } | ||||
| 
 | ||||
| #ifdef __WXMSW__ | ||||
|     // Case when from some reason we try to create next EditorCtrl till old one was not deleted
 | ||||
|     if (auto children = parent->GetChildren(); children.GetCount() > 0) | ||||
|         for (auto child : children) | ||||
|             if (dynamic_cast<wxTextCtrl*>(child)) { | ||||
|                 parent->RemoveChild(child); | ||||
|                 child->Destroy(); | ||||
|                 break; | ||||
|             } | ||||
| #endif // __WXMSW__
 | ||||
| 
 | ||||
|     wxTextCtrl* text_editor = new wxTextCtrl(parent, wxID_ANY, data.GetText(), | ||||
|                                              position, labelRect.GetSize(), wxTE_PROCESS_ENTER); | ||||
|     text_editor->SetInsertionPointEnd(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 YuSanka
						YuSanka