X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9f84eccdeaf8e3706f7861ce19da3a256814d83e..e4d47fbd6f53b11276dde270e325b339393e9702:/samples/controls/controls.cpp diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 0b8561cef5..1fd8a2a504 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -481,6 +481,8 @@ EVT_TEXT (ID_SPINCTRL, MyPanel::OnSpinCtrlText) #endif // wxUSE_SPINCTRL #if wxUSE_TOGGLEBTN EVT_TOGGLEBUTTON(ID_BUTTON_LABEL, MyPanel::OnUpdateLabel) +#else +EVT_CHECKBOX(ID_BUTTON_LABEL, MyPanel::OnUpdateLabel) #endif // wxUSE_TOGGLEBTN EVT_CHECKBOX (ID_CHANGE_COLOUR, MyPanel::OnChangeColour) EVT_BUTTON (ID_BUTTON_TEST1, MyPanel::OnTestButton) @@ -837,6 +839,9 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) #if wxUSE_TOGGLEBTN (void)new wxToggleButton(panel, ID_BUTTON_LABEL, _T("&Toggle label"), wxPoint(250, 20)); +#else + (void)new wxCheckBox(panel, ID_BUTTON_LABEL, + _T("&Toggle label"), wxPoint(250, 20)); #endif // wxUSE_TOGGLEBTN m_label = new wxStaticText(panel, -1, _T("Label with some long text"), @@ -1685,7 +1690,7 @@ void MyComboBox::OnChar(wxKeyEvent& event) { wxLogMessage(_T("MyComboBox::OnChar")); - if ( event.KeyCode() == 'w' ) + if ( event.GetKeyCode() == 'w' ) wxLogMessage(_T("MyComboBox: 'w' will be ignored.")); else event.Skip(); @@ -1695,7 +1700,7 @@ void MyComboBox::OnKeyDown(wxKeyEvent& event) { wxLogMessage(_T("MyComboBox::OnKeyDown")); - if ( event.KeyCode() == 'w' ) + if ( event.GetKeyCode() == 'w' ) wxLogMessage(_T("MyComboBox: 'w' will be ignored.")); else event.Skip();