]> git.saurik.com Git - wxWidgets.git/blame - contrib/samples/foldbar/foldpanelbar/test.cpp
Small fixes to allow compilation in Unicode mode with gcc
[wxWidgets.git] / contrib / samples / foldbar / foldpanelbar / test.cpp
CommitLineData
957f5ab7
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: test.cpp
f857e441 3// Purpose:
957f5ab7 4// Author: Jorgen Bodde
f857e441
WS
5// Modified by:
6// Created: 27/06/2004
7// RCS-ID: $Id$
8// Copyright: (c) Jorgen Bodde
9// Licence: wxWindows licence
957f5ab7
VZ
10/////////////////////////////////////////////////////////////////////////////
11
957f5ab7
VZ
12// For compilers that support precompilation, includes "wx/wx.h".
13#include "wx/wxprec.h"
14
15#ifdef __BORLANDC__
16#pragma hdrstop
17#endif
18
19#ifndef WX_PRECOMP
20#include "wx/wx.h"
21#endif
22
23////@begin includes
24////@end includes
25
26#include "test.h"
27
28////@begin XPM images
29////@end XPM images
30
31/*!
32 * TestTest type definition
33 */
34
35IMPLEMENT_CLASS( TestTest, wxDialog )
36
37/*!
38 * TestTest event table definition
39 */
40
41BEGIN_EVENT_TABLE( TestTest, wxDialog )
42
43////@begin TestTest event table entries
44////@end TestTest event table entries
45
46END_EVENT_TABLE()
47
48/*!
49 * TestTest constructors
50 */
51
52TestTest::TestTest( )
53{
54}
55
56TestTest::TestTest( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
57{
58 Create(parent, id, caption, pos, size, style);
59}
60
61/*!
62 * TestTest creator
63 */
64
65bool TestTest::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
66{
67////@begin TestTest member initialisation
68 blaat = NULL;
69 blaat = NULL;
70////@end TestTest member initialisation
71
72////@begin TestTest creation
73 SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
74 wxDialog::Create( parent, id, caption, pos, size, style );
75
76 CreateControls();
77 GetSizer()->Fit(this);
78 GetSizer()->SetSizeHints(this);
79 Centre();
80////@end TestTest creation
f857e441 81 return true;
957f5ab7
VZ
82}
83
84/*!
85 * Control creation for TestTest
86 */
87
88void TestTest::CreateControls()
f857e441 89{
957f5ab7
VZ
90////@begin TestTest content construction
91
92 TestTest* item1 = this;
93
94 wxFlexGridSizer* item2 = new wxFlexGridSizer(2, 1, 0, 0);
95 item2->AddGrowableRow(0);
96 item2->AddGrowableCol(0);
97 item1->SetSizer(item2);
f857e441 98 item1->SetAutoLayout(true);
957f5ab7
VZ
99 wxPanel* item3 = new wxPanel( item1, ID_PANEL7, wxDefaultPosition, wxSize(100, 50), wxNO_BORDER|wxTAB_TRAVERSAL );
100 item2->Add(item3, 1, wxGROW|wxGROW|wxADJUST_MINSIZE, 5);
101 wxBoxSizer* item4 = new wxBoxSizer(wxVERTICAL);
102 item3->SetSizer(item4);
f857e441 103 item3->SetAutoLayout(true);
957f5ab7
VZ
104 wxPanel* item5 = new wxPanel( item3, ID_PANEL6, wxDefaultPosition, wxSize(100, 80), wxSUNKEN_BORDER|wxNO_FULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL );
105 item4->Add(item5, 1, wxGROW|wxALL|wxADJUST_MINSIZE, 5);
106 wxFlexGridSizer* item6 = new wxFlexGridSizer(2, 1, 0, 0);
107 item6->AddGrowableRow(1);
108 item6->AddGrowableCol(0);
109 item5->SetSizer(item6);
f857e441 110 item5->SetAutoLayout(true);
957f5ab7
VZ
111 wxStaticText* item7 = new wxStaticText( item5, wxID_STATIC, _("Static text"), wxDefaultPosition, wxDefaultSize, 0 );
112 item6->Add(item7, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL|wxADJUST_MINSIZE, 5);
113 wxPanel* item8 = new wxPanel( item5, ID_PANEL3, wxDefaultPosition, wxSize(100, 80), wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
114 item6->Add(item8, 1, wxGROW|wxGROW|wxALL, 5);
115 wxBoxSizer* item9 = new wxBoxSizer(wxVERTICAL);
116 blaat = item9;
117 item8->SetSizer(item9);
f857e441 118 item8->SetAutoLayout(true);
957f5ab7
VZ
119 wxPanel* item10 = new wxPanel( item8, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL );
120 item9->Add(item10, 1, wxGROW, 5);
121 wxBoxSizer* item11 = new wxBoxSizer(wxVERTICAL);
122 item10->SetSizer(item11);
f857e441 123 item10->SetAutoLayout(true);
957f5ab7
VZ
124 wxString item12Strings[] = {
125 _("One"),
126 _("Two"),
127 _("Three")
128 };
129 wxChoice* item12 = new wxChoice( item10, ID_CHOICE, wxDefaultPosition, wxDefaultSize, 3, item12Strings, 0 );
130 item11->Add(item12, 0, wxGROW|wxALL, 5);
131 wxRadioButton* item13 = new wxRadioButton( item10, ID_RADIOBUTTON, _("I like this"), wxDefaultPosition, wxDefaultSize, 0 );
f857e441 132 item13->SetValue(true);
957f5ab7
VZ
133 item11->Add(item13, 0, wxALIGN_LEFT|wxALL, 5);
134 wxRadioButton* item14 = new wxRadioButton( item10, ID_RADIOBUTTON1, _("I hate it"), wxDefaultPosition, wxDefaultSize, 0 );
f857e441 135 item14->SetValue(false);
957f5ab7
VZ
136 item11->Add(item14, 0, wxALIGN_LEFT|wxALL, 5);
137 wxPanel* item15 = new wxPanel( item3, ID_PANEL2, wxDefaultPosition, wxSize(100, 80), wxSUNKEN_BORDER|wxNO_FULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL );
138 item4->Add(item15, 1, wxGROW|wxALL|wxADJUST_MINSIZE, 5);
139 wxFlexGridSizer* item16 = new wxFlexGridSizer(2, 1, 0, 0);
140 item16->AddGrowableRow(1);
141 item16->AddGrowableCol(0);
142 item15->SetSizer(item16);
f857e441 143 item15->SetAutoLayout(true);
957f5ab7
VZ
144 wxStaticText* item17 = new wxStaticText( item15, wxID_STATIC, _("Static text"), wxDefaultPosition, wxDefaultSize, 0 );
145 item16->Add(item17, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL|wxADJUST_MINSIZE|wxFIXED_MINSIZE, 5);
146 wxPanel* item18 = new wxPanel( item15, ID_PANEL4, wxDefaultPosition, wxSize(100, 80), wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
147 item16->Add(item18, 0, wxGROW|wxGROW|wxALL, 5);
148 wxBoxSizer* item19 = new wxBoxSizer(wxVERTICAL);
149 blaat = item19;
150 item18->SetSizer(item19);
f857e441 151 item18->SetAutoLayout(true);
957f5ab7
VZ
152 wxPanel* item20 = new wxPanel( item18, ID_PANEL5, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL );
153 item19->Add(item20, 1, wxGROW, 5);
154 wxBoxSizer* item21 = new wxBoxSizer(wxVERTICAL);
155 item20->SetSizer(item21);
f857e441 156 item20->SetAutoLayout(true);
957f5ab7
VZ
157 wxString item22Strings[] = {
158 _("One"),
159 _("Two"),
160 _("Three")
161 };
162 wxChoice* item22 = new wxChoice( item20, ID_CHOICE1, wxDefaultPosition, wxDefaultSize, 3, item22Strings, 0 );
163 item21->Add(item22, 0, wxGROW|wxALL, 5);
164 wxRadioButton* item23 = new wxRadioButton( item20, ID_RADIOBUTTON2, _("I like this"), wxDefaultPosition, wxDefaultSize, 0 );
f857e441 165 item23->SetValue(true);
957f5ab7
VZ
166 item21->Add(item23, 0, wxALIGN_LEFT|wxALL, 5);
167 wxRadioButton* item24 = new wxRadioButton( item20, ID_RADIOBUTTON3, _("I hate it"), wxDefaultPosition, wxDefaultSize, 0 );
f857e441 168 item24->SetValue(false);
957f5ab7
VZ
169 item21->Add(item24, 0, wxALIGN_LEFT|wxALL, 5);
170 wxPanel* item25 = new wxPanel( item1, ID_PANEL1, wxDefaultPosition, wxSize(100, 20), wxNO_BORDER|wxTAB_TRAVERSAL );
171 item25->SetBackgroundColour(wxColour(98, 98, 98));
172 item2->Add(item25, 0, wxGROW|wxGROW|wxFIXED_MINSIZE, 5);
173////@end TestTest content construction
174}
175
176/*!
177 * Should we show tooltips?
178 */
179
180bool TestTest::ShowToolTips()
181{
f857e441 182 return true;
957f5ab7
VZ
183}
184
185/*!
186 * Get bitmap resources
187 */
188
f857e441 189wxBitmap TestTest::GetBitmapResource( const wxString& WXUNUSED(name) )
957f5ab7
VZ
190{
191 // Bitmap retrieval
192////@begin TestTest bitmap retrieval
193 return wxNullBitmap;
194////@end TestTest bitmap retrieval
195}
196
197/*!
198 * Get icon resources
199 */
200
f857e441 201wxIcon TestTest::GetIconResource( const wxString& WXUNUSED(name) )
957f5ab7
VZ
202{
203 // Icon retrieval
204////@begin TestTest icon retrieval
205 return wxNullIcon;
206////@end TestTest icon retrieval
207}