EVT_MENU(TreeTest_CollapseAndReset, MyFrame::OnCollapseAndReset)
EVT_MENU(TreeTest_EnsureVisible, MyFrame::OnEnsureVisible)
EVT_MENU(TreeTest_AddItem, MyFrame::OnAddItem)
+ EVT_MENU(TreeTest_InsertItem, MyFrame::OnInsertItem)
EVT_MENU(TreeTest_IncIndent, MyFrame::OnIncIndent)
EVT_MENU(TreeTest_DecIndent, MyFrame::OnDecIndent)
EVT_MENU(TreeTest_IncSpacing, MyFrame::OnIncSpacing)
tree_menu->Append(TreeTest_CollapseAndReset, "C&ollapse and reset");
tree_menu->AppendSeparator();
tree_menu->Append(TreeTest_AddItem, "Append a &new item");
+ tree_menu->Append(TreeTest_InsertItem, "&Insert a new item");
tree_menu->Append(TreeTest_Delete, "&Delete this item");
tree_menu->Append(TreeTest_DeleteChildren, "Delete &children");
tree_menu->Append(TreeTest_DeleteAll, "Delete &all items");
wxTR_HAS_VARIABLE_ROW_HEIGHT |
#endif
wxSUNKEN_BORDER);
+
+ m_treeCtrl->SetBackgroundColour(wxColour(204, 205, 79));
+
wxTextCtrl *textCtrl = new wxTextCtrl(this, -1, "",
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxSUNKEN_BORDER);
CHECK_ITEM( item );
int i = m_treeCtrl->GetChildrenCount( item, FALSE );
-
+
wxLogMessage(wxT("%d children"), i);
}
CHECK_ITEM( item );
int i = m_treeCtrl->GetChildrenCount( item );
-
+
wxLogMessage(wxT("%d children"), i);
}
m_treeCtrl->DoEnsureVisible();
}
+void MyFrame::OnInsertItem(wxCommandEvent& WXUNUSED(event))
+{
+ m_treeCtrl->InsertItem(m_treeCtrl->GetRootItem(), 1, "2nd item");
+}
+
void MyFrame::OnAddItem(wxCommandEvent& WXUNUSED(event))
{
static int s_num = 0;