1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Jorgen Bodde
8 // Copyright: (c) Jorgen Bodde
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(__APPLE__)
13 #pragma implementation "test.h"
16 // For compilers that support precompilation, includes "wx/wx.h".
17 #include "wx/wxprec.h"
36 * TestTest type definition
39 IMPLEMENT_CLASS( TestTest
, wxDialog
)
42 * TestTest event table definition
45 BEGIN_EVENT_TABLE( TestTest
, wxDialog
)
47 ////@begin TestTest event table entries
48 ////@end TestTest event table entries
53 * TestTest constructors
60 TestTest::TestTest( wxWindow
* parent
, wxWindowID id
, const wxString
& caption
, const wxPoint
& pos
, const wxSize
& size
, long style
)
62 Create(parent
, id
, caption
, pos
, size
, style
);
69 bool TestTest::Create( wxWindow
* parent
, wxWindowID id
, const wxString
& caption
, const wxPoint
& pos
, const wxSize
& size
, long style
)
71 ////@begin TestTest member initialisation
74 ////@end TestTest member initialisation
76 ////@begin TestTest creation
77 SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS
);
78 wxDialog::Create( parent
, id
, caption
, pos
, size
, style
);
81 GetSizer()->Fit(this);
82 GetSizer()->SetSizeHints(this);
84 ////@end TestTest creation
89 * Control creation for TestTest
92 void TestTest::CreateControls()
94 ////@begin TestTest content construction
96 TestTest
* item1
= this;
98 wxFlexGridSizer
* item2
= new wxFlexGridSizer(2, 1, 0, 0);
99 item2
->AddGrowableRow(0);
100 item2
->AddGrowableCol(0);
101 item1
->SetSizer(item2
);
102 item1
->SetAutoLayout(true);
103 wxPanel
* item3
= new wxPanel( item1
, ID_PANEL7
, wxDefaultPosition
, wxSize(100, 50), wxNO_BORDER
|wxTAB_TRAVERSAL
);
104 item2
->Add(item3
, 1, wxGROW
|wxGROW
|wxADJUST_MINSIZE
, 5);
105 wxBoxSizer
* item4
= new wxBoxSizer(wxVERTICAL
);
106 item3
->SetSizer(item4
);
107 item3
->SetAutoLayout(true);
108 wxPanel
* item5
= new wxPanel( item3
, ID_PANEL6
, wxDefaultPosition
, wxSize(100, 80), wxSUNKEN_BORDER
|wxNO_FULL_REPAINT_ON_RESIZE
|wxTAB_TRAVERSAL
);
109 item4
->Add(item5
, 1, wxGROW
|wxALL
|wxADJUST_MINSIZE
, 5);
110 wxFlexGridSizer
* item6
= new wxFlexGridSizer(2, 1, 0, 0);
111 item6
->AddGrowableRow(1);
112 item6
->AddGrowableCol(0);
113 item5
->SetSizer(item6
);
114 item5
->SetAutoLayout(true);
115 wxStaticText
* item7
= new wxStaticText( item5
, wxID_STATIC
, _("Static text"), wxDefaultPosition
, wxDefaultSize
, 0 );
116 item6
->Add(item7
, 0, wxALIGN_CENTER_HORIZONTAL
|wxGROW
|wxALL
|wxADJUST_MINSIZE
, 5);
117 wxPanel
* item8
= new wxPanel( item5
, ID_PANEL3
, wxDefaultPosition
, wxSize(100, 80), wxSUNKEN_BORDER
|wxTAB_TRAVERSAL
);
118 item6
->Add(item8
, 1, wxGROW
|wxGROW
|wxALL
, 5);
119 wxBoxSizer
* item9
= new wxBoxSizer(wxVERTICAL
);
121 item8
->SetSizer(item9
);
122 item8
->SetAutoLayout(true);
123 wxPanel
* item10
= new wxPanel( item8
, ID_PANEL
, wxDefaultPosition
, wxDefaultSize
, wxNO_BORDER
|wxFULL_REPAINT_ON_RESIZE
|wxTAB_TRAVERSAL
);
124 item9
->Add(item10
, 1, wxGROW
, 5);
125 wxBoxSizer
* item11
= new wxBoxSizer(wxVERTICAL
);
126 item10
->SetSizer(item11
);
127 item10
->SetAutoLayout(true);
128 wxString item12Strings
[] = {
133 wxChoice
* item12
= new wxChoice( item10
, ID_CHOICE
, wxDefaultPosition
, wxDefaultSize
, 3, item12Strings
, 0 );
134 item11
->Add(item12
, 0, wxGROW
|wxALL
, 5);
135 wxRadioButton
* item13
= new wxRadioButton( item10
, ID_RADIOBUTTON
, _("I like this"), wxDefaultPosition
, wxDefaultSize
, 0 );
136 item13
->SetValue(true);
137 item11
->Add(item13
, 0, wxALIGN_LEFT
|wxALL
, 5);
138 wxRadioButton
* item14
= new wxRadioButton( item10
, ID_RADIOBUTTON1
, _("I hate it"), wxDefaultPosition
, wxDefaultSize
, 0 );
139 item14
->SetValue(false);
140 item11
->Add(item14
, 0, wxALIGN_LEFT
|wxALL
, 5);
141 wxPanel
* item15
= new wxPanel( item3
, ID_PANEL2
, wxDefaultPosition
, wxSize(100, 80), wxSUNKEN_BORDER
|wxNO_FULL_REPAINT_ON_RESIZE
|wxTAB_TRAVERSAL
);
142 item4
->Add(item15
, 1, wxGROW
|wxALL
|wxADJUST_MINSIZE
, 5);
143 wxFlexGridSizer
* item16
= new wxFlexGridSizer(2, 1, 0, 0);
144 item16
->AddGrowableRow(1);
145 item16
->AddGrowableCol(0);
146 item15
->SetSizer(item16
);
147 item15
->SetAutoLayout(true);
148 wxStaticText
* item17
= new wxStaticText( item15
, wxID_STATIC
, _("Static text"), wxDefaultPosition
, wxDefaultSize
, 0 );
149 item16
->Add(item17
, 0, wxALIGN_CENTER_HORIZONTAL
|wxGROW
|wxALL
|wxADJUST_MINSIZE
|wxFIXED_MINSIZE
, 5);
150 wxPanel
* item18
= new wxPanel( item15
, ID_PANEL4
, wxDefaultPosition
, wxSize(100, 80), wxSUNKEN_BORDER
|wxTAB_TRAVERSAL
);
151 item16
->Add(item18
, 0, wxGROW
|wxGROW
|wxALL
, 5);
152 wxBoxSizer
* item19
= new wxBoxSizer(wxVERTICAL
);
154 item18
->SetSizer(item19
);
155 item18
->SetAutoLayout(true);
156 wxPanel
* item20
= new wxPanel( item18
, ID_PANEL5
, wxDefaultPosition
, wxDefaultSize
, wxNO_BORDER
|wxFULL_REPAINT_ON_RESIZE
|wxTAB_TRAVERSAL
);
157 item19
->Add(item20
, 1, wxGROW
, 5);
158 wxBoxSizer
* item21
= new wxBoxSizer(wxVERTICAL
);
159 item20
->SetSizer(item21
);
160 item20
->SetAutoLayout(true);
161 wxString item22Strings
[] = {
166 wxChoice
* item22
= new wxChoice( item20
, ID_CHOICE1
, wxDefaultPosition
, wxDefaultSize
, 3, item22Strings
, 0 );
167 item21
->Add(item22
, 0, wxGROW
|wxALL
, 5);
168 wxRadioButton
* item23
= new wxRadioButton( item20
, ID_RADIOBUTTON2
, _("I like this"), wxDefaultPosition
, wxDefaultSize
, 0 );
169 item23
->SetValue(true);
170 item21
->Add(item23
, 0, wxALIGN_LEFT
|wxALL
, 5);
171 wxRadioButton
* item24
= new wxRadioButton( item20
, ID_RADIOBUTTON3
, _("I hate it"), wxDefaultPosition
, wxDefaultSize
, 0 );
172 item24
->SetValue(false);
173 item21
->Add(item24
, 0, wxALIGN_LEFT
|wxALL
, 5);
174 wxPanel
* item25
= new wxPanel( item1
, ID_PANEL1
, wxDefaultPosition
, wxSize(100, 20), wxNO_BORDER
|wxTAB_TRAVERSAL
);
175 item25
->SetBackgroundColour(wxColour(98, 98, 98));
176 item2
->Add(item25
, 0, wxGROW
|wxGROW
|wxFIXED_MINSIZE
, 5);
177 ////@end TestTest content construction
181 * Should we show tooltips?
184 bool TestTest::ShowToolTips()
190 * Get bitmap resources
193 wxBitmap
TestTest::GetBitmapResource( const wxString
& WXUNUSED(name
) )
196 ////@begin TestTest bitmap retrieval
198 ////@end TestTest bitmap retrieval
205 wxIcon
TestTest::GetIconResource( const wxString
& WXUNUSED(name
) )
208 ////@begin TestTest icon retrieval
210 ////@end TestTest icon retrieval