safety check

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2002-02-13 00:36:27 +00:00
parent 5a750e5a17
commit 601964ff75

View File

@ -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