]> git.saurik.com Git - wxWidgets.git/blob - samples/controls/controls.cpp
ab5a9e577043ffc7e043ff1d4227b3797a3a51eb
[wxWidgets.git] / samples / controls / controls.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: controls.cpp
3 // Purpose: Controls wxWindows sample
4 // Author: Robert Roebling
5 // Modified by:
6 // RCS-ID: $Id$
7 // Copyright: (c) Robert Roebling, Julian Smart
8 // Licence: wxWindows license
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifdef __GNUG__
12 #pragma implementation "controls.h"
13 #endif
14
15 // For compilers that support precompilation, includes "wx/wx.h".
16 #include "wx/wxprec.h"
17
18 #ifdef __BORLANDC__
19 #pragma hdrstop
20 #endif
21
22 #ifndef WX_PRECOMP
23 #include "wx/wx.h"
24 #endif
25
26 #include "wx/notebook.h"
27 #include "wx/imaglist.h"
28
29 #if defined(__WXGTK__) || defined(__WXMOTIF__)
30 #include "mondrian.xpm"
31 #include "icons/choice.xpm"
32 #include "icons/combo.xpm"
33 #include "icons/list.xpm"
34 #include "icons/radio.xpm"
35 #include "icons/text.xpm"
36 #include "icons/stattext.xpm"
37 #endif
38
39 //----------------------------------------------------------------------
40 // class definitions
41 //----------------------------------------------------------------------
42
43 class MyApp: public wxApp
44 {
45 public:
46 bool OnInit(void);
47 };
48
49 class MyPanel: public wxPanel
50 {
51 public:
52
53 MyPanel(wxFrame *frame, int x, int y, int w, int h);
54 virtual ~MyPanel();
55
56 void OnSize( wxSizeEvent& event );
57 void OnListBox( wxCommandEvent &event );
58 void OnListBoxButtons( wxCommandEvent &event );
59 void OnChoice( wxCommandEvent &event );
60 void OnChoiceButtons( wxCommandEvent &event );
61 void OnCombo( wxCommandEvent &event );
62 void OnComboButtons( wxCommandEvent &event );
63 void OnRadio( wxCommandEvent &event );
64 void OnRadioButtons( wxCommandEvent &event );
65 void OnSetFont( wxCommandEvent &event );
66 void OnPageChanged( wxNotebookEvent &event );
67
68 wxListBox *m_listbox;
69 wxChoice *m_choice;
70 wxComboBox *m_combo;
71 wxRadioBox *m_radio;
72 wxButton *m_fontButton;
73
74 wxTextCtrl *m_text;
75 wxNotebook *m_notebook;
76
77 DECLARE_EVENT_TABLE()
78 };
79
80 class MyFrame: public wxFrame
81 {
82 public:
83
84 MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h);
85
86 public:
87
88 void OnQuit(wxCommandEvent& event);
89 void OnAbout(wxCommandEvent& event);
90 bool OnClose(void) { return TRUE; }
91
92 DECLARE_EVENT_TABLE()
93 };
94
95 //----------------------------------------------------------------------
96 // main()
97 //----------------------------------------------------------------------
98
99 IMPLEMENT_APP (MyApp)
100
101 //----------------------------------------------------------------------
102 // MyApp
103 //----------------------------------------------------------------------
104
105 const int MINIMAL_QUIT = 100;
106 const int MINIMAL_TEXT = 101;
107 const int MINIMAL_ABOUT = 102;
108
109 bool MyApp::OnInit(void)
110 {
111 // Create the main frame window
112 MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "Controls wxWindows App", 50, 50, 530, 420 );
113
114 // Give it an icon
115 #ifdef __WXMSW__
116 frame->SetIcon(wxIcon("mondrian"));
117 #else
118 frame->SetIcon(wxIcon( mondrian_xpm ));
119 #endif
120
121 wxMenu *file_menu = new wxMenu;
122
123 file_menu->Append(MINIMAL_ABOUT, "&About");
124 file_menu->Append(MINIMAL_QUIT, "E&xit");
125 wxMenuBar *menu_bar = new wxMenuBar;
126 menu_bar->Append(file_menu, "&File");
127 frame->SetMenuBar(menu_bar);
128
129 frame->Show(TRUE);
130
131 SetTopWindow(frame);
132
133 return TRUE;
134 }
135
136 //----------------------------------------------------------------------
137 // MyPanel
138 //----------------------------------------------------------------------
139
140 const ID_NOTEBOOK = 1000;
141
142 const ID_LISTBOX = 130;
143 const ID_LISTBOX_SEL_NUM = 131;
144 const ID_LISTBOX_SEL_STR = 132;
145 const ID_LISTBOX_CLEAR = 133;
146 const ID_LISTBOX_APPEND = 134;
147 const ID_LISTBOX_DELETE = 135;
148 const ID_LISTBOX_FONT = 136;
149 const ID_LISTBOX_ENABLE = 137;
150
151 const ID_CHOICE = 120;
152 const ID_CHOICE_SEL_NUM = 121;
153 const ID_CHOICE_SEL_STR = 122;
154 const ID_CHOICE_CLEAR = 123;
155 const ID_CHOICE_APPEND = 124;
156 const ID_CHOICE_DELETE = 125;
157 const ID_CHOICE_FONT = 126;
158 const ID_CHOICE_ENABLE = 127;
159
160 const ID_COMBO = 140;
161 const ID_COMBO_SEL_NUM = 141;
162 const ID_COMBO_SEL_STR = 142;
163 const ID_COMBO_CLEAR = 143;
164 const ID_COMBO_APPEND = 144;
165 const ID_COMBO_DELETE = 145;
166 const ID_COMBO_FONT = 146;
167 const ID_COMBO_ENABLE = 147;
168
169 const ID_TEXT = 150;
170
171 const ID_RADIOBOX = 160;
172 const ID_RADIOBOX_SEL_NUM = 161;
173 const ID_RADIOBOX_SEL_STR = 162;
174 const ID_RADIOBOX_FONT = 163;
175 const ID_RADIOBOX_ENABLE = 164;
176
177 const ID_SET_FONT = 170;
178
179 BEGIN_EVENT_TABLE(MyPanel, wxPanel)
180 EVT_SIZE ( MyPanel::OnSize)
181 EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK, MyPanel::OnPageChanged)
182 EVT_LISTBOX (ID_LISTBOX, MyPanel::OnListBox)
183 EVT_BUTTON (ID_LISTBOX_SEL_NUM, MyPanel::OnListBoxButtons)
184 EVT_BUTTON (ID_LISTBOX_SEL_STR, MyPanel::OnListBoxButtons)
185 EVT_BUTTON (ID_LISTBOX_CLEAR, MyPanel::OnListBoxButtons)
186 EVT_BUTTON (ID_LISTBOX_APPEND, MyPanel::OnListBoxButtons)
187 EVT_BUTTON (ID_LISTBOX_DELETE, MyPanel::OnListBoxButtons)
188 EVT_BUTTON (ID_LISTBOX_FONT, MyPanel::OnListBoxButtons)
189 EVT_CHECKBOX (ID_LISTBOX_ENABLE, MyPanel::OnListBoxButtons)
190 EVT_CHOICE (ID_CHOICE, MyPanel::OnChoice)
191 EVT_BUTTON (ID_CHOICE_SEL_NUM, MyPanel::OnChoiceButtons)
192 EVT_BUTTON (ID_CHOICE_SEL_STR, MyPanel::OnChoiceButtons)
193 EVT_BUTTON (ID_CHOICE_CLEAR, MyPanel::OnChoiceButtons)
194 EVT_BUTTON (ID_CHOICE_APPEND, MyPanel::OnChoiceButtons)
195 EVT_BUTTON (ID_CHOICE_DELETE, MyPanel::OnChoiceButtons)
196 EVT_BUTTON (ID_CHOICE_FONT, MyPanel::OnChoiceButtons)
197 EVT_CHECKBOX (ID_CHOICE_ENABLE, MyPanel::OnChoiceButtons)
198 EVT_CHOICE (ID_COMBO, MyPanel::OnCombo)
199 EVT_BUTTON (ID_COMBO_SEL_NUM, MyPanel::OnComboButtons)
200 EVT_BUTTON (ID_COMBO_SEL_STR, MyPanel::OnComboButtons)
201 EVT_BUTTON (ID_COMBO_CLEAR, MyPanel::OnComboButtons)
202 EVT_BUTTON (ID_COMBO_APPEND, MyPanel::OnComboButtons)
203 EVT_BUTTON (ID_COMBO_DELETE, MyPanel::OnComboButtons)
204 EVT_BUTTON (ID_COMBO_FONT, MyPanel::OnComboButtons)
205 EVT_CHECKBOX (ID_COMBO_ENABLE, MyPanel::OnComboButtons)
206 EVT_RADIOBOX (ID_RADIOBOX, MyPanel::OnRadio)
207 EVT_BUTTON (ID_RADIOBOX_SEL_NUM, MyPanel::OnRadioButtons)
208 EVT_BUTTON (ID_RADIOBOX_SEL_STR, MyPanel::OnRadioButtons)
209 EVT_BUTTON (ID_RADIOBOX_FONT, MyPanel::OnRadioButtons)
210 EVT_CHECKBOX (ID_RADIOBOX_ENABLE, MyPanel::OnRadioButtons)
211 EVT_BUTTON (ID_SET_FONT, MyPanel::OnSetFont)
212 END_EVENT_TABLE()
213
214 MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
215 wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) )
216 {
217 SetBackgroundColour("cadet blue");
218
219 m_text = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE );
220 m_text->SetBackgroundColour("wheat");
221
222 m_notebook = new wxNotebook( this, ID_NOTEBOOK, wxPoint(0,0), wxSize(200,150) );
223
224 wxString choices[] =
225 {
226 "This",
227 "is one of my",
228 "really",
229 "wonderful",
230 "examples.",
231 };
232
233 // image ids and names
234 enum
235 {
236 Image_List, Image_Choice, Image_Combo, Image_Text, Image_Radio, Image_Static, Image_Max
237 };
238
239 // fill the image list
240 #ifdef __WXMSW__
241 const char *aIconNames[] =
242 {
243 "list.xpm", "choice.xpm", "combo.xpm", "text.xpm", "radio.xpm", "stattext.xpm"
244 };
245
246 wxASSERT( WXSIZEOF(aIconNames) == Image_Max ); // keep in sync
247
248 wxString strIconDir = "icons/";
249
250 wxImageList *imagelist = new wxImageList(32, 32);
251 for ( size_t n = 0; n < Image_Max; n++ )
252 {
253 imagelist->Add(wxBitmap(strIconDir + aIconNames[n]));
254 }
255 #else
256 wxImageList *imagelist = new wxImageList(32, 32);
257
258 imagelist-> Add( wxBitmap( list_xpm ));
259 imagelist-> Add( wxBitmap( choice_xpm ));
260 imagelist-> Add( wxBitmap( combo_xpm ));
261 imagelist-> Add( wxBitmap( text_xpm ));
262 imagelist-> Add( wxBitmap( radio_xpm ));
263 imagelist-> Add( wxBitmap( stattext_xpm ));
264 #endif
265
266 wxButton *button = (wxButton*)NULL;
267
268 m_notebook->SetImageList(imagelist);
269 m_notebook->SetBackgroundColour("cadet blue");
270
271 wxPanel *panel = new wxPanel(m_notebook);
272 panel->SetBackgroundColour("cadet blue");
273 m_listbox = new wxListBox( panel, ID_LISTBOX, wxPoint(10,10), wxSize(120,70), 5, choices );
274 m_listbox->SetBackgroundColour("wheat");
275 (void)new wxButton( panel, ID_LISTBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
276 (void)new wxButton( panel, ID_LISTBOX_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
277 (void)new wxButton( panel, ID_LISTBOX_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
278 (void)new wxButton( panel, ID_LISTBOX_APPEND, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
279 (void)new wxButton( panel, ID_LISTBOX_DELETE, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
280 button = new wxButton( panel, ID_LISTBOX_FONT, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
281 button->SetForegroundColour( "red" );
282 (void)new wxCheckBox( panel, ID_LISTBOX_ENABLE, "Disable", wxPoint(20,130), wxSize(140,30) );
283 m_notebook->AddPage(panel, "wxList", FALSE, Image_List);
284
285 panel = new wxPanel(m_notebook);
286 panel->SetBackgroundColour("cadet blue");
287 m_choice = new wxChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,-1), 5, choices );
288 m_choice->SetBackgroundColour("wheat");
289 (void)new wxButton( panel, ID_CHOICE_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
290 (void)new wxButton( panel, ID_CHOICE_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
291 (void)new wxButton( panel, ID_CHOICE_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
292 (void)new wxButton( panel, ID_CHOICE_APPEND, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
293 (void)new wxButton( panel, ID_CHOICE_DELETE, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
294 (void)new wxButton( panel, ID_CHOICE_FONT, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
295 (void)new wxCheckBox( panel, ID_CHOICE_ENABLE, "Disable", wxPoint(20,130), wxSize(140,30) );
296 m_notebook->AddPage(panel, "wxChoice", FALSE, Image_Choice);
297
298 panel = new wxPanel(m_notebook);
299 panel->SetBackgroundColour("cadet blue");
300 m_combo = new wxComboBox( panel, ID_COMBO, "This", wxPoint(10,10), wxSize(120,-1), 5, choices );
301 m_combo->SetBackgroundColour("wheat");
302 (void)new wxButton( panel, ID_COMBO_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
303 (void)new wxButton( panel, ID_COMBO_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
304 (void)new wxButton( panel, ID_COMBO_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
305 (void)new wxButton( panel, ID_COMBO_APPEND, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
306 (void)new wxButton( panel, ID_COMBO_DELETE, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
307 (void)new wxButton( panel, ID_COMBO_FONT, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
308 (void)new wxCheckBox( panel, ID_COMBO_ENABLE, "Disable", wxPoint(20,130), wxSize(140,30) );
309 m_notebook->AddPage(panel, "wxComboBox", FALSE, Image_Combo);
310
311 panel = new wxPanel(m_notebook);
312 panel->SetBackgroundColour("cadet blue");
313 wxTextCtrl *tc = new wxTextCtrl( panel, ID_TEXT, "Write text here.", wxPoint(10,10), wxSize(350,28));
314 tc->SetBackgroundColour("wheat");
315 tc = new wxTextCtrl( panel, ID_TEXT, "And here.", wxPoint(10,50), wxSize(350,160), wxTE_MULTILINE );
316 tc->SetBackgroundColour("wheat");
317 m_notebook->AddPage(panel, "wxTextCtrl" , FALSE, Image_Text);
318
319 wxString choices2[] =
320 {
321 "Wonderful",
322 "examples.",
323 };
324
325 panel = new wxPanel(m_notebook);
326 panel->SetBackgroundColour("cadet blue");
327 m_radio = new wxRadioBox( panel, ID_RADIOBOX, "That", wxPoint(10,160), wxSize(-1,-1), 2, choices2, 1, wxRA_HORIZONTAL );
328 m_radio->SetBackgroundColour("wheat");
329 m_radio = new wxRadioBox( panel, ID_RADIOBOX, "This", wxPoint(10,10), wxSize(-1,-1), 5, choices, 1, wxRA_VERTICAL );
330 m_radio->SetBackgroundColour("wheat");
331 (void)new wxButton( panel, ID_RADIOBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
332 (void)new wxButton( panel, ID_RADIOBOX_SEL_STR, "Select 'This'", wxPoint(180,80), wxSize(140,30) );
333 (void)new wxButton( panel, ID_RADIOBOX_FONT, "Set Italic font", wxPoint(180,130), wxSize(140,30) );
334 (void)new wxCheckBox( panel, ID_RADIOBOX_ENABLE, "Disable", wxPoint(340,130), wxSize(140,30) );
335 m_fontButton = new wxButton( panel, ID_SET_FONT, "Set more Italic font", wxPoint(340,30), wxSize(160,30) );
336 m_notebook->AddPage(panel, "wxRadioBox", FALSE, Image_Radio);
337
338 panel = new wxPanel(m_notebook);
339 panel->SetBackgroundColour("cadet blue");
340 (void)new wxStaticBox( panel, -1, "StaticBox", wxPoint(10,10), wxSize(160,130) );
341 m_notebook->AddPage(panel, "wxStaticBox", FALSE, Image_Static);
342 }
343
344 void MyPanel::OnSize( wxSizeEvent& WXUNUSED(event) )
345 {
346 int x = 0;
347 int y = 0;
348 GetClientSize( &x, &y );
349
350 if (m_notebook) m_notebook->SetSize( 2, 2, x-4, y*2/3-4 );
351 if (m_text) m_text->SetSize( 2, y*2/3+2, x-4, y/3-4 );
352 }
353
354 void MyPanel::OnPageChanged( wxNotebookEvent &event )
355 {
356 *m_text << "Notebook selection is " << event.GetSelection() << "\n";
357 }
358
359 void MyPanel::OnListBox( wxCommandEvent &event )
360 {
361 m_text->WriteText( "ListBox selection string is: " );
362 m_text->WriteText( event.GetString() );
363 m_text->WriteText( "\n" );
364 }
365
366 void MyPanel::OnListBoxButtons( wxCommandEvent &event )
367 {
368 switch (event.GetId())
369 {
370 case ID_LISTBOX_ENABLE:
371 {
372 m_listbox->Enable( !((bool)event.GetInt()) );
373 break;
374 }
375 case ID_LISTBOX_SEL_NUM:
376 {
377 m_listbox->SetSelection( 2 );
378 break;
379 }
380 case ID_LISTBOX_SEL_STR:
381 {
382 m_listbox->SetStringSelection( "This" );
383 break;
384 }
385 case ID_LISTBOX_CLEAR:
386 {
387 m_listbox->Clear();
388 break;
389 }
390 case ID_LISTBOX_APPEND:
391 {
392 m_listbox->Append( "Hi!" );
393 break;
394 }
395 case ID_LISTBOX_DELETE:
396 {
397 int idx = m_listbox->GetSelection();
398 m_listbox->Delete( idx );
399 break;
400 }
401 case ID_LISTBOX_FONT:
402 {
403 m_listbox->SetFont( *wxITALIC_FONT );
404 break;
405 }
406 }
407 }
408
409 void MyPanel::OnChoice( wxCommandEvent &event )
410 {
411 m_text->WriteText( "Choice selection string is: " );
412 m_text->WriteText( event.GetString() );
413 m_text->WriteText( "\n" );
414 }
415
416 void MyPanel::OnChoiceButtons( wxCommandEvent &event )
417 {
418 switch (event.GetId())
419 {
420 case ID_CHOICE_ENABLE:
421 {
422 m_choice->Enable( !((bool)event.GetInt()) );
423 break;
424 }
425 case ID_CHOICE_SEL_NUM:
426 {
427 m_choice->SetSelection( 2 );
428 break;
429 }
430 case ID_CHOICE_SEL_STR:
431 {
432 m_choice->SetStringSelection( "This" );
433 break;
434 }
435 case ID_CHOICE_CLEAR:
436 {
437 m_choice->Clear();
438 break;
439 }
440 case ID_CHOICE_APPEND:
441 {
442 m_choice->Append( "Hi!" );
443 break;
444 }
445 case ID_CHOICE_DELETE:
446 {
447 int idx = m_choice->GetSelection();
448 m_choice->Delete( idx );
449 break;
450 }
451 case ID_CHOICE_FONT:
452 {
453 m_choice->SetFont( *wxITALIC_FONT );
454 break;
455 }
456 }
457 }
458
459 void MyPanel::OnCombo( wxCommandEvent &event )
460 {
461 m_text->WriteText( "ComboBox selection string is: " );
462 m_text->WriteText( event.GetString() );
463 m_text->WriteText( "\n" );
464 }
465
466 void MyPanel::OnComboButtons( wxCommandEvent &event )
467 {
468 switch (event.GetId())
469 {
470 case ID_COMBO_ENABLE:
471 {
472 m_combo->Enable( !((bool)event.GetInt()) );
473 break;
474 }
475 case ID_COMBO_SEL_NUM:
476 {
477 m_combo->SetSelection( 2 );
478 break;
479 }
480 case ID_COMBO_SEL_STR:
481 {
482 m_combo->SetStringSelection( "This" );
483 break;
484 }
485 case ID_COMBO_CLEAR:
486 {
487 m_combo->Clear();
488 break;
489 }
490 case ID_COMBO_APPEND:
491 {
492 m_combo->Append( "Hi!" );
493 break;
494 }
495 case ID_COMBO_DELETE:
496 {
497 int idx = m_combo->GetSelection();
498 m_combo->Delete( idx );
499 break;
500 }
501 case ID_COMBO_FONT:
502 {
503 m_combo->SetFont( *wxITALIC_FONT );
504 break;
505 }
506 }
507 }
508
509 void MyPanel::OnRadio( wxCommandEvent &event )
510 {
511 m_text->WriteText( "RadioBox selection string is: " );
512 m_text->WriteText( event.GetString() );
513 m_text->WriteText( "\n" );
514 }
515
516 void MyPanel::OnRadioButtons( wxCommandEvent &event )
517 {
518 switch (event.GetId())
519 {
520 case ID_RADIOBOX_ENABLE:
521 {
522 m_radio->Enable( !((bool)event.GetInt()) );
523 break;
524 }
525 case ID_RADIOBOX_SEL_NUM:
526 {
527 m_radio->SetSelection( 2 );
528 break;
529 }
530 case ID_RADIOBOX_SEL_STR:
531 {
532 m_radio->SetStringSelection( "This" );
533 break;
534 }
535 case ID_RADIOBOX_FONT:
536 {
537 m_radio->SetFont( *wxITALIC_FONT );
538 break;
539 }
540 }
541 }
542
543 void MyPanel::OnSetFont( wxCommandEvent &WXUNUSED(event) )
544 {
545 m_fontButton->SetFont( *wxITALIC_FONT );
546 m_text->SetFont( *wxITALIC_FONT );
547 }
548
549 MyPanel::~MyPanel()
550 {
551 delete m_notebook->GetImageList();
552 }
553
554 //----------------------------------------------------------------------
555 // MyFrame
556 //----------------------------------------------------------------------
557
558 BEGIN_EVENT_TABLE(MyFrame, wxFrame)
559 EVT_MENU(MINIMAL_QUIT, MyFrame::OnQuit)
560 EVT_MENU(MINIMAL_ABOUT, MyFrame::OnAbout)
561 END_EVENT_TABLE()
562
563 MyFrame::MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h):
564 wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
565 {
566 (void)new MyPanel( this, 10, 10, 300, 100 );
567 }
568
569 void MyFrame::OnQuit (wxCommandEvent& WXUNUSED(event) )
570 {
571 Close(TRUE);
572 }
573
574 void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) )
575 {
576 wxMessageDialog dialog(this, "This is a control sample", "About Controls", wxOK );
577 dialog.ShowModal();
578 }