#endif
#include "wx/colordlg.h"
+#include "wx/numdlg.h"
#include "wx/image.h"
#include "wx/imaglist.h"
#include "icon3.xpm"
#include "icon4.xpm"
#include "icon5.xpm"
+
+#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__)
#include "mondrian.xpm"
+#endif
// verify that the item is ok and insult the user if it is not
MENU_LINK(IncSpacing)
MENU_LINK(DecSpacing)
MENU_LINK(ToggleIcon)
+ MENU_LINK(SelectRoot)
#undef MENU_LINK
END_EVENT_TABLE()
tree_menu->Append(TreeTest_Delete, wxT("&Delete this item"));
tree_menu->Append(TreeTest_DeleteChildren, wxT("Delete &children"));
tree_menu->Append(TreeTest_DeleteAll, wxT("Delete &all items"));
+ tree_menu->Append(TreeTest_SelectRoot, wxT("Select root item"));
tree_menu->AppendSeparator();
tree_menu->Append(TreeTest_Count, wxT("Count children of current item"));
tree_menu->Append(TreeTest_CountRec, wxT("Recursively count children of current item"));
void MyFrame::OnIdle(wxIdleEvent& event)
{
#if wxUSE_STATUSBAR
- wxTreeItemId idRoot = m_treeCtrl->GetRootItem();
-
- SetStatusText(wxString::Format
- (
- _T("Root/last item is %svisible/%svisible"),
- m_treeCtrl->IsVisible(idRoot) ? _T("") : _T("not "),
- m_treeCtrl->IsVisible(m_treeCtrl->GetLastChild(idRoot))
- ? _T("") : _T("not ")
- ), 1);
+ if ( m_treeCtrl )
+ {
+ wxTreeItemId idRoot = m_treeCtrl->GetRootItem();
+
+ SetStatusText(wxString::Format
+ (
+ _T("Root/last item is %svisible/%svisible"),
+ m_treeCtrl->IsVisible(idRoot) ? _T("") : _T("not "),
+ m_treeCtrl->IsVisible(m_treeCtrl->GetLastChild(idRoot))
+ ? _T("") : _T("not ")
+ ), 1);
+ }
#endif // wxUSE_STATUSBAR
event.Skip();
m_treeCtrl->SelectItem(m_treeCtrl->GetSelection());
}
+void MyFrame::OnSelectRoot(wxCommandEvent& WXUNUSED(event))
+{
+ m_treeCtrl->SelectItem(m_treeCtrl->GetRootItem());
+}
+
void MyFrame::OnUnselect(wxCommandEvent& WXUNUSED(event))
{
m_treeCtrl->UnselectAll();