X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd008b87e310c3c1ab42f9b79573cebecedad21c..60df0f96859fb0131ddfa8b477612a15f4a43790:/samples/controls/controls.cpp diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 8c696f260e..bb6d0fea8a 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -676,7 +676,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); - (void)new wxStaticBox( panel, -1, "&Explanation", wxPoint(230,10), wxSize(270,130) ); + (void)new wxStaticBox( panel, -1, "&Explanation", + wxPoint(230,10), wxSize(270,130), + wxALIGN_CENTER ); + #ifdef __WXMOTIF__ // No wrapping text in wxStaticText yet :-( (void)new wxStaticText( panel, -1, @@ -1273,6 +1276,13 @@ void MyPanel::OnUpdateShowProgress( wxUpdateUIEvent& event ) void MyPanel::OnShowProgress( wxCommandEvent& WXUNUSED(event) ) { int max = m_spinbutton->GetValue(); + + if ( max <= 0 ) + { + wxLogError(_T("You must set positive range!")); + return; + } + wxProgressDialog dialog("Progress dialog example", "An informative message", max, // range