X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ae0226b1d0450ee8cfaac881924be948f3a1e39..74c57d1ff65edd1da6f4f8d30be55db47f6d27a7:/samples/controls/controls.cpp diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 9a12beab81..bb6d0fea8a 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -34,7 +34,7 @@ #include "wx/tooltip.h" #endif -#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) +#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) #define USE_XPM #endif @@ -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