]>
git.saurik.com Git - wxWidgets.git/blob - contrib/samples/fl/fl_demo2.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Contrib. demo
4 // Author: Aleksandras Gluchovas
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
15 // ID for the menu commands
17 #define MINIMAL_QUIT 1
18 #define MINIMAL_ABOUT 102
22 #define ID_AUTOSAVE 105
23 //#define ID_SETTINGS 106
25 #define ID_REMOVEALL 108
26 #define ID_RECREATE 109
27 #define ID_ACTIVATE 110
32 #define ID_SAY_ITSOK 114
33 #define ID_BTN_YES 115
35 #define ID_BTN_ESC 117
39 #define FIRST_LAYOUT 0
40 #define SECOND_LAYOUT 1
41 #define THIRD_LAYOUT 2
44 class wxObjectStorage
;
47 typedef wxPanel MyTestPanel
;
49 // Define a new application type
51 class MyApp
: public wxApp
57 // Define a new frame type
59 class MyFrame
: public wxFrame
63 wxFrameLayout
* mLayouts
[MAX_LAYOUTS
];
65 wxFrameLayout
* mpNestedLayout
;
66 wxFrameLayout
* mpAboutBoxLayout
;
74 wxTextCtrl
* mpClntWindow
;
75 wxPanel
* mpInternalFrm
;
77 wxImageList mImageList
;
81 // helpers for control-creation
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", wxWindow
* pParent
= NULL
, long id
= ID_SAY_ITSOK
);
88 // helpers for layout-creation
90 void AddSearchToolbars( wxFrameLayout
& layout
, wxWindow
* pParent
);
91 wxWindow
* CreateDevLayout( wxFrameLayout
& layout
, wxWindow
* pParent
);
93 void DropInSomeBars( int layoutNo
);
94 void CreateLayout( int layoutNo
);
95 void RemoveLayout( int layoutNo
);
99 void ActivateLayout( int layoutNo
);
103 MyFrame( wxFrame
*frame
, char *title
, int x
, int y
, int w
, int h
);
107 void SyncMenuBarItems();
113 void OnLoad( wxCommandEvent
& event
);
114 void OnStore( wxCommandEvent
& event
);
115 void OnAutoSave( wxCommandEvent
& event
);
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
);
126 void OnSayItsOk( wxCommandEvent
& event
);
127 void OnBtnYes( wxCommandEvent
& event
);
128 void OnBtnNo( wxCommandEvent
& event
);
129 void OnBtnEsc( wxCommandEvent
& event
);
131 void OnChar( wxKeyEvent
& event
);
133 DECLARE_EVENT_TABLE()
136 // Define a new button type, StartButton95 (Just for fun)
138 class StartButton95
: public wxPanel
140 DECLARE_DYNAMIC_CLASS( StartButton95
)
147 StartButton95(void) : m_bPressed(FALSE
) {}
149 StartButton95(wxWindow
* parent
)
150 : m_bPressed(FALSE
) { wxPanel::Create(parent
,-1); }
152 void OnMouseDown( wxMouseEvent
& event
);
153 void OnMouseUp( wxMouseEvent
& event
);
154 void OnPaint( wxPaintEvent
& event
);
156 DECLARE_EVENT_TABLE()