]> git.saurik.com Git - wxWidgets.git/blob - contrib/samples/gizmos/splittree/tree.h
Added code to show off wxDbGrid (contributed by Paul and Roger Gammans) in wxUSE_NEW_...
[wxWidgets.git] / contrib / samples / gizmos / splittree / tree.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: tree.h
3 // Purpose: Testing tree functionality
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 04/01/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _TREE_H_
13 #define _TREE_H_
14
15 #include "wx/wx.h"
16 #include "wx/gizmos/splittree.h"
17
18 class TestValueWindow;
19
20 // Define a new application type, each program should derive a class from wxApp
21 class MyApp : public wxApp
22 {
23 public:
24 // override base class virtuals
25 // ----------------------------
26
27 // this one is called on application startup and is a good place for the app
28 // initialization (doing it here and not in the ctor allows to have an error
29 // return: if OnInit() returns false, the application terminates)
30 virtual bool OnInit();
31 };
32
33 // Define a new frame type: this is going to be our main frame
34 class MyFrame : public wxFrame
35 {
36 public:
37 // ctor(s)
38 MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
39
40 // event handlers (these functions should _not_ be virtual)
41 void OnQuit(wxCommandEvent& event);
42 void OnAbout(wxCommandEvent& event);
43
44 protected:
45 wxRemotelyScrolledTreeCtrl* m_tree;
46 wxThinSplitterWindow* m_splitter;
47 wxSplitterScrolledWindow* m_scrolledWindow;
48 TestValueWindow* m_valueWindow;
49
50 private:
51 // any class wishing to process wxWindows events must use this macro
52 DECLARE_EVENT_TABLE()
53 };
54
55 // ----------------------------------------------------------------------------
56 // constants
57 // ----------------------------------------------------------------------------
58
59 // IDs for the controls and the menu commands
60 enum
61 {
62 // menu items
63 Minimal_Quit = 100,
64 Minimal_About
65 };
66
67 #define idTREE_CTRL 2000
68 #define idSPLITTER_WINDOW 2001
69 #define idVALUE_WINDOW 2002
70 #define idMAIN_FRAME 2003
71 #define idSCROLLED_WINDOW 2004
72
73 class TestTree: public wxRemotelyScrolledTreeCtrl
74 {
75 DECLARE_CLASS(TestTree)
76 public:
77 TestTree(wxWindow* parent, wxWindowID id, const wxPoint& pt = wxDefaultPosition,
78 const wxSize& sz = wxDefaultSize, long style = wxTR_HAS_BUTTONS);
79 ~TestTree();
80
81 void OnPaint(wxPaintEvent& event);
82 DECLARE_EVENT_TABLE()
83 protected:
84 wxImageList* m_imageList;
85 };
86
87 class TestValueWindow: public wxTreeCompanionWindow
88 {
89 public:
90 TestValueWindow(wxWindow* parent, wxWindowID id = -1,
91 const wxPoint& pos = wxDefaultPosition,
92 const wxSize& sz = wxDefaultSize,
93 long style = 0);
94
95 //// Overrides
96
97 //// Events
98
99 //// Data members
100 protected:
101
102 DECLARE_EVENT_TABLE()
103 };
104
105
106
107 #endif
108 // _TREE_H_