X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a53f722ff298f81f92a0f65b6fdf864c20afc376..2ac06991a797c3a97e47f1f1f3ca313e17c78a10:/samples/dataview/dataview.cpp?ds=sidebyside diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index 3f0db083cc..1f43e05adb 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -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 ); }