From 601964ff75f93953dd1f6e4665b9839a8eb72e44 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 13 Feb 2002 00:36:27 +0000 Subject: [PATCH] safety check git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/controls/controls.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.45.2