As per the docs, the value returned is -1 if the value entered is out of range [patch 1116606]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
f5409ef1f7
commit
cdec37ac77
@ -169,6 +169,7 @@ void wxNumberEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event))
|
||||
if ( m_value < m_min || m_value > m_max )
|
||||
{
|
||||
// not a number or out of range
|
||||
m_value = -1;
|
||||
EndModal(wxID_CANCEL);
|
||||
}
|
||||
|
||||
@ -198,7 +199,7 @@ long wxGetNumberFromUser(const wxString& msg,
|
||||
wxNumberEntryDialog dialog(parent, msg, prompt, title,
|
||||
value, min, max, pos);
|
||||
if (dialog.ShowModal() == wxID_OK)
|
||||
return dialog.GetValue();
|
||||
return dialog.GetValue();
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user