]> git.saurik.com Git - wxWidgets.git/blame - contrib/samples/fl/fl_demo2.h
Updated list of subprojects.
[wxWidgets.git] / contrib / samples / fl / fl_demo2.h
CommitLineData
03206f17
VS
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
c82c42d4 9// Licence: wxWindows license
03206f17
VS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __FLDEMO_G__
13#define __FLDEMO_G__
14
15// ID for the menu commands
16
c82c42d4 17#define MINIMAL_QUIT 1
03206f17
VS
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
c82c42d4 28#define ID_FIRST 111
03206f17
VS
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
43class wxFrameLayout;
44class wxObjectStorage;
45
46// FOR NOW::
47typedef wxPanel MyTestPanel;
48
49// Define a new application type
50
51class MyApp: public wxApp
0423ae97 52{
03206f17
VS
53public:
54 bool OnInit(void);
55};
56
57// Define a new frame type
58
59class MyFrame: public wxFrame
0423ae97 60{
03206f17 61protected:
0423ae97 62
03206f17 63 wxFrameLayout* mLayouts[MAX_LAYOUTS];
0423ae97 64
03206f17
VS
65 wxFrameLayout* mpNestedLayout;
66 wxFrameLayout* mpAboutBoxLayout;
0423ae97
MR
67
68 int mActiveLayoutNo;
03206f17
VS
69 bool mAutoSave;
70 bool mSavedAlready;
0423ae97 71
03206f17 72 // container windows:
0423ae97 73
03206f17
VS
74 wxTextCtrl* mpClntWindow;
75 wxPanel* mpInternalFrm;
0423ae97 76
03206f17 77 wxImageList mImageList;
0423ae97 78
03206f17 79 wxFrame mAboutBox;
0423ae97 80
03206f17 81 // helpers for control-creation
0423ae97 82
05aa1fc7
JS
83 wxTextCtrl* CreateTxtCtrl ( const wxString& txt = wxT("wxTextCtrl"), wxWindow* parent = NULL );
84 wxTreeCtrl* CreateTreeCtrl( const wxString& label = wxT("TreeCtrl") );
85 wxChoice* CreateChoice ( const wxString& txt = wxT("Choice1") );
86 wxButton* CreateButton ( const wxString& label = wxT("wxButton"), wxWindow* pParent = NULL, long id = ID_SAY_ITSOK );
0423ae97 87
03206f17 88 // helpers for layout-creation
0423ae97 89
03206f17
VS
90 void AddSearchToolbars( wxFrameLayout& layout, wxWindow* pParent );
91 wxWindow* CreateDevLayout( wxFrameLayout& layout, wxWindow* pParent );
0423ae97 92
03206f17
VS
93 void DropInSomeBars( int layoutNo );
94 void CreateLayout( int layoutNo );
95 void RemoveLayout( int layoutNo );
0423ae97 96
03206f17 97 void InitAboutBox();
0423ae97 98
03206f17 99 void ActivateLayout( int layoutNo );
0423ae97 100
03206f17 101public: /* public */
0423ae97 102
05aa1fc7 103 MyFrame( wxFrame *frame, const wxChar *title, int x, int y, int w, int h);
0423ae97 104
03206f17 105 ~MyFrame();
0423ae97 106
03206f17 107 void SyncMenuBarItems();
0423ae97 108
03206f17 109 // event handlers
0423ae97 110
03206f17 111 bool OnClose(void);
0423ae97 112
03206f17
VS
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 );
0423ae97 125
03206f17
VS
126 void OnSayItsOk( wxCommandEvent& event );
127 void OnBtnYes( wxCommandEvent& event );
128 void OnBtnNo( wxCommandEvent& event );
129 void OnBtnEsc( wxCommandEvent& event );
0423ae97 130
03206f17 131 void OnChar( wxKeyEvent& event );
0423ae97
MR
132
133 DECLARE_EVENT_TABLE()
03206f17
VS
134};
135
136// Define a new button type, StartButton95 (Just for fun)
137
138class StartButton95 : public wxPanel
139{
140 DECLARE_DYNAMIC_CLASS( StartButton95 )
0423ae97 141
03206f17
VS
142 bool m_bPressed;
143 wxBitmap m_PBmp;
144 wxBitmap m_DBmp;
0423ae97 145
03206f17 146public:
c82c42d4 147 StartButton95(void) : m_bPressed(false) {}
0423ae97
MR
148
149 StartButton95(wxWindow* parent)
c82c42d4 150 : m_bPressed(false) { wxPanel::Create(parent,wxID_ANY); }
0423ae97 151
03206f17
VS
152 void OnMouseDown( wxMouseEvent& event );
153 void OnMouseUp( wxMouseEvent& event );
154 void OnPaint( wxPaintEvent& event );
0423ae97 155
03206f17
VS
156 DECLARE_EVENT_TABLE()
157};
158
159#endif
160