From e94ff4cbf1ce77440da542d93d06805b1456d518 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 Apr 2002 10:00:36 +0000 Subject: [PATCH] fixed logic in limiting spin ctrl values (patch from Dimitri) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/controls/controls.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 541e0d5a5e..eb20debb25 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -706,7 +706,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_spintext = new wxTextCtrl( panel, -1, s, wxPoint(20,160), wxSize(80,-1) ); #if wxUSE_SPINBTN m_spinbutton = new wxSpinButton( panel, ID_SPIN, wxPoint(103,160), wxSize(80, -1) ); - m_spinbutton->SetRange(-10,30); + m_spinbutton->SetRange(-40,30); m_spinbutton->SetValue(initialSpinValue); m_btnProgress = new wxButton( panel, ID_BTNPROGRESS, "&Show progress dialog", @@ -1233,7 +1233,7 @@ void MyPanel::OnSpinUp( wxSpinEvent &event ) value.Printf( _T("Spin control up: current = %d\n"), m_spinbutton->GetValue()); - if ( m_spinbutton->GetValue() > 17 ) + if ( event.GetPosition() > 17 ) { value += _T("Preventing the spin button from going above 17.\n"); @@ -1249,7 +1249,7 @@ void MyPanel::OnSpinDown( wxSpinEvent &event ) value.Printf( _T("Spin control down: current = %d\n"), m_spinbutton->GetValue()); - if ( m_spinbutton->GetValue() < -17 ) + if ( event.GetPosition() < -17 ) { value += _T("Preventing the spin button from going below -17.\n"); -- 2.45.2