Changeset 389 for cafu/trunk
- Timestamp:
- 09/20/11 22:56:52 (8 months ago)
- Location:
- cafu/trunk/CaWE/GuiEditor
- Files:
-
- 3 modified
-
WindowTree.cpp (modified) (2 diffs)
-
WindowTree.hpp (modified) (1 diff)
-
Windows/EditorWindow.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cafu/trunk/CaWE/GuiEditor/WindowTree.cpp
r388 r389 63 63 EVT_LEFT_DCLICK (WindowTreeT::OnTreeLeftClick) // Handle double clicks like normal left clicks when it comes to clicks on tree item icons (otherwise double clicks are handled normally). 64 64 EVT_TREE_SEL_CHANGED (wxID_ANY, WindowTreeT::OnSelectionChanged) 65 EVT_TREE_END_LABEL_EDIT (wxID_ANY, WindowTreeT::On LabelChanged)65 EVT_TREE_END_LABEL_EDIT (wxID_ANY, WindowTreeT::OnEndLabelEdit) 66 66 EVT_TREE_ITEM_RIGHT_CLICK(wxID_ANY, WindowTreeT::OnTreeItemRightClick) 67 67 EVT_TREE_BEGIN_DRAG (wxID_ANY, WindowTreeT::OnBeginDrag) … … 398 398 399 399 400 void WindowTreeT::OnLabelChanged(wxTreeEvent& TE) 401 { 402 // Emtpy string means the user has either not changed the label at all or 403 // deleted the whole label string. 404 if (TE.GetLabel()=="") 405 { 406 TE.Veto(); // Reset value. 407 return; 408 } 409 400 void WindowTreeT::OnEndLabelEdit(wxTreeEvent& TE) 401 { 410 402 cf::GuiSys::WindowT* Window=((WindowTreeItemT*)GetItemData(TE.GetItem()))->GetWindow(); 411 403 404 if (TE.IsEditCancelled()) return; 405 412 406 m_IsRecursiveSelfNotify=true; 413 414 if (!m_Parent->SubmitCommand(new CommandModifyWindowT(m_GuiDocument, Window, "Name", Window->GetMemberVar("name"), TE.GetLabel()))) 415 { 416 TE.Veto(); // Reset value if not valid. 417 } 407 m_Parent->SubmitCommand(new CommandModifyWindowT(m_GuiDocument, Window, "Name", Window->GetMemberVar("name"), TE.GetLabel())); 408 m_IsRecursiveSelfNotify=false; 418 409 419 410 // The command may well have set a name different from TE.GetLabel(). 420 411 TE.Veto(); 421 412 SetItemText(TE.GetItem(), Window->Name); 422 423 m_IsRecursiveSelfNotify=false;424 413 } 425 414 -
cafu/trunk/CaWE/GuiEditor/WindowTree.hpp
r374 r389 91 91 void OnTreeLeftClick (wxMouseEvent& ME); 92 92 void OnSelectionChanged (wxTreeEvent& TE); 93 void On LabelChanged(wxTreeEvent& TE);93 void OnEndLabelEdit (wxTreeEvent& TE); 94 94 void OnTreeItemRightClick(wxTreeEvent& TE); 95 95 void OnBeginDrag (wxTreeEvent& TE); -
cafu/trunk/CaWE/GuiEditor/Windows/EditorWindow.cpp
r388 r389 241 241 // Specially treated by command. 242 242 ChildFrame->SubmitCommand(new CommandModifyWindowT(m_GuiDoc, m_Win, PropName, DummyVar, Prop->GetValueAsString())); 243 244 // The command may well have set a name different from Prop->GetValueAsString(). 245 wxASSERT(Event.GetEventType() == wxEVT_PG_CHANGED); 246 Event.GetProperty()->SetValueFromString(m_Win->Name); 243 247 } 244 248 else if (PropName=="Visible")
