X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/508d586ea2d6b24ac070f9ed1be5edc24bb02b16..3a9a01661aa51c52b734b16abdceec2f905c5f25:/samples/controls/controls.cpp diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 8dc971ecbc..e29c0b5236 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -272,7 +272,7 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr) : wxRadioBox(parent, id, title, pos, size, n, choices, majorDim, - style, validator, name) { } + style, validator, name) { SetForegroundColour(*wxRED); } protected: void OnFocusGot(wxFocusEvent& event) @@ -682,6 +682,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) panel = new wxPanel(m_notebook); (void)new MyRadioBox( panel, ID_RADIOBOX, "&That", wxPoint(10,160), wxSize(-1,-1), WXSIZEOF(choices2), choices2, 1, wxRA_SPECIFY_ROWS ); m_radio = new wxRadioBox( panel, ID_RADIOBOX, "T&his", wxPoint(10,10), wxSize(-1,-1), WXSIZEOF(choices), choices, 1, wxRA_SPECIFY_COLS ); + m_radio->SetForegroundColour(*wxRED); #if wxUSE_TOOLTIPS m_combo->SetToolTip("This is a natural\ncombobox - can you believe me?"); @@ -709,6 +710,10 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1), wxSL_AUTOTICKS | wxSL_LABELS ); m_slider->SetTickFreq(40, 0); +#if wxUSE_TOOLTIPS + m_slider->SetToolTip(_T("This is a sliding slider")); +#endif // wxUSE_TOOLTIPS + (void)new wxStaticBox( panel, -1, "&Explanation", wxPoint(230,10), wxSize(270,130), wxALIGN_CENTER ); @@ -1139,10 +1144,12 @@ void MyPanel::OnCombo( wxCommandEvent &event ) m_text->AppendText( "\n" ); } -void MyPanel::OnComboTextChanged(wxCommandEvent& WXUNUSED(event)) +void MyPanel::OnComboTextChanged(wxCommandEvent& event) { - wxLogMessage(_T("Text in the combobox changed: now is '%s'."), - m_combo->GetValue().c_str()); + wxString str; + str.Printf( wxT("Text in the combobox changed: now is '%s'."), + event.GetString().c_str() ); + wxLogMessage( str.c_str() ); } void MyPanel::OnComboTextEnter(wxCommandEvent& WXUNUSED(event)) @@ -1222,6 +1229,8 @@ void MyPanel::OnRadioButtons( wxCommandEvent &event ) } case ID_RADIOBOX_FONT: { + m_radio->SetForegroundColour(*wxGREEN); + m_radio->SetFont( *wxITALIC_FONT ); break; } @@ -1560,7 +1569,7 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) ) #endif s_windowFocus->GetClassInfo()->GetClassName() #ifdef __WXMSW__ - , s_windowFocus->GetHWND() + , (unsigned int) s_windowFocus->GetHWND() #endif );