X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d23a4bf410a7988864899b39fafaec8b3034f10..5737d05f8665dfd3f62dd8e536b317f1f48202c5:/samples/controls/controls.cpp diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 8e20cbb406..bb6d0fea8a 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -1276,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