]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dataview/dataview.cpp
Moved property unattachment code from wxPropertyGridInterface::RemoveProperty() to...
[wxWidgets.git] / samples / dataview / dataview.cpp
index 3f0db083ccd2019c774367efa0efa105fdefc5c9..1f43e05adbc9bbc40ae8d0216faa10569ac060e2 100644 (file)
@@ -363,7 +363,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
 
     wxMenu *file_menu = new wxMenu;
     file_menu->Append(ID_CLEARLOG, "&Clear log\tCtrl-L");
-    file_menu->Append(ID_FOREGROUND_COLOUR, "Set &foreground colour...\tCtrl-F");
+    file_menu->Append(ID_FOREGROUND_COLOUR, "Set &foreground colour...\tCtrl-S");
     file_menu->Append(ID_BACKGROUND_COLOUR, "Set &background colour...\tCtrl-B");
     file_menu->Append(ID_STYLE_MENU, "&Style", style_menu);
     file_menu->AppendSeparator();
@@ -1092,13 +1092,15 @@ void MyFrame::OnAddTreeItem(wxCommandEvent& WXUNUSED(event))
 {
     wxDataViewTreeCtrl* ctrl = (wxDataViewTreeCtrl*) m_ctrl[3];
     wxDataViewItem selected = ctrl->GetSelection();
-    ctrl->AppendItem( selected, "Item", 0 );
+    if (ctrl->IsContainer(selected))
+        ctrl->AppendItem( selected, "Item", 0 );
 }
 
 void MyFrame::OnAddTreeContainerItem(wxCommandEvent& WXUNUSED(event))
 {
     wxDataViewTreeCtrl* ctrl = (wxDataViewTreeCtrl*) m_ctrl[3];
     wxDataViewItem selected = ctrl->GetSelection();
-    ctrl->AppendContainer(selected, "Container", 0 );
+    if (ctrl->IsContainer(selected))
+        ctrl->AppendContainer(selected, "Container", 0 );
 }