]>
Commit | Line | Data |
---|---|---|
bd9396d5 HH |
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; | |
bd9396d5 HH |
44 | |
45 | // FOR NOW:: | |
46 | typedef wxPanel MyTestPanel; | |
47 | ||
48 | // Define a new application type | |
49 | ||
50 | class MyApp: public wxApp | |
51 | { | |
21677c36 RS |
52 | public: |
53 | bool OnInit(void); | |
bd9396d5 HH |
54 | }; |
55 | ||
56 | // Define a new frame type | |
57 | ||
58 | class MyFrame: public wxFrame | |
59 | { | |
21677c36 | 60 | protected: |
bd9396d5 HH |
61 | |
62 | wxFrameLayout* mLayouts[MAX_LAYOUTS]; | |
63 | ||
64 | wxFrameLayout* mpNestedLayout; | |
65 | wxFrameLayout* mpAboutBoxLayout; | |
66 | ||
67 | int mActiveLayoutNo; | |
68 | bool mAutoSave; | |
69 | bool mSavedAlready; | |
70 | ||
71 | // container windows: | |
72 | ||
73 | wxTextCtrl* mpClntWindow; | |
74 | wxPanel* mpInternalFrm; | |
75 | ||
76 | wxImageList mImageList; | |
77 | ||
78 | wxFrame mAboutBox; | |
79 | ||
80 | // helpers for control-creation | |
81 | ||
82 | wxTextCtrl* CreateTxtCtrl ( const wxString& txt = "wxTextCtrl", wxWindow* parent = NULL ); | |
83 | wxTreeCtrl* CreateTreeCtrl( const wxString& label = "TreeCtrl" ); | |
84 | wxChoice* CreateChoice ( const wxString& txt = "Choice1" ); | |
85 | wxButton* CreateButton ( const wxString& label = "wxButton", | |
86 | wxWindow* pParent = NULL, long id = ID_SAY_ITSOK ); | |
87 | ||
88 | // helpers for layout-creation | |
89 | ||
90 | void AddSearchToolbars( wxFrameLayout& layout, wxWindow* pParent ); | |
91 | wxWindow* CreateDevLayout( wxFrameLayout& layout, wxWindow* pParent ); | |
92 | ||
93 | void DropInSomeBars( int layoutNo ); | |
94 | void CreateLayout( int layoutNo ); | |
95 | void RemoveLayout( int layoutNo ); | |
96 | void DestroyEverything(); | |
97 | ||
98 | void InitAboutBox(); | |
99 | ||
100 | void ActivateLayout( int layoutNo ); | |
101 | ||
bd9396d5 HH |
102 | |
103 | public: /* public */ | |
104 | ||
105 | MyFrame(wxFrame *frame, char *title, | |
106 | int x, int y, int w, int h); | |
107 | ||
108 | ~MyFrame(); | |
109 | ||
110 | void SyncMenuBarItems(); | |
111 | ||
112 | // event handlers | |
113 | ||
114 | bool OnClose(void); | |
115 | ||
bd9396d5 HH |
116 | void OnQuit(wxCommandEvent& event); |
117 | void OnAbout(wxCommandEvent& event); | |
118 | void OnSettings( wxCommandEvent& event ); | |
119 | void OnRemove( wxCommandEvent& event ); | |
120 | void OnRemoveAll( wxCommandEvent& event ); | |
121 | void OnRecreate( wxCommandEvent& event ); | |
122 | void OnFirst( wxCommandEvent& event ); | |
123 | void OnSecond( wxCommandEvent& event ); | |
124 | void OnThird( wxCommandEvent& event ); | |
125 | ||
126 | void OnSayItsOk( wxCommandEvent& event ); | |
127 | void OnBtnYes( wxCommandEvent& event ); | |
128 | void OnBtnNo( wxCommandEvent& event ); | |
129 | void OnBtnEsc( wxCommandEvent& event ); | |
130 | ||
131 | void OnChar( wxKeyEvent& event ); | |
132 | ||
133 | DECLARE_EVENT_TABLE() | |
134 | }; | |
135 | ||
136 | ||
137 | #endif |