]>
git.saurik.com Git - wxWidgets.git/blob - samples/treectrl/treetest.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxTreeCtrl sample
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // Define a new application type
13 class MyApp
: public wxApp
17 wxImageList
*m_imageListNormal
;
20 class MyTreeCtrl
: public wxTreeCtrl
23 MyTreeCtrl(wxWindow
*parent
, const wxWindowID id
, const wxPoint
& pos
,
24 const wxSize
& size
, long style
);
27 void AddItemsRecursively(const wxTreeItemId
& idParent
,
30 void AddTestItemsToTree(size_t numChildren
,
34 void OnBeginDrag(wxTreeEvent
& event
);
35 void OnBeginRDrag(wxTreeEvent
& event
);
36 void OnBeginLabelEdit(wxTreeEvent
& event
);
37 void OnEndLabelEdit(wxTreeEvent
& event
);
38 void OnDeleteItem(wxTreeEvent
& event
);
39 void OnGetInfo(wxTreeEvent
& event
);
40 void OnSetInfo(wxTreeEvent
& event
);
41 void OnItemExpanded(wxTreeEvent
& event
);
42 void OnItemExpanding(wxTreeEvent
& event
);
43 void OnItemCollapsed(wxTreeEvent
& event
);
44 void OnItemCollapsing(wxTreeEvent
& event
);
45 void OnSelChanged(wxTreeEvent
& event
);
46 void OnSelChanging(wxTreeEvent
& event
);
47 void OnKeyDown(wxTreeEvent
& event
);
52 // Define a new frame type
53 class MyFrame
: public wxFrame
55 MyTreeCtrl
*m_treeCtrl
;
56 wxTextCtrl
*m_logWindow
;
58 MyFrame(const wxString
& title
, int x
, int y
, int w
, int h
);
62 void OnQuit(wxCommandEvent
& event
);
63 void OnAbout(wxCommandEvent
& event
);
64 bool OnClose(void) { return TRUE
; }
69 class MyTreeItemData
: public wxTreeItemData
72 void ShowInfo(wxTreeCtrl
*tree
);
75 // ID for the menu quit command
77 #define TREE_ABOUT 102
79 #define TREE_CTRL 1000