X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f93f659dccf2dfe5b12f4c01b53f5b401cd7d5e..3b01b1fe4cb656f39290bf7f3891667855abe601:/samples/controls/controls.cpp diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 646034585e..4fea525155 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -177,6 +177,8 @@ public: void OnEnableAll(wxCommandEvent& event); void OnIdle( wxIdleEvent& event ); + void OnIconized( wxIconizeEvent& event ); + void OnMaximized( wxMaximizeEvent& event ); void OnSize( wxSizeEvent& event ); void OnMove( wxMoveEvent& event ); @@ -641,7 +643,6 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) wxButton *button = new MyButton( panel, ID_LISTBOX_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) ); button->SetDefault(); - button->SetForegroundColour(*wxBLUE); #if wxUSE_TOOLTIPS @@ -650,6 +651,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, _T("&Disable"), wxPoint(20,170) ); m_checkbox->SetValue(false); + button->MoveAfterInTabOrder(m_checkbox); #if wxUSE_TOOLTIPS m_checkbox->SetToolTip( _T("Click here to disable the listbox") ); #endif // wxUSE_TOOLTIPS @@ -660,8 +662,8 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) #if wxUSE_CHOICE panel = new wxPanel(m_notebook); - m_choice = new wxChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,wxDefaultSize.y), 5, choices ); - m_choiceSorted = new wxChoice( panel, ID_CHOICE_SORTED, wxPoint(10,70), wxSize(120,wxDefaultSize.y), + m_choice = new wxChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,wxDefaultCoord), 5, choices ); + m_choiceSorted = new wxChoice( panel, ID_CHOICE_SORTED, wxPoint(10,70), wxSize(120,wxDefaultCoord), 5, choices, wxCB_SORT ); SetChoiceClientData(wxT("choice"), m_choice); @@ -684,7 +686,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) (void)new wxStaticBox( panel, wxID_ANY, _T("&Box around combobox"), wxPoint(5, 5), wxSize(150, 100)); m_combo = new MyComboBox( panel, ID_COMBO, _T("This"), - wxPoint(20,25), wxSize(120, wxDefaultSize.y), + wxPoint(20,25), wxSize(120, wxDefaultCoord), 5, choices, wxCB_READONLY | wxPROCESS_ENTER); m_combo->SetBackgroundColour(*wxBLUE); @@ -734,7 +736,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_gaugeVert = new wxGauge( panel, wxID_ANY, 100, wxPoint(195,35), wxSize(30, 90), wxGA_VERTICAL | wxGA_SMOOTH | wxNO_BORDER ); - m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,wxDefaultSize.y), + m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,wxDefaultCoord), wxSL_AUTOTICKS | wxSL_LABELS ); m_slider->SetTickFreq(40, 0); #if wxUSE_TOOLTIPS @@ -750,7 +752,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) (void)new wxStaticText( panel, wxID_ANY, _T("Drag the slider!"), wxPoint(250,30), - wxSize(240, wxDefaultSize.y) + wxSize(240, wxDefaultCoord) ); #else (void)new wxStaticText( panel, wxID_ANY, @@ -767,9 +769,9 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) int initialSpinValue = -5; wxString s; s << initialSpinValue; - m_spintext = new wxTextCtrl( panel, wxID_ANY, s, wxPoint(20,160), wxSize(80,wxDefaultSize.y) ); + m_spintext = new wxTextCtrl( panel, wxID_ANY, s, wxPoint(20,160), wxSize(80,wxDefaultCoord) ); #if wxUSE_SPINBTN - m_spinbutton = new wxSpinButton( panel, ID_SPIN, wxPoint(103,160), wxSize(80, wxDefaultSize.y) ); + m_spinbutton = new wxSpinButton( panel, ID_SPIN, wxPoint(103,160), wxSize(80, wxDefaultCoord) ); m_spinbutton->SetRange(-40,30); m_spinbutton->SetValue(initialSpinValue); @@ -778,7 +780,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) #endif // wxUSE_SPINBTN #if wxUSE_SPINCTRL - m_spinctrl = new wxSpinCtrl( panel, ID_SPINCTRL, _T(""), wxPoint(200, 160), wxSize(80, wxDefaultSize.y) ); + m_spinctrl = new wxSpinCtrl( panel, ID_SPINCTRL, _T(""), wxPoint(200, 160), wxSize(80, wxDefaultCoord) ); m_spinctrl->SetRange(10,30); m_spinctrl->SetValue(15); #endif // wxUSE_SPINCTRL @@ -1519,6 +1521,8 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(CONTROLS_ENABLE_ALL, MyFrame::OnEnableAll) + EVT_ICONIZE(MyFrame::OnIconized) + EVT_MAXIMIZE(MyFrame::OnMaximized) EVT_SIZE(MyFrame::OnSize) EVT_MOVE(MyFrame::OnMove) @@ -1642,6 +1646,18 @@ void MyFrame::OnMove( wxMoveEvent& event ) event.Skip(); } +void MyFrame::OnIconized( wxIconizeEvent& event ) +{ + wxLogMessage(_T("Frame %s"), event.Iconized() ? _T("iconized") + : _T("restored")); + event.Skip(); +} + +void MyFrame::OnMaximized( wxMaximizeEvent& WXUNUSED(event) ) +{ + wxLogMessage(_T("Frame maximized")); +} + void MyFrame::OnSize( wxSizeEvent& event ) { #if wxUSE_STATUSBAR