From cdec37ac77b3c939c8e336259d4f99f1ad58f988 Mon Sep 17 00:00:00 2001 From: Kevin Hock Date: Sun, 6 Feb 2005 00:43:44 +0000 Subject: [PATCH] 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 --- src/generic/numdlgg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/generic/numdlgg.cpp b/src/generic/numdlgg.cpp index a4455a0b92..0fb413c1ad 100644 --- a/src/generic/numdlgg.cpp +++ b/src/generic/numdlgg.cpp @@ -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; }