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();
{
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 );
}