]>
git.saurik.com Git - wxWidgets.git/blob - samples/controls/controls.cpp
9af561f2fec21b437993cc37cdf3a4b2ea290eaa
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 );
122 // The wxICON() macros loads an icon from a resource under Windows
123 // and uses an #included XPM image under GTK+ and Motif
125 frame
->SetIcon( wxICON(mondrian
) );
127 wxMenu
*file_menu
= new wxMenu
;
129 file_menu
->Append(MINIMAL_ABOUT
, "&About");
130 file_menu
->Append(MINIMAL_QUIT
, "E&xit");
131 wxMenuBar
*menu_bar
= new wxMenuBar
;
132 menu_bar
->Append(file_menu
, "&File");
133 frame
->SetMenuBar(menu_bar
);
142 //----------------------------------------------------------------------
144 //----------------------------------------------------------------------
146 const ID_NOTEBOOK
= 1000;
148 const ID_LISTBOX
= 130;
149 const ID_LISTBOX_SEL_NUM
= 131;
150 const ID_LISTBOX_SEL_STR
= 132;
151 const ID_LISTBOX_CLEAR
= 133;
152 const ID_LISTBOX_APPEND
= 134;
153 const ID_LISTBOX_DELETE
= 135;
154 const ID_LISTBOX_FONT
= 136;
155 const ID_LISTBOX_ENABLE
= 137;
157 const ID_CHOICE
= 120;
158 const ID_CHOICE_SEL_NUM
= 121;
159 const ID_CHOICE_SEL_STR
= 122;
160 const ID_CHOICE_CLEAR
= 123;
161 const ID_CHOICE_APPEND
= 124;
162 const ID_CHOICE_DELETE
= 125;
163 const ID_CHOICE_FONT
= 126;
164 const ID_CHOICE_ENABLE
= 127;
166 const ID_COMBO
= 140;
167 const ID_COMBO_SEL_NUM
= 141;
168 const ID_COMBO_SEL_STR
= 142;
169 const ID_COMBO_CLEAR
= 143;
170 const ID_COMBO_APPEND
= 144;
171 const ID_COMBO_DELETE
= 145;
172 const ID_COMBO_FONT
= 146;
173 const ID_COMBO_ENABLE
= 147;
177 const ID_RADIOBOX
= 160;
178 const ID_RADIOBOX_SEL_NUM
= 161;
179 const ID_RADIOBOX_SEL_STR
= 162;
180 const ID_RADIOBOX_FONT
= 163;
181 const ID_RADIOBOX_ENABLE
= 164;
183 const ID_SET_FONT
= 170;
185 const ID_GAUGE
= 180;
186 const ID_SLIDER
= 181;
191 BEGIN_EVENT_TABLE(MyPanel
, wxPanel
)
192 EVT_SIZE ( MyPanel::OnSize
)
193 EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK
, MyPanel::OnPageChanged
)
194 EVT_LISTBOX (ID_LISTBOX
, MyPanel::OnListBox
)
195 EVT_BUTTON (ID_LISTBOX_SEL_NUM
, MyPanel::OnListBoxButtons
)
196 EVT_BUTTON (ID_LISTBOX_SEL_STR
, MyPanel::OnListBoxButtons
)
197 EVT_BUTTON (ID_LISTBOX_CLEAR
, MyPanel::OnListBoxButtons
)
198 EVT_BUTTON (ID_LISTBOX_APPEND
, MyPanel::OnListBoxButtons
)
199 EVT_BUTTON (ID_LISTBOX_DELETE
, MyPanel::OnListBoxButtons
)
200 EVT_BUTTON (ID_LISTBOX_FONT
, MyPanel::OnListBoxButtons
)
201 EVT_CHECKBOX (ID_LISTBOX_ENABLE
, MyPanel::OnListBoxButtons
)
202 EVT_CHOICE (ID_CHOICE
, MyPanel::OnChoice
)
203 EVT_BUTTON (ID_CHOICE_SEL_NUM
, MyPanel::OnChoiceButtons
)
204 EVT_BUTTON (ID_CHOICE_SEL_STR
, MyPanel::OnChoiceButtons
)
205 EVT_BUTTON (ID_CHOICE_CLEAR
, MyPanel::OnChoiceButtons
)
206 EVT_BUTTON (ID_CHOICE_APPEND
, MyPanel::OnChoiceButtons
)
207 EVT_BUTTON (ID_CHOICE_DELETE
, MyPanel::OnChoiceButtons
)
208 EVT_BUTTON (ID_CHOICE_FONT
, MyPanel::OnChoiceButtons
)
209 EVT_CHECKBOX (ID_CHOICE_ENABLE
, MyPanel::OnChoiceButtons
)
210 EVT_CHOICE (ID_COMBO
, MyPanel::OnCombo
)
211 EVT_BUTTON (ID_COMBO_SEL_NUM
, MyPanel::OnComboButtons
)
212 EVT_BUTTON (ID_COMBO_SEL_STR
, MyPanel::OnComboButtons
)
213 EVT_BUTTON (ID_COMBO_CLEAR
, MyPanel::OnComboButtons
)
214 EVT_BUTTON (ID_COMBO_APPEND
, MyPanel::OnComboButtons
)
215 EVT_BUTTON (ID_COMBO_DELETE
, MyPanel::OnComboButtons
)
216 EVT_BUTTON (ID_COMBO_FONT
, MyPanel::OnComboButtons
)
217 EVT_CHECKBOX (ID_COMBO_ENABLE
, MyPanel::OnComboButtons
)
218 EVT_RADIOBOX (ID_RADIOBOX
, MyPanel::OnRadio
)
219 EVT_BUTTON (ID_RADIOBOX_SEL_NUM
, MyPanel::OnRadioButtons
)
220 EVT_BUTTON (ID_RADIOBOX_SEL_STR
, MyPanel::OnRadioButtons
)
221 EVT_BUTTON (ID_RADIOBOX_FONT
, MyPanel::OnRadioButtons
)
222 EVT_CHECKBOX (ID_RADIOBOX_ENABLE
, MyPanel::OnRadioButtons
)
223 EVT_BUTTON (ID_SET_FONT
, MyPanel::OnSetFont
)
224 EVT_SLIDER (ID_SLIDER
, MyPanel::OnSliderUpdate
)
225 EVT_SPIN (ID_SPIN
, MyPanel::OnSpinUpdate
)
228 MyPanel::MyPanel( wxFrame
*frame
, int x
, int y
, int w
, int h
) :
229 wxPanel( frame
, -1, wxPoint(x
, y
), wxSize(w
, h
) )
231 SetBackgroundColour("cadet blue");
233 m_text
= new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE
);
234 m_text
->SetBackgroundColour("wheat");
236 m_notebook
= new wxNotebook( this, ID_NOTEBOOK
, wxPoint(0,0), wxSize(200,150) );
247 // image ids and names
250 Image_List
, Image_Choice
, Image_Combo
, Image_Text
, Image_Radio
, Image_Gauge
, Image_Max
253 // fill the image list
255 const char *aIconNames
[] =
257 "list.xpm", "choice.xpm", "combo.xpm", "text.xpm", "radio.xpm", "gauge.txt"
260 wxASSERT( WXSIZEOF(aIconNames
) == Image_Max
); // keep in sync
262 wxString strIconDir
= "icons/";
264 wxImageList
*imagelist
= new wxImageList(32, 32);
265 for ( size_t n
= 0; n
< Image_Max
; n
++ )
267 imagelist
->Add(wxBitmap(strIconDir
+ aIconNames
[n
]));
270 wxImageList
*imagelist
= new wxImageList(32, 32);
272 imagelist
-> Add( wxBitmap( (const char**) list_xpm
));
273 imagelist
-> Add( wxBitmap( (const char**) choice_xpm
));
274 imagelist
-> Add( wxBitmap( (const char**) combo_xpm
));
275 imagelist
-> Add( wxBitmap( (const char**) text_xpm
));
276 imagelist
-> Add( wxBitmap( (const char**) radio_xpm
));
277 imagelist
-> Add( wxBitmap( (const char**) gauge_xpm
));
280 wxButton
*button
= (wxButton
*)NULL
;
282 m_notebook
->SetImageList(imagelist
);
283 m_notebook
->SetBackgroundColour("cadet blue");
285 wxPanel
*panel
= (wxPanel
*) NULL
;
286 panel
= new wxPanel(m_notebook
);
287 panel
->SetBackgroundColour("cadet blue");
288 panel
->SetForegroundColour("blue");
289 m_listbox
= new wxListBox( panel
, ID_LISTBOX
, wxPoint(10,10), wxSize(120,70), 5, choices
);
290 m_listbox
->SetBackgroundColour("wheat");
291 (void)new wxButton( panel
, ID_LISTBOX_SEL_NUM
, "Select #2", wxPoint(180,30), wxSize(140,30) );
292 (void)new wxButton( panel
, ID_LISTBOX_SEL_STR
, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
293 (void)new wxButton( panel
, ID_LISTBOX_CLEAR
, "Clear", wxPoint(180,80), wxSize(140,30) );
294 (void)new wxButton( panel
, ID_LISTBOX_APPEND
, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
295 (void)new wxButton( panel
, ID_LISTBOX_DELETE
, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
296 button
= new wxButton( panel
, ID_LISTBOX_FONT
, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
297 button
->SetForegroundColour( "red" );
298 (void)new wxCheckBox( panel
, ID_LISTBOX_ENABLE
, "Disable", wxPoint(20,130), wxSize(140,30) );
299 m_notebook
->AddPage(panel
, "wxList", FALSE
, Image_List
);
301 panel
= new wxPanel(m_notebook
);
302 panel
->SetBackgroundColour("cadet blue");
303 panel
->SetForegroundColour("blue");
304 m_choice
= new wxChoice( panel
, ID_CHOICE
, wxPoint(10,10), wxSize(120,-1), 5, choices
);
305 m_choice
->SetBackgroundColour("wheat");
306 (void)new wxButton( panel
, ID_CHOICE_SEL_NUM
, "Select #2", wxPoint(180,30), wxSize(140,30) );
307 (void)new wxButton( panel
, ID_CHOICE_SEL_STR
, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
308 (void)new wxButton( panel
, ID_CHOICE_CLEAR
, "Clear", wxPoint(180,80), wxSize(140,30) );
309 (void)new wxButton( panel
, ID_CHOICE_APPEND
, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
310 (void)new wxButton( panel
, ID_CHOICE_DELETE
, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
311 (void)new wxButton( panel
, ID_CHOICE_FONT
, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
312 (void)new wxCheckBox( panel
, ID_CHOICE_ENABLE
, "Disable", wxPoint(20,130), wxSize(140,30) );
313 m_notebook
->AddPage(panel
, "wxChoice", FALSE
, Image_Choice
);
315 panel
= new wxPanel(m_notebook
);
316 panel
->SetBackgroundColour("cadet blue");
317 panel
->SetForegroundColour("blue");
318 m_combo
= new wxComboBox( panel
, ID_COMBO
, "This", wxPoint(10,10), wxSize(120,-1), 5, choices
);
319 m_combo
->SetBackgroundColour("wheat");
320 (void)new wxButton( panel
, ID_COMBO_SEL_NUM
, "Select #2", wxPoint(180,30), wxSize(140,30) );
321 (void)new wxButton( panel
, ID_COMBO_SEL_STR
, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
322 (void)new wxButton( panel
, ID_COMBO_CLEAR
, "Clear", wxPoint(180,80), wxSize(140,30) );
323 (void)new wxButton( panel
, ID_COMBO_APPEND
, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
324 (void)new wxButton( panel
, ID_COMBO_DELETE
, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
325 (void)new wxButton( panel
, ID_COMBO_FONT
, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
326 (void)new wxCheckBox( panel
, ID_COMBO_ENABLE
, "Disable", wxPoint(20,130), wxSize(140,30) );
327 m_notebook
->AddPage(panel
, "wxComboBox", FALSE
, Image_Combo
);
329 panel
= new wxPanel(m_notebook
);
330 panel
->SetBackgroundColour("cadet blue");
331 panel
->SetForegroundColour("blue");
332 wxTextCtrl
*tc
= new wxTextCtrl( panel
, ID_TEXT
, "Write text here.", wxPoint(10,10), wxSize(350,28));
333 (*tc
) << " More text.";
334 tc
->SetBackgroundColour("wheat");
335 tc
= new wxTextCtrl( panel
, ID_TEXT
, "And here.", wxPoint(10,50), wxSize(350,160), wxTE_MULTILINE
);
336 (*tc
) << " More text.";
337 tc
->SetBackgroundColour("wheat");
338 m_notebook
->AddPage(panel
, "wxTextCtrl" , FALSE
, Image_Text
);
340 wxString choices2
[] =
346 panel
= new wxPanel(m_notebook
);
347 panel
->SetBackgroundColour("cadet blue");
348 panel
->SetForegroundColour("blue");
349 m_radio
= new wxRadioBox( panel
, ID_RADIOBOX
, "That", wxPoint(10,160), wxSize(-1,-1), 2, choices2
, 1, wxRA_HORIZONTAL
);
350 m_radio
->SetBackgroundColour("wheat");
351 m_radio
= new wxRadioBox( panel
, ID_RADIOBOX
, "This", wxPoint(10,10), wxSize(-1,-1), 5, choices
, 1, wxRA_VERTICAL
);
352 m_radio
->SetBackgroundColour("wheat");
353 (void)new wxButton( panel
, ID_RADIOBOX_SEL_NUM
, "Select #2", wxPoint(180,30), wxSize(140,30) );
354 (void)new wxButton( panel
, ID_RADIOBOX_SEL_STR
, "Select 'This'", wxPoint(180,80), wxSize(140,30) );
355 (void)new wxButton( panel
, ID_RADIOBOX_FONT
, "Set Italic font", wxPoint(180,130), wxSize(140,30) );
356 (void)new wxCheckBox( panel
, ID_RADIOBOX_ENABLE
, "Disable", wxPoint(340,130), wxSize(140,30) );
357 m_fontButton
= new wxButton( panel
, ID_SET_FONT
, "Set more Italic font", wxPoint(340,30), wxSize(160,30) );
358 m_notebook
->AddPage(panel
, "wxRadioBox", FALSE
, Image_Radio
);
360 panel
= new wxPanel(m_notebook
);
361 panel
->SetBackgroundColour("cadet blue");
362 panel
->SetForegroundColour("blue");
363 (void)new wxStaticBox( panel
, -1, "wxGauge and wxSlider", wxPoint(10,10), wxSize(180,130) );
364 m_gauge
= new wxGauge( panel
, -1, 200, wxPoint(18,50), wxSize(155,-1) );
365 m_gauge
->SetBackgroundColour("wheat");
366 m_slider
= new wxSlider( panel
, ID_SLIDER
, 0, 0, 200, wxPoint(18,90), wxSize(155,-1) );
367 m_slider
->SetBackgroundColour("wheat");
368 (void)new wxStaticBox( panel
, -1, "Explanation", wxPoint(200,10), wxSize(290,130) );
369 (void)new wxStaticText( panel
, -1,
370 "In order see the gauge (aka progress bar)\n"
371 "control do something you have to drag the\n"
372 "handle of the slider to the right.\n"
374 "This is also supposed to demonstrate how\n"
375 "to use static controls.\n",
377 m_spintext
= new wxTextCtrl( panel
, -1, "0", wxPoint(20,160), wxSize(80,-1) );
378 m_spintext
->SetBackgroundColour("wheat");
379 m_spinbutton
= new wxSpinButton( panel
, ID_SPIN
, wxPoint(103,159), wxSize(-1,-1) );
380 m_spinbutton
->SetBackgroundColour("wheat");
381 m_spinbutton
->SetRange(0,100);
383 m_notebook
->AddPage(panel
, "wxGauge", FALSE
, Image_Gauge
);
386 void MyPanel::OnSize( wxSizeEvent
& WXUNUSED(event
) )
390 GetClientSize( &x
, &y
);
392 if (m_notebook
) m_notebook
->SetSize( 2, 2, x
-4, y
*2/3-4 );
393 if (m_text
) m_text
->SetSize( 2, y
*2/3+2, x
-4, y
/3-4 );
396 void MyPanel::OnPageChanged( wxNotebookEvent
&event
)
398 *m_text
<< "Notebook selection is " << event
.GetSelection() << "\n";
401 void MyPanel::OnListBox( wxCommandEvent
&event
)
403 m_text
->WriteText( "ListBox selection string is: " );
404 m_text
->WriteText( event
.GetString() );
405 m_text
->WriteText( "\n" );
408 void MyPanel::OnListBoxButtons( wxCommandEvent
&event
)
410 switch (event
.GetId())
412 case ID_LISTBOX_ENABLE
:
414 m_listbox
->Enable( !((bool)event
.GetInt()) );
417 case ID_LISTBOX_SEL_NUM
:
419 m_listbox
->SetSelection( 2 );
422 case ID_LISTBOX_SEL_STR
:
424 m_listbox
->SetStringSelection( "This" );
427 case ID_LISTBOX_CLEAR
:
432 case ID_LISTBOX_APPEND
:
434 m_listbox
->Append( "Hi!" );
437 case ID_LISTBOX_DELETE
:
439 int idx
= m_listbox
->GetSelection();
440 m_listbox
->Delete( idx
);
443 case ID_LISTBOX_FONT
:
445 m_listbox
->SetFont( *wxITALIC_FONT
);
451 void MyPanel::OnChoice( wxCommandEvent
&event
)
453 m_text
->WriteText( "Choice selection string is: " );
454 m_text
->WriteText( event
.GetString() );
455 m_text
->WriteText( "\n" );
458 void MyPanel::OnChoiceButtons( wxCommandEvent
&event
)
460 switch (event
.GetId())
462 case ID_CHOICE_ENABLE
:
464 m_choice
->Enable( !((bool)event
.GetInt()) );
467 case ID_CHOICE_SEL_NUM
:
469 m_choice
->SetSelection( 2 );
472 case ID_CHOICE_SEL_STR
:
474 m_choice
->SetStringSelection( "This" );
477 case ID_CHOICE_CLEAR
:
482 case ID_CHOICE_APPEND
:
484 m_choice
->Append( "Hi!" );
487 case ID_CHOICE_DELETE
:
489 int idx
= m_choice
->GetSelection();
490 m_choice
->Delete( idx
);
495 m_choice
->SetFont( *wxITALIC_FONT
);
501 void MyPanel::OnCombo( wxCommandEvent
&event
)
503 m_text
->WriteText( "ComboBox selection string is: " );
504 m_text
->WriteText( event
.GetString() );
505 m_text
->WriteText( "\n" );
508 void MyPanel::OnComboButtons( wxCommandEvent
&event
)
510 switch (event
.GetId())
512 case ID_COMBO_ENABLE
:
514 m_combo
->Enable( !((bool)event
.GetInt()) );
517 case ID_COMBO_SEL_NUM
:
519 m_combo
->SetSelection( 2 );
522 case ID_COMBO_SEL_STR
:
524 m_combo
->SetStringSelection( "This" );
532 case ID_COMBO_APPEND
:
534 m_combo
->Append( "Hi!" );
537 case ID_COMBO_DELETE
:
539 int idx
= m_combo
->GetSelection();
540 m_combo
->Delete( idx
);
545 m_combo
->SetFont( *wxITALIC_FONT
);
551 void MyPanel::OnRadio( wxCommandEvent
&event
)
553 m_text
->WriteText( "RadioBox selection string is: " );
554 m_text
->WriteText( event
.GetString() );
555 m_text
->WriteText( "\n" );
558 void MyPanel::OnRadioButtons( wxCommandEvent
&event
)
560 switch (event
.GetId())
562 case ID_RADIOBOX_ENABLE
:
564 m_radio
->Enable( !((bool)event
.GetInt()) );
567 case ID_RADIOBOX_SEL_NUM
:
569 m_radio
->SetSelection( 2 );
572 case ID_RADIOBOX_SEL_STR
:
574 m_radio
->SetStringSelection( "This" );
577 case ID_RADIOBOX_FONT
:
579 m_radio
->SetFont( *wxITALIC_FONT
);
585 void MyPanel::OnSetFont( wxCommandEvent
&WXUNUSED(event
) )
587 m_fontButton
->SetFont( *wxITALIC_FONT
);
588 m_text
->SetFont( *wxITALIC_FONT
);
591 void MyPanel::OnSliderUpdate( wxCommandEvent
&WXUNUSED(event
) )
593 m_gauge
->SetValue( m_slider
->GetValue() );
596 void MyPanel::OnSpinUpdate( wxSpinEvent
&event
)
599 value
.sprintf( "%d", (int)event
.GetPosition() );
600 m_spintext
->SetValue( value
);
605 delete m_notebook
->GetImageList();
608 //----------------------------------------------------------------------
610 //----------------------------------------------------------------------
612 BEGIN_EVENT_TABLE(MyFrame
, wxFrame
)
613 EVT_MENU(MINIMAL_QUIT
, MyFrame::OnQuit
)
614 EVT_MENU(MINIMAL_ABOUT
, MyFrame::OnAbout
)
617 MyFrame::MyFrame(wxFrame
*frame
, char *title
, int x
, int y
, int w
, int h
):
618 wxFrame(frame
, -1, title
, wxPoint(x
, y
), wxSize(w
, h
))
620 (void)new MyPanel( this, 10, 10, 300, 100 );
623 void MyFrame::OnQuit (wxCommandEvent
& WXUNUSED(event
) )
628 void MyFrame::OnAbout( wxCommandEvent
& WXUNUSED(event
) )
630 wxMessageDialog
dialog(this, "This is a control sample", "About Controls", wxOK
);