]>
git.saurik.com Git - wxWidgets.git/blob - samples/controls/controls.cpp
6bd7b650e7458eff75e6ad5b1112a23e8fde6204
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Controls wxWindows sample
4 // Author: Robert Roebling
7 // Copyright: (c) Robert Roebling, Julian Smart
8 // Licence: wxWindows license
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "controls.h"
15 // For compilers that support precompilation, includes "wx/wx.h".
16 #include "wx/wxprec.h"
24 #include "wx/spinbutt.h"
27 #include "wx/notebook.h"
28 #include "wx/imaglist.h"
30 #if defined(__WXGTK__) || defined(__WXMOTIF__)
31 #include "mondrian.xpm"
32 #include "icons/choice.xpm"
33 #include "icons/combo.xpm"
34 #include "icons/list.xpm"
35 #include "icons/radio.xpm"
36 #include "icons/text.xpm"
37 #include "icons/gauge.xpm"
40 //----------------------------------------------------------------------
42 //----------------------------------------------------------------------
44 class MyApp
: public wxApp
50 class MyPanel
: public wxPanel
54 MyPanel(wxFrame
*frame
, int x
, int y
, int w
, int h
);
57 void OnSize( wxSizeEvent
& event
);
58 void OnListBox( wxCommandEvent
&event
);
59 void OnListBoxButtons( wxCommandEvent
&event
);
60 void OnChoice( wxCommandEvent
&event
);
61 void OnChoiceButtons( wxCommandEvent
&event
);
62 void OnCombo( wxCommandEvent
&event
);
63 void OnComboButtons( wxCommandEvent
&event
);
64 void OnRadio( wxCommandEvent
&event
);
65 void OnRadioButtons( wxCommandEvent
&event
);
66 void OnSetFont( wxCommandEvent
&event
);
67 void OnPageChanged( wxNotebookEvent
&event
);
68 void OnSliderUpdate( wxCommandEvent
&event
);
69 void OnSpinUpdate( wxSpinEvent
&event
);
77 wxButton
*m_fontButton
;
78 wxSpinButton
*m_spinbutton
;
79 wxTextCtrl
*m_spintext
;
82 wxNotebook
*m_notebook
;
87 class MyFrame
: public wxFrame
91 MyFrame(wxFrame
*frame
, char *title
, int x
, int y
, int w
, int h
);
95 void OnQuit(wxCommandEvent
& event
);
96 void OnAbout(wxCommandEvent
& event
);
97 bool OnClose(void) { return TRUE
; }
102 //----------------------------------------------------------------------
104 //----------------------------------------------------------------------
106 IMPLEMENT_APP (MyApp
)
108 //----------------------------------------------------------------------
110 //----------------------------------------------------------------------
112 const int MINIMAL_QUIT
= 100;
113 const int MINIMAL_TEXT
= 101;
114 const int MINIMAL_ABOUT
= 102;
116 bool MyApp::OnInit(void)
118 // Create the main frame window
119 MyFrame
*frame
= new MyFrame((wxFrame
*) NULL
, (char *) "Controls wxWindows App", 50, 50, 530, 420 );
123 frame
->SetIcon(wxIcon("mondrian"));
125 frame
->SetIcon(wxIcon( mondrian_xpm
));
128 wxMenu
*file_menu
= new wxMenu
;
130 file_menu
->Append(MINIMAL_ABOUT
, "&About");
131 file_menu
->Append(MINIMAL_QUIT
, "E&xit");
132 wxMenuBar
*menu_bar
= new wxMenuBar
;
133 menu_bar
->Append(file_menu
, "&File");
134 frame
->SetMenuBar(menu_bar
);
143 //----------------------------------------------------------------------
145 //----------------------------------------------------------------------
147 const ID_NOTEBOOK
= 1000;
149 const ID_LISTBOX
= 130;
150 const ID_LISTBOX_SEL_NUM
= 131;
151 const ID_LISTBOX_SEL_STR
= 132;
152 const ID_LISTBOX_CLEAR
= 133;
153 const ID_LISTBOX_APPEND
= 134;
154 const ID_LISTBOX_DELETE
= 135;
155 const ID_LISTBOX_FONT
= 136;
156 const ID_LISTBOX_ENABLE
= 137;
158 const ID_CHOICE
= 120;
159 const ID_CHOICE_SEL_NUM
= 121;
160 const ID_CHOICE_SEL_STR
= 122;
161 const ID_CHOICE_CLEAR
= 123;
162 const ID_CHOICE_APPEND
= 124;
163 const ID_CHOICE_DELETE
= 125;
164 const ID_CHOICE_FONT
= 126;
165 const ID_CHOICE_ENABLE
= 127;
167 const ID_COMBO
= 140;
168 const ID_COMBO_SEL_NUM
= 141;
169 const ID_COMBO_SEL_STR
= 142;
170 const ID_COMBO_CLEAR
= 143;
171 const ID_COMBO_APPEND
= 144;
172 const ID_COMBO_DELETE
= 145;
173 const ID_COMBO_FONT
= 146;
174 const ID_COMBO_ENABLE
= 147;
178 const ID_RADIOBOX
= 160;
179 const ID_RADIOBOX_SEL_NUM
= 161;
180 const ID_RADIOBOX_SEL_STR
= 162;
181 const ID_RADIOBOX_FONT
= 163;
182 const ID_RADIOBOX_ENABLE
= 164;
184 const ID_SET_FONT
= 170;
186 const ID_GAUGE
= 180;
187 const ID_SLIDER
= 181;
192 BEGIN_EVENT_TABLE(MyPanel
, wxPanel
)
193 EVT_SIZE ( MyPanel::OnSize
)
194 EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK
, MyPanel::OnPageChanged
)
195 EVT_LISTBOX (ID_LISTBOX
, MyPanel::OnListBox
)
196 EVT_BUTTON (ID_LISTBOX_SEL_NUM
, MyPanel::OnListBoxButtons
)
197 EVT_BUTTON (ID_LISTBOX_SEL_STR
, MyPanel::OnListBoxButtons
)
198 EVT_BUTTON (ID_LISTBOX_CLEAR
, MyPanel::OnListBoxButtons
)
199 EVT_BUTTON (ID_LISTBOX_APPEND
, MyPanel::OnListBoxButtons
)
200 EVT_BUTTON (ID_LISTBOX_DELETE
, MyPanel::OnListBoxButtons
)
201 EVT_BUTTON (ID_LISTBOX_FONT
, MyPanel::OnListBoxButtons
)
202 EVT_CHECKBOX (ID_LISTBOX_ENABLE
, MyPanel::OnListBoxButtons
)
203 EVT_CHOICE (ID_CHOICE
, MyPanel::OnChoice
)
204 EVT_BUTTON (ID_CHOICE_SEL_NUM
, MyPanel::OnChoiceButtons
)
205 EVT_BUTTON (ID_CHOICE_SEL_STR
, MyPanel::OnChoiceButtons
)
206 EVT_BUTTON (ID_CHOICE_CLEAR
, MyPanel::OnChoiceButtons
)
207 EVT_BUTTON (ID_CHOICE_APPEND
, MyPanel::OnChoiceButtons
)
208 EVT_BUTTON (ID_CHOICE_DELETE
, MyPanel::OnChoiceButtons
)
209 EVT_BUTTON (ID_CHOICE_FONT
, MyPanel::OnChoiceButtons
)
210 EVT_CHECKBOX (ID_CHOICE_ENABLE
, MyPanel::OnChoiceButtons
)
211 EVT_CHOICE (ID_COMBO
, MyPanel::OnCombo
)
212 EVT_BUTTON (ID_COMBO_SEL_NUM
, MyPanel::OnComboButtons
)
213 EVT_BUTTON (ID_COMBO_SEL_STR
, MyPanel::OnComboButtons
)
214 EVT_BUTTON (ID_COMBO_CLEAR
, MyPanel::OnComboButtons
)
215 EVT_BUTTON (ID_COMBO_APPEND
, MyPanel::OnComboButtons
)
216 EVT_BUTTON (ID_COMBO_DELETE
, MyPanel::OnComboButtons
)
217 EVT_BUTTON (ID_COMBO_FONT
, MyPanel::OnComboButtons
)
218 EVT_CHECKBOX (ID_COMBO_ENABLE
, MyPanel::OnComboButtons
)
219 EVT_RADIOBOX (ID_RADIOBOX
, MyPanel::OnRadio
)
220 EVT_BUTTON (ID_RADIOBOX_SEL_NUM
, MyPanel::OnRadioButtons
)
221 EVT_BUTTON (ID_RADIOBOX_SEL_STR
, MyPanel::OnRadioButtons
)
222 EVT_BUTTON (ID_RADIOBOX_FONT
, MyPanel::OnRadioButtons
)
223 EVT_CHECKBOX (ID_RADIOBOX_ENABLE
, MyPanel::OnRadioButtons
)
224 EVT_BUTTON (ID_SET_FONT
, MyPanel::OnSetFont
)
225 EVT_SLIDER (ID_SLIDER
, MyPanel::OnSliderUpdate
)
226 EVT_SPIN (ID_SPIN
, MyPanel::OnSpinUpdate
)
229 MyPanel::MyPanel( wxFrame
*frame
, int x
, int y
, int w
, int h
) :
230 wxPanel( frame
, -1, wxPoint(x
, y
), wxSize(w
, h
) )
232 SetBackgroundColour("cadet blue");
234 m_text
= new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE
);
235 m_text
->SetBackgroundColour("wheat");
237 m_notebook
= new wxNotebook( this, ID_NOTEBOOK
, wxPoint(0,0), wxSize(200,150) );
248 // image ids and names
251 Image_List
, Image_Choice
, Image_Combo
, Image_Text
, Image_Radio
, Image_Gauge
, Image_Max
254 // fill the image list
256 const char *aIconNames
[] =
258 "list.xpm", "choice.xpm", "combo.xpm", "text.xpm", "radio.xpm", "gauge.txt"
261 wxASSERT( WXSIZEOF(aIconNames
) == Image_Max
); // keep in sync
263 wxString strIconDir
= "icons/";
265 wxImageList
*imagelist
= new wxImageList(32, 32);
266 for ( size_t n
= 0; n
< Image_Max
; n
++ )
268 imagelist
->Add(wxBitmap(strIconDir
+ aIconNames
[n
]));
271 wxImageList
*imagelist
= new wxImageList(32, 32);
273 imagelist
-> Add( wxBitmap( list_xpm
));
274 imagelist
-> Add( wxBitmap( choice_xpm
));
275 imagelist
-> Add( wxBitmap( combo_xpm
));
276 imagelist
-> Add( wxBitmap( text_xpm
));
277 imagelist
-> Add( wxBitmap( radio_xpm
));
278 imagelist
-> Add( wxBitmap( gauge_xpm
));
281 wxButton
*button
= (wxButton
*)NULL
;
283 m_notebook
->SetImageList(imagelist
);
284 m_notebook
->SetBackgroundColour("cadet blue");
286 wxPanel
*panel
= (wxPanel
*) NULL
;
287 panel
= new wxPanel(m_notebook
);
288 panel
->SetBackgroundColour("cadet blue");
289 panel
->SetForegroundColour("blue");
290 m_listbox
= new wxListBox( panel
, ID_LISTBOX
, wxPoint(10,10), wxSize(120,70), 5, choices
);
291 m_listbox
->SetBackgroundColour("wheat");
292 (void)new wxButton( panel
, ID_LISTBOX_SEL_NUM
, "Select #2", wxPoint(180,30), wxSize(140,30) );
293 (void)new wxButton( panel
, ID_LISTBOX_SEL_STR
, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
294 (void)new wxButton( panel
, ID_LISTBOX_CLEAR
, "Clear", wxPoint(180,80), wxSize(140,30) );
295 (void)new wxButton( panel
, ID_LISTBOX_APPEND
, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
296 (void)new wxButton( panel
, ID_LISTBOX_DELETE
, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
297 button
= new wxButton( panel
, ID_LISTBOX_FONT
, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
298 button
->SetForegroundColour( "red" );
299 (void)new wxCheckBox( panel
, ID_LISTBOX_ENABLE
, "Disable", wxPoint(20,130), wxSize(140,30) );
300 m_notebook
->AddPage(panel
, "wxList", FALSE
, Image_List
);
302 panel
= new wxPanel(m_notebook
);
303 panel
->SetBackgroundColour("cadet blue");
304 panel
->SetForegroundColour("blue");
305 m_choice
= new wxChoice( panel
, ID_CHOICE
, wxPoint(10,10), wxSize(120,-1), 5, choices
);
306 m_choice
->SetBackgroundColour("wheat");
307 (void)new wxButton( panel
, ID_CHOICE_SEL_NUM
, "Select #2", wxPoint(180,30), wxSize(140,30) );
308 (void)new wxButton( panel
, ID_CHOICE_SEL_STR
, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
309 (void)new wxButton( panel
, ID_CHOICE_CLEAR
, "Clear", wxPoint(180,80), wxSize(140,30) );
310 (void)new wxButton( panel
, ID_CHOICE_APPEND
, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
311 (void)new wxButton( panel
, ID_CHOICE_DELETE
, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
312 (void)new wxButton( panel
, ID_CHOICE_FONT
, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
313 (void)new wxCheckBox( panel
, ID_CHOICE_ENABLE
, "Disable", wxPoint(20,130), wxSize(140,30) );
314 m_notebook
->AddPage(panel
, "wxChoice", FALSE
, Image_Choice
);
316 panel
= new wxPanel(m_notebook
);
317 panel
->SetBackgroundColour("cadet blue");
318 panel
->SetForegroundColour("blue");
319 m_combo
= new wxComboBox( panel
, ID_COMBO
, "This", wxPoint(10,10), wxSize(120,-1), 5, choices
);
320 m_combo
->SetBackgroundColour("wheat");
321 (void)new wxButton( panel
, ID_COMBO_SEL_NUM
, "Select #2", wxPoint(180,30), wxSize(140,30) );
322 (void)new wxButton( panel
, ID_COMBO_SEL_STR
, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
323 (void)new wxButton( panel
, ID_COMBO_CLEAR
, "Clear", wxPoint(180,80), wxSize(140,30) );
324 (void)new wxButton( panel
, ID_COMBO_APPEND
, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
325 (void)new wxButton( panel
, ID_COMBO_DELETE
, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
326 (void)new wxButton( panel
, ID_COMBO_FONT
, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
327 (void)new wxCheckBox( panel
, ID_COMBO_ENABLE
, "Disable", wxPoint(20,130), wxSize(140,30) );
328 m_notebook
->AddPage(panel
, "wxComboBox", FALSE
, Image_Combo
);
330 panel
= new wxPanel(m_notebook
);
331 panel
->SetBackgroundColour("cadet blue");
332 panel
->SetForegroundColour("blue");
333 wxTextCtrl
*tc
= new wxTextCtrl( panel
, ID_TEXT
, "Write text here.", wxPoint(10,10), wxSize(350,28));
334 (*tc
) << " More text.";
335 tc
->SetBackgroundColour("wheat");
336 tc
= new wxTextCtrl( panel
, ID_TEXT
, "And here.", wxPoint(10,50), wxSize(350,160), wxTE_MULTILINE
);
337 (*tc
) << " More text.";
338 tc
->SetBackgroundColour("wheat");
339 m_notebook
->AddPage(panel
, "wxTextCtrl" , FALSE
, Image_Text
);
341 wxString choices2
[] =
347 panel
= new wxPanel(m_notebook
);
348 panel
->SetBackgroundColour("cadet blue");
349 panel
->SetForegroundColour("blue");
350 m_radio
= new wxRadioBox( panel
, ID_RADIOBOX
, "That", wxPoint(10,160), wxSize(-1,-1), 2, choices2
, 1, wxRA_HORIZONTAL
);
351 m_radio
->SetBackgroundColour("wheat");
352 m_radio
= new wxRadioBox( panel
, ID_RADIOBOX
, "This", wxPoint(10,10), wxSize(-1,-1), 5, choices
, 1, wxRA_VERTICAL
);
353 m_radio
->SetBackgroundColour("wheat");
354 (void)new wxButton( panel
, ID_RADIOBOX_SEL_NUM
, "Select #2", wxPoint(180,30), wxSize(140,30) );
355 (void)new wxButton( panel
, ID_RADIOBOX_SEL_STR
, "Select 'This'", wxPoint(180,80), wxSize(140,30) );
356 (void)new wxButton( panel
, ID_RADIOBOX_FONT
, "Set Italic font", wxPoint(180,130), wxSize(140,30) );
357 (void)new wxCheckBox( panel
, ID_RADIOBOX_ENABLE
, "Disable", wxPoint(340,130), wxSize(140,30) );
358 m_fontButton
= new wxButton( panel
, ID_SET_FONT
, "Set more Italic font", wxPoint(340,30), wxSize(160,30) );
359 m_notebook
->AddPage(panel
, "wxRadioBox", FALSE
, Image_Radio
);
361 panel
= new wxPanel(m_notebook
);
362 panel
->SetBackgroundColour("cadet blue");
363 panel
->SetForegroundColour("blue");
364 (void)new wxStaticBox( panel
, -1, "wxGauge and wxSlider", wxPoint(10,10), wxSize(180,130) );
365 m_gauge
= new wxGauge( panel
, -1, 200, wxPoint(18,50), wxSize(155,-1) );
366 m_gauge
->SetBackgroundColour("wheat");
367 m_slider
= new wxSlider( panel
, ID_SLIDER
, 0, 0, 200, wxPoint(18,90), wxSize(155,-1) );
368 m_slider
->SetBackgroundColour("wheat");
369 (void)new wxStaticBox( panel
, -1, "Explanation", wxPoint(200,10), wxSize(290,130) );
370 (void)new wxStaticText( panel
, -1,
371 "In order see the gauge (aka progress bar)\n"
372 "control do something you have to drag the\n"
373 "handle of the slider to the right.\n"
375 "This is also supposed to demonstrate how\n"
376 "to use static controls.\n",
378 m_spintext
= new wxTextCtrl( panel
, -1, "0", wxPoint(20,160), wxSize(80,-1) );
379 m_spintext
->SetBackgroundColour("wheat");
380 m_spinbutton
= new wxSpinButton( panel
, ID_SPIN
, wxPoint(103,159), wxSize(-1,-1) );
381 m_spinbutton
->SetBackgroundColour("wheat");
382 m_spinbutton
->SetRange(0,100);
384 m_notebook
->AddPage(panel
, "wxGauge", FALSE
, Image_Gauge
);
387 void MyPanel::OnSize( wxSizeEvent
& WXUNUSED(event
) )
391 GetClientSize( &x
, &y
);
393 if (m_notebook
) m_notebook
->SetSize( 2, 2, x
-4, y
*2/3-4 );
394 if (m_text
) m_text
->SetSize( 2, y
*2/3+2, x
-4, y
/3-4 );
397 void MyPanel::OnPageChanged( wxNotebookEvent
&event
)
399 *m_text
<< "Notebook selection is " << event
.GetSelection() << "\n";
402 void MyPanel::OnListBox( wxCommandEvent
&event
)
404 m_text
->WriteText( "ListBox selection string is: " );
405 m_text
->WriteText( event
.GetString() );
406 m_text
->WriteText( "\n" );
409 void MyPanel::OnListBoxButtons( wxCommandEvent
&event
)
411 switch (event
.GetId())
413 case ID_LISTBOX_ENABLE
:
415 m_listbox
->Enable( !((bool)event
.GetInt()) );
418 case ID_LISTBOX_SEL_NUM
:
420 m_listbox
->SetSelection( 2 );
423 case ID_LISTBOX_SEL_STR
:
425 m_listbox
->SetStringSelection( "This" );
428 case ID_LISTBOX_CLEAR
:
433 case ID_LISTBOX_APPEND
:
435 m_listbox
->Append( "Hi!" );
438 case ID_LISTBOX_DELETE
:
440 int idx
= m_listbox
->GetSelection();
441 m_listbox
->Delete( idx
);
444 case ID_LISTBOX_FONT
:
446 m_listbox
->SetFont( *wxITALIC_FONT
);
452 void MyPanel::OnChoice( wxCommandEvent
&event
)
454 m_text
->WriteText( "Choice selection string is: " );
455 m_text
->WriteText( event
.GetString() );
456 m_text
->WriteText( "\n" );
459 void MyPanel::OnChoiceButtons( wxCommandEvent
&event
)
461 switch (event
.GetId())
463 case ID_CHOICE_ENABLE
:
465 m_choice
->Enable( !((bool)event
.GetInt()) );
468 case ID_CHOICE_SEL_NUM
:
470 m_choice
->SetSelection( 2 );
473 case ID_CHOICE_SEL_STR
:
475 m_choice
->SetStringSelection( "This" );
478 case ID_CHOICE_CLEAR
:
483 case ID_CHOICE_APPEND
:
485 m_choice
->Append( "Hi!" );
488 case ID_CHOICE_DELETE
:
490 int idx
= m_choice
->GetSelection();
491 m_choice
->Delete( idx
);
496 m_choice
->SetFont( *wxITALIC_FONT
);
502 void MyPanel::OnCombo( wxCommandEvent
&event
)
504 m_text
->WriteText( "ComboBox selection string is: " );
505 m_text
->WriteText( event
.GetString() );
506 m_text
->WriteText( "\n" );
509 void MyPanel::OnComboButtons( wxCommandEvent
&event
)
511 switch (event
.GetId())
513 case ID_COMBO_ENABLE
:
515 m_combo
->Enable( !((bool)event
.GetInt()) );
518 case ID_COMBO_SEL_NUM
:
520 m_combo
->SetSelection( 2 );
523 case ID_COMBO_SEL_STR
:
525 m_combo
->SetStringSelection( "This" );
533 case ID_COMBO_APPEND
:
535 m_combo
->Append( "Hi!" );
538 case ID_COMBO_DELETE
:
540 int idx
= m_combo
->GetSelection();
541 m_combo
->Delete( idx
);
546 m_combo
->SetFont( *wxITALIC_FONT
);
552 void MyPanel::OnRadio( wxCommandEvent
&event
)
554 m_text
->WriteText( "RadioBox selection string is: " );
555 m_text
->WriteText( event
.GetString() );
556 m_text
->WriteText( "\n" );
559 void MyPanel::OnRadioButtons( wxCommandEvent
&event
)
561 switch (event
.GetId())
563 case ID_RADIOBOX_ENABLE
:
565 m_radio
->Enable( !((bool)event
.GetInt()) );
568 case ID_RADIOBOX_SEL_NUM
:
570 m_radio
->SetSelection( 2 );
573 case ID_RADIOBOX_SEL_STR
:
575 m_radio
->SetStringSelection( "This" );
578 case ID_RADIOBOX_FONT
:
580 m_radio
->SetFont( *wxITALIC_FONT
);
586 void MyPanel::OnSetFont( wxCommandEvent
&WXUNUSED(event
) )
588 m_fontButton
->SetFont( *wxITALIC_FONT
);
589 m_text
->SetFont( *wxITALIC_FONT
);
592 void MyPanel::OnSliderUpdate( wxCommandEvent
&WXUNUSED(event
) )
594 m_gauge
->SetValue( m_slider
->GetValue() );
597 void MyPanel::OnSpinUpdate( wxSpinEvent
&event
)
600 value
.sprintf( "%d", (int)event
.GetPosition() );
601 m_spintext
->SetValue( value
);
606 delete m_notebook
->GetImageList();
609 //----------------------------------------------------------------------
611 //----------------------------------------------------------------------
613 BEGIN_EVENT_TABLE(MyFrame
, wxFrame
)
614 EVT_MENU(MINIMAL_QUIT
, MyFrame::OnQuit
)
615 EVT_MENU(MINIMAL_ABOUT
, MyFrame::OnAbout
)
618 MyFrame::MyFrame(wxFrame
*frame
, char *title
, int x
, int y
, int w
, int h
):
619 wxFrame(frame
, -1, title
, wxPoint(x
, y
), wxSize(w
, h
))
621 (void)new MyPanel( this, 10, 10, 300, 100 );
624 void MyFrame::OnQuit (wxCommandEvent
& WXUNUSED(event
) )
629 void MyFrame::OnAbout( wxCommandEvent
& WXUNUSED(event
) )
631 wxMessageDialog
dialog(this, "This is a control sample", "About Controls", wxOK
);