]>
git.saurik.com Git - wxWidgets.git/blob - samples/controls/controls.cpp
0d198eb43e8fadc2f12abfa237c0a27cc00b875c
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"
26 #include "wx/spinbutt.h"
27 #include "wx/notebook.h"
28 #include "wx/imaglist.h"
30 // XPM doesn't seem to work under Windows at present. Or, wxNotebook images
32 // Uncomment this line and comment out the next to try it.
33 // #if defined(__WXGTK__) || defined(__WXMOTIF__) || (defined(__WXMSW__) && wxUSE_XPM_IN_MSW)
34 #if defined(__WXGTK__) || defined(__WXMOTIF__)
39 #include "mondrian.xpm"
40 #include "icons/choice.xpm"
41 #include "icons/combo.xpm"
42 #include "icons/list.xpm"
43 #include "icons/radio.xpm"
44 #include "icons/text.xpm"
45 #include "icons/gauge.xpm"
48 //----------------------------------------------------------------------
50 //----------------------------------------------------------------------
52 class MyApp
: public wxApp
58 class MyPanel
: public wxPanel
62 MyPanel(wxFrame
*frame
, int x
, int y
, int w
, int h
);
65 void OnSize( wxSizeEvent
& event
);
66 void OnListBox( wxCommandEvent
&event
);
67 void OnListBoxButtons( wxCommandEvent
&event
);
68 void OnChoice( wxCommandEvent
&event
);
69 void OnChoiceButtons( wxCommandEvent
&event
);
70 void OnCombo( wxCommandEvent
&event
);
71 void OnComboButtons( wxCommandEvent
&event
);
72 void OnRadio( wxCommandEvent
&event
);
73 void OnRadioButtons( wxCommandEvent
&event
);
74 void OnSetFont( wxCommandEvent
&event
);
75 void OnPageChanged( wxNotebookEvent
&event
);
76 void OnSliderUpdate( wxCommandEvent
&event
);
77 void OnSpinUpdate( wxSpinEvent
&event
);
85 wxButton
*m_fontButton
;
86 wxSpinButton
*m_spinbutton
;
87 wxTextCtrl
*m_spintext
;
90 wxNotebook
*m_notebook
;
95 class MyFrame
: public wxFrame
99 MyFrame(wxFrame
*frame
, char *title
, int x
, int y
, int w
, int h
);
103 void OnQuit(wxCommandEvent
& event
);
104 void OnAbout(wxCommandEvent
& event
);
105 bool OnClose(void) { return TRUE
; }
107 DECLARE_EVENT_TABLE()
110 //----------------------------------------------------------------------
112 //----------------------------------------------------------------------
114 IMPLEMENT_APP (MyApp
)
116 //----------------------------------------------------------------------
118 //----------------------------------------------------------------------
120 const int MINIMAL_QUIT
= 100;
121 const int MINIMAL_TEXT
= 101;
122 const int MINIMAL_ABOUT
= 102;
124 bool MyApp::OnInit(void)
126 // Create the main frame window
127 MyFrame
*frame
= new MyFrame((wxFrame
*) NULL
, (char *) "Controls wxWindows App", 50, 50, 530, 420 );
130 // The wxICON() macros loads an icon from a resource under Windows
131 // and uses an #included XPM image under GTK+ and Motif
133 frame
->SetIcon( wxICON(mondrian
) );
135 wxMenu
*file_menu
= new wxMenu
;
137 file_menu
->Append(MINIMAL_ABOUT
, "&About");
138 file_menu
->Append(MINIMAL_QUIT
, "E&xit");
139 wxMenuBar
*menu_bar
= new wxMenuBar
;
140 menu_bar
->Append(file_menu
, "&File");
141 frame
->SetMenuBar(menu_bar
);
150 //----------------------------------------------------------------------
152 //----------------------------------------------------------------------
154 const int ID_NOTEBOOK
= 1000;
156 const int ID_LISTBOX
= 130;
157 const int ID_LISTBOX_SEL_NUM
= 131;
158 const int ID_LISTBOX_SEL_STR
= 132;
159 const int ID_LISTBOX_CLEAR
= 133;
160 const int ID_LISTBOX_APPEND
= 134;
161 const int ID_LISTBOX_DELETE
= 135;
162 const int ID_LISTBOX_FONT
= 136;
163 const int ID_LISTBOX_ENABLE
= 137;
165 const int ID_CHOICE
= 120;
166 const int ID_CHOICE_SEL_NUM
= 121;
167 const int ID_CHOICE_SEL_STR
= 122;
168 const int ID_CHOICE_CLEAR
= 123;
169 const int ID_CHOICE_APPEND
= 124;
170 const int ID_CHOICE_DELETE
= 125;
171 const int ID_CHOICE_FONT
= 126;
172 const int ID_CHOICE_ENABLE
= 127;
174 const int ID_COMBO
= 140;
175 const int ID_COMBO_SEL_NUM
= 141;
176 const int ID_COMBO_SEL_STR
= 142;
177 const int ID_COMBO_CLEAR
= 143;
178 const int ID_COMBO_APPEND
= 144;
179 const int ID_COMBO_DELETE
= 145;
180 const int ID_COMBO_FONT
= 146;
181 const int ID_COMBO_ENABLE
= 147;
183 const int ID_TEXT
= 150;
185 const int ID_RADIOBOX
= 160;
186 const int ID_RADIOBOX_SEL_NUM
= 161;
187 const int ID_RADIOBOX_SEL_STR
= 162;
188 const int ID_RADIOBOX_FONT
= 163;
189 const int ID_RADIOBOX_ENABLE
= 164;
191 const int ID_SET_FONT
= 170;
193 const int ID_GAUGE
= 180;
194 const int ID_SLIDER
= 181;
196 const int ID_SPIN
= 182;
199 BEGIN_EVENT_TABLE(MyPanel
, wxPanel
)
200 EVT_SIZE ( MyPanel::OnSize
)
201 EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK
, MyPanel::OnPageChanged
)
202 EVT_LISTBOX (ID_LISTBOX
, MyPanel::OnListBox
)
203 EVT_BUTTON (ID_LISTBOX_SEL_NUM
, MyPanel::OnListBoxButtons
)
204 EVT_BUTTON (ID_LISTBOX_SEL_STR
, MyPanel::OnListBoxButtons
)
205 EVT_BUTTON (ID_LISTBOX_CLEAR
, MyPanel::OnListBoxButtons
)
206 EVT_BUTTON (ID_LISTBOX_APPEND
, MyPanel::OnListBoxButtons
)
207 EVT_BUTTON (ID_LISTBOX_DELETE
, MyPanel::OnListBoxButtons
)
208 EVT_BUTTON (ID_LISTBOX_FONT
, MyPanel::OnListBoxButtons
)
209 EVT_CHECKBOX (ID_LISTBOX_ENABLE
, MyPanel::OnListBoxButtons
)
210 EVT_CHOICE (ID_CHOICE
, MyPanel::OnChoice
)
211 EVT_BUTTON (ID_CHOICE_SEL_NUM
, MyPanel::OnChoiceButtons
)
212 EVT_BUTTON (ID_CHOICE_SEL_STR
, MyPanel::OnChoiceButtons
)
213 EVT_BUTTON (ID_CHOICE_CLEAR
, MyPanel::OnChoiceButtons
)
214 EVT_BUTTON (ID_CHOICE_APPEND
, MyPanel::OnChoiceButtons
)
215 EVT_BUTTON (ID_CHOICE_DELETE
, MyPanel::OnChoiceButtons
)
216 EVT_BUTTON (ID_CHOICE_FONT
, MyPanel::OnChoiceButtons
)
217 EVT_CHECKBOX (ID_CHOICE_ENABLE
, MyPanel::OnChoiceButtons
)
218 EVT_CHOICE (ID_COMBO
, MyPanel::OnCombo
)
219 EVT_BUTTON (ID_COMBO_SEL_NUM
, MyPanel::OnComboButtons
)
220 EVT_BUTTON (ID_COMBO_SEL_STR
, MyPanel::OnComboButtons
)
221 EVT_BUTTON (ID_COMBO_CLEAR
, MyPanel::OnComboButtons
)
222 EVT_BUTTON (ID_COMBO_APPEND
, MyPanel::OnComboButtons
)
223 EVT_BUTTON (ID_COMBO_DELETE
, MyPanel::OnComboButtons
)
224 EVT_BUTTON (ID_COMBO_FONT
, MyPanel::OnComboButtons
)
225 EVT_CHECKBOX (ID_COMBO_ENABLE
, MyPanel::OnComboButtons
)
226 EVT_RADIOBOX (ID_RADIOBOX
, MyPanel::OnRadio
)
227 EVT_BUTTON (ID_RADIOBOX_SEL_NUM
, MyPanel::OnRadioButtons
)
228 EVT_BUTTON (ID_RADIOBOX_SEL_STR
, MyPanel::OnRadioButtons
)
229 EVT_BUTTON (ID_RADIOBOX_FONT
, MyPanel::OnRadioButtons
)
230 EVT_CHECKBOX (ID_RADIOBOX_ENABLE
, MyPanel::OnRadioButtons
)
231 EVT_BUTTON (ID_SET_FONT
, MyPanel::OnSetFont
)
232 EVT_SLIDER (ID_SLIDER
, MyPanel::OnSliderUpdate
)
233 EVT_SPIN (ID_SPIN
, MyPanel::OnSpinUpdate
)
236 MyPanel::MyPanel( wxFrame
*frame
, int x
, int y
, int w
, int h
) :
237 wxPanel( frame
, -1, wxPoint(x
, y
), wxSize(w
, h
) )
239 SetBackgroundColour("cadet blue");
241 m_text
= new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE
);
242 m_text
->SetBackgroundColour("wheat");
244 m_notebook
= new wxNotebook( this, ID_NOTEBOOK
, wxPoint(0,0), wxSize(200,150) );
256 // image ids and names
259 Image_List
, Image_Choice
, Image_Combo
, Image_Text
, Image_Radio
, Image_Gauge
, Image_Max
262 // fill the image list
263 wxImageList
*imagelist
= new wxImageList(32, 32);
265 imagelist
-> Add( wxBitmap( list_xpm
));
266 imagelist
-> Add( wxBitmap( choice_xpm
));
267 imagelist
-> Add( wxBitmap( combo_xpm
));
268 imagelist
-> Add( wxBitmap( text_xpm
));
269 imagelist
-> Add( wxBitmap( radio_xpm
));
270 imagelist
-> Add( wxBitmap( gauge_xpm
));
271 m_notebook
->SetImageList(imagelist
);
275 #define Image_List -1
276 #define Image_Choice -1
277 #define Image_Combo -1
278 #define Image_Text -1
279 #define Image_Radio -1
280 #define Image_Gauge -1
285 wxButton
*button
= (wxButton
*)NULL
;
287 m_notebook
->SetBackgroundColour("cadet blue");
289 wxPanel
*panel
= (wxPanel
*) NULL
;
290 panel
= new wxPanel(m_notebook
);
291 panel
->SetBackgroundColour("cadet blue");
292 panel
->SetForegroundColour("blue");
293 m_listbox
= new wxListBox( panel
, ID_LISTBOX
, wxPoint(10,10), wxSize(120,70), 5, choices
);
294 m_listbox
->SetBackgroundColour("wheat");
295 (void)new wxButton( panel
, ID_LISTBOX_SEL_NUM
, "Select #2", wxPoint(180,30), wxSize(140,30) );
296 (void)new wxButton( panel
, ID_LISTBOX_SEL_STR
, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
297 (void)new wxButton( panel
, ID_LISTBOX_CLEAR
, "Clear", wxPoint(180,80), wxSize(140,30) );
298 (void)new wxButton( panel
, ID_LISTBOX_APPEND
, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
299 (void)new wxButton( panel
, ID_LISTBOX_DELETE
, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
300 button
= new wxButton( panel
, ID_LISTBOX_FONT
, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
301 button
->SetForegroundColour( "red" );
302 (void)new wxCheckBox( panel
, ID_LISTBOX_ENABLE
, "Disable", wxPoint(20,130), wxSize(140,30) );
303 m_notebook
->AddPage(panel
, "wxList", FALSE
, Image_List
);
305 panel
= new wxPanel(m_notebook
);
306 panel
->SetBackgroundColour("cadet blue");
307 panel
->SetForegroundColour("blue");
308 m_choice
= new wxChoice( panel
, ID_CHOICE
, wxPoint(10,10), wxSize(120,-1), 5, choices
);
309 m_choice
->SetBackgroundColour("wheat");
310 (void)new wxButton( panel
, ID_CHOICE_SEL_NUM
, "Select #2", wxPoint(180,30), wxSize(140,30) );
311 (void)new wxButton( panel
, ID_CHOICE_SEL_STR
, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
312 (void)new wxButton( panel
, ID_CHOICE_CLEAR
, "Clear", wxPoint(180,80), wxSize(140,30) );
313 (void)new wxButton( panel
, ID_CHOICE_APPEND
, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
314 (void)new wxButton( panel
, ID_CHOICE_DELETE
, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
315 (void)new wxButton( panel
, ID_CHOICE_FONT
, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
316 (void)new wxCheckBox( panel
, ID_CHOICE_ENABLE
, "Disable", wxPoint(20,130), wxSize(140,30) );
317 m_notebook
->AddPage(panel
, "wxChoice", FALSE
, Image_Choice
);
319 panel
= new wxPanel(m_notebook
);
320 panel
->SetBackgroundColour("cadet blue");
321 panel
->SetForegroundColour("blue");
322 m_combo
= new wxComboBox( panel
, ID_COMBO
, "This", wxPoint(10,10), wxSize(120,-1), 5, choices
);
323 m_combo
->SetBackgroundColour("wheat");
324 (void)new wxButton( panel
, ID_COMBO_SEL_NUM
, "Select #2", wxPoint(180,30), wxSize(140,30) );
325 (void)new wxButton( panel
, ID_COMBO_SEL_STR
, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
326 (void)new wxButton( panel
, ID_COMBO_CLEAR
, "Clear", wxPoint(180,80), wxSize(140,30) );
327 (void)new wxButton( panel
, ID_COMBO_APPEND
, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
328 (void)new wxButton( panel
, ID_COMBO_DELETE
, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
329 (void)new wxButton( panel
, ID_COMBO_FONT
, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
330 (void)new wxCheckBox( panel
, ID_COMBO_ENABLE
, "Disable", wxPoint(20,130), wxSize(140,30) );
331 m_notebook
->AddPage(panel
, "wxComboBox", FALSE
, Image_Combo
);
333 panel
= new wxPanel(m_notebook
);
334 panel
->SetBackgroundColour("cadet blue");
335 panel
->SetForegroundColour("blue");
336 wxTextCtrl
*tc
= new wxTextCtrl( panel
, ID_TEXT
, "Write text here.", wxPoint(10,10), wxSize(350,28));
337 (*tc
) << " More text.";
338 tc
->SetBackgroundColour("wheat");
339 tc
= new wxTextCtrl( panel
, ID_TEXT
, "And here.", wxPoint(10,50), wxSize(350,160), wxTE_MULTILINE
);
340 (*tc
) << " More text.";
341 tc
->SetBackgroundColour("wheat");
342 m_notebook
->AddPage(panel
, "wxTextCtrl" , FALSE
, Image_Text
);
344 wxString choices2
[] =
350 panel
= new wxPanel(m_notebook
);
351 panel
->SetBackgroundColour("cadet blue");
352 panel
->SetForegroundColour("blue");
353 m_radio
= new wxRadioBox( panel
, ID_RADIOBOX
, "That", wxPoint(10,160), wxSize(-1,-1), 2, choices2
, 1, wxRA_HORIZONTAL
);
354 m_radio
->SetBackgroundColour("wheat");
355 m_radio
= new wxRadioBox( panel
, ID_RADIOBOX
, "This", wxPoint(10,10), wxSize(-1,-1), 5, choices
, 1, wxRA_VERTICAL
);
356 m_radio
->SetBackgroundColour("wheat");
357 (void)new wxButton( panel
, ID_RADIOBOX_SEL_NUM
, "Select #2", wxPoint(180,30), wxSize(140,30) );
358 (void)new wxButton( panel
, ID_RADIOBOX_SEL_STR
, "Select 'This'", wxPoint(180,80), wxSize(140,30) );
359 (void)new wxButton( panel
, ID_RADIOBOX_FONT
, "Set Italic font", wxPoint(180,130), wxSize(140,30) );
360 (void)new wxCheckBox( panel
, ID_RADIOBOX_ENABLE
, "Disable", wxPoint(340,130), wxSize(140,30) );
361 m_fontButton
= new wxButton( panel
, ID_SET_FONT
, "Set more Italic font", wxPoint(340,30), wxSize(160,30) );
362 m_notebook
->AddPage(panel
, "wxRadioBox", FALSE
, Image_Radio
);
364 panel
= new wxPanel(m_notebook
);
365 panel
->SetBackgroundColour("cadet blue");
366 panel
->SetForegroundColour("blue");
367 (void)new wxStaticBox( panel
, -1, "wxGauge and wxSlider", wxPoint(10,10), wxSize(180,130) );
368 m_gauge
= new wxGauge( panel
, -1, 200, wxPoint(18,50), wxSize(155,-1) );
369 m_gauge
->SetBackgroundColour("wheat");
370 m_slider
= new wxSlider( panel
, ID_SLIDER
, 0, 0, 200, wxPoint(18,90), wxSize(155,-1) );
371 m_slider
->SetBackgroundColour("wheat");
372 (void)new wxStaticBox( panel
, -1, "Explanation", wxPoint(200,10), wxSize(290,130) );
373 (void)new wxStaticText( panel
, -1,
374 "In order see the gauge (aka progress bar)\n"
375 "control do something you have to drag the\n"
376 "handle of the slider to the right.\n"
378 "This is also supposed to demonstrate how\n"
379 "to use static controls.\n",
381 m_spintext
= new wxTextCtrl( panel
, -1, "0", wxPoint(20,160), wxSize(80,-1) );
382 m_spintext
->SetBackgroundColour("wheat");
383 m_spinbutton
= new wxSpinButton( panel
, ID_SPIN
, wxPoint(103,159), wxSize(-1,-1) );
384 m_spinbutton
->SetBackgroundColour("wheat");
385 m_spinbutton
->SetRange(0,100);
387 m_notebook
->AddPage(panel
, "wxGauge", FALSE
, Image_Gauge
);
390 void MyPanel::OnSize( wxSizeEvent
& WXUNUSED(event
) )
394 GetClientSize( &x
, &y
);
396 if (m_notebook
) m_notebook
->SetSize( 2, 2, x
-4, y
*2/3-4 );
397 if (m_text
) m_text
->SetSize( 2, y
*2/3+2, x
-4, y
/3-4 );
400 void MyPanel::OnPageChanged( wxNotebookEvent
&event
)
402 *m_text
<< "Notebook selection is " << event
.GetSelection() << "\n";
405 void MyPanel::OnListBox( wxCommandEvent
&event
)
407 m_text
->WriteText( "ListBox selection string is: " );
408 m_text
->WriteText( event
.GetString() );
409 m_text
->WriteText( "\n" );
412 void MyPanel::OnListBoxButtons( wxCommandEvent
&event
)
414 switch (event
.GetId())
416 case ID_LISTBOX_ENABLE
:
418 m_listbox
->Enable( !((bool)event
.GetInt()) );
421 case ID_LISTBOX_SEL_NUM
:
423 m_listbox
->SetSelection( 2 );
426 case ID_LISTBOX_SEL_STR
:
428 m_listbox
->SetStringSelection( "This" );
431 case ID_LISTBOX_CLEAR
:
436 case ID_LISTBOX_APPEND
:
438 m_listbox
->Append( "Hi!" );
441 case ID_LISTBOX_DELETE
:
443 int idx
= m_listbox
->GetSelection();
444 m_listbox
->Delete( idx
);
447 case ID_LISTBOX_FONT
:
449 m_listbox
->SetFont( *wxITALIC_FONT
);
455 void MyPanel::OnChoice( wxCommandEvent
&event
)
457 m_text
->WriteText( "Choice selection string is: " );
458 m_text
->WriteText( event
.GetString() );
459 m_text
->WriteText( "\n" );
462 void MyPanel::OnChoiceButtons( wxCommandEvent
&event
)
464 switch (event
.GetId())
466 case ID_CHOICE_ENABLE
:
468 m_choice
->Enable( !((bool)event
.GetInt()) );
471 case ID_CHOICE_SEL_NUM
:
473 m_choice
->SetSelection( 2 );
476 case ID_CHOICE_SEL_STR
:
478 m_choice
->SetStringSelection( "This" );
481 case ID_CHOICE_CLEAR
:
486 case ID_CHOICE_APPEND
:
488 m_choice
->Append( "Hi!" );
491 case ID_CHOICE_DELETE
:
493 int idx
= m_choice
->GetSelection();
494 m_choice
->Delete( idx
);
499 m_choice
->SetFont( *wxITALIC_FONT
);
505 void MyPanel::OnCombo( wxCommandEvent
&event
)
507 m_text
->WriteText( "ComboBox selection string is: " );
508 m_text
->WriteText( event
.GetString() );
509 m_text
->WriteText( "\n" );
512 void MyPanel::OnComboButtons( wxCommandEvent
&event
)
514 switch (event
.GetId())
516 case ID_COMBO_ENABLE
:
518 m_combo
->Enable( !((bool)event
.GetInt()) );
521 case ID_COMBO_SEL_NUM
:
523 m_combo
->SetSelection( 2 );
526 case ID_COMBO_SEL_STR
:
528 m_combo
->SetStringSelection( "This" );
536 case ID_COMBO_APPEND
:
538 m_combo
->Append( "Hi!" );
541 case ID_COMBO_DELETE
:
543 int idx
= m_combo
->GetSelection();
544 m_combo
->Delete( idx
);
549 m_combo
->SetFont( *wxITALIC_FONT
);
555 void MyPanel::OnRadio( wxCommandEvent
&event
)
557 m_text
->WriteText( "RadioBox selection string is: " );
558 m_text
->WriteText( event
.GetString() );
559 m_text
->WriteText( "\n" );
562 void MyPanel::OnRadioButtons( wxCommandEvent
&event
)
564 switch (event
.GetId())
566 case ID_RADIOBOX_ENABLE
:
568 m_radio
->Enable( !((bool)event
.GetInt()) );
571 case ID_RADIOBOX_SEL_NUM
:
573 m_radio
->SetSelection( 2 );
576 case ID_RADIOBOX_SEL_STR
:
578 m_radio
->SetStringSelection( "This" );
581 case ID_RADIOBOX_FONT
:
583 m_radio
->SetFont( *wxITALIC_FONT
);
589 void MyPanel::OnSetFont( wxCommandEvent
&WXUNUSED(event
) )
591 m_fontButton
->SetFont( *wxITALIC_FONT
);
592 m_text
->SetFont( *wxITALIC_FONT
);
595 void MyPanel::OnSliderUpdate( wxCommandEvent
&WXUNUSED(event
) )
597 m_gauge
->SetValue( m_slider
->GetValue() );
600 void MyPanel::OnSpinUpdate( wxSpinEvent
&event
)
603 value
.sprintf( "%d", (int)event
.GetPosition() );
604 m_spintext
->SetValue( value
);
609 delete m_notebook
->GetImageList();
612 //----------------------------------------------------------------------
614 //----------------------------------------------------------------------
616 BEGIN_EVENT_TABLE(MyFrame
, wxFrame
)
617 EVT_MENU(MINIMAL_QUIT
, MyFrame::OnQuit
)
618 EVT_MENU(MINIMAL_ABOUT
, MyFrame::OnAbout
)
621 MyFrame::MyFrame(wxFrame
*frame
, char *title
, int x
, int y
, int w
, int h
):
622 wxFrame(frame
, -1, title
, wxPoint(x
, y
), wxSize(w
, h
))
624 (void)new MyPanel( this, 10, 10, 300, 100 );
627 void MyFrame::OnQuit (wxCommandEvent
& WXUNUSED(event
) )
632 void MyFrame::OnAbout( wxCommandEvent
& WXUNUSED(event
) )
634 wxMessageDialog
dialog(this, "This is a control sample", "About Controls", wxOK
);