]> git.saurik.com Git - wxWidgets.git/blob - utils/framelayout/samples/demo/fl_demo.h
Modified wxMSW listbox.cpp to work with wxCommandEvent::m_commandString
[wxWidgets.git] / utils / framelayout / samples / demo / fl_demo.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: No names yet.
3 // Purpose: Contrib. demo
4 // Author: Aleksandras Gluchovas
5 // Modified by:
6 // Created: 04/11/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __FLDEMO_G__
13 #define __FLDEMO_G__
14
15 // ID for the menu commands
16
17 #define MINIMAL_QUIT 1
18 #define MINIMAL_ABOUT 102
19
20 #define ID_LOAD 103
21 #define ID_STORE 104
22 #define ID_AUTOSAVE 105
23 #define ID_SETTINGS 106
24 #define ID_REMOVE 107
25 #define ID_REMOVEALL 108
26 #define ID_RECREATE 109
27 #define ID_ACTIVATE 110
28 #define ID_FIRST 111
29 #define ID_SECOND 112
30 #define ID_THIRD 113
31
32 #define ID_SAY_ITSOK 114
33 #define ID_BTN_YES 115
34 #define ID_BTN_NO 116
35 #define ID_BTN_ESC 117
36
37 #define MAX_LAYOUTS 3
38
39 #define FIRST_LAYOUT 0
40 #define SECOND_LAYOUT 1
41 #define THIRD_LAYOUT 2
42
43 class wxFrameLayout;
44 class wxObjectStorage;
45
46 // FOR NOW::
47 typedef wxPanel MyTestPanel;
48
49 // Define a new application type
50
51 class MyApp: public wxApp
52 {
53 public:
54 bool OnInit(void);
55 };
56
57 // Define a new frame type
58
59 class MyFrame: public wxFrame
60 {
61 protected:
62
63 wxFrameLayout* mLayouts[MAX_LAYOUTS];
64
65 wxFrameLayout* mpNestedLayout;
66 wxFrameLayout* mpAboutBoxLayout;
67
68 int mActiveLayoutNo;
69 bool mAutoSave;
70 bool mSavedAlready;
71
72 // container windows:
73
74 wxTextCtrl* mpClntWindow;
75 wxPanel* mpInternalFrm;
76
77 wxImageList mImageList;
78
79 wxFrame mAboutBox;
80
81 // helpers for control-creation
82
83 wxTextCtrl* CreateTxtCtrl ( const wxString& txt = "wxTextCtrl", wxWindow* parent = NULL );
84 wxTreeCtrl* CreateTreeCtrl( const wxString& label = "TreeCtrl" );
85 wxChoice* CreateChoice ( const wxString& txt = "Choice1" );
86 wxButton* CreateButton ( const wxString& label = "wxButton",
87 wxWindow* pParent = NULL, long id = ID_SAY_ITSOK );
88
89 // helpers for layout-creation
90
91 void AddSearchToolbars( wxFrameLayout& layout, wxWindow* pParent );
92 wxWindow* CreateDevLayout( wxFrameLayout& layout, wxWindow* pParent );
93
94 void DropInSomeBars( int layoutNo );
95 void CreateLayout( int layoutNo );
96 void RemoveLayout( int layoutNo );
97 void DestroyEverything();
98
99 void InitAboutBox();
100
101 void ActivateLayout( int layoutNo );
102
103 void SerializeMe( wxObjectStorage& store );
104
105 public: /* public */
106
107 MyFrame(wxFrame *frame, char *title,
108 int x, int y, int w, int h);
109
110 ~MyFrame();
111
112 void SyncMenuBarItems();
113
114 // event handlers
115
116 bool OnClose(void);
117
118 void OnLoad( wxCommandEvent& event );
119 void OnStore( wxCommandEvent& event );
120 void OnAutoSave( wxCommandEvent& event );
121 void OnQuit(wxCommandEvent& event);
122 void OnAbout(wxCommandEvent& event);
123 void OnSettings( wxCommandEvent& event );
124 void OnRemove( wxCommandEvent& event );
125 void OnRemoveAll( wxCommandEvent& event );
126 void OnRecreate( wxCommandEvent& event );
127 void OnFirst( wxCommandEvent& event );
128 void OnSecond( wxCommandEvent& event );
129 void OnThird( wxCommandEvent& event );
130
131 void OnSayItsOk( wxCommandEvent& event );
132 void OnBtnYes( wxCommandEvent& event );
133 void OnBtnNo( wxCommandEvent& event );
134 void OnBtnEsc( wxCommandEvent& event );
135
136 void OnChar( wxKeyEvent& event );
137
138 DECLARE_EVENT_TABLE()
139 };
140
141
142 #endif