From f0368d28bf125cdc851e65e1ea215651f19453d2 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 10 Nov 2009 17:36:53 +0000 Subject: [PATCH] wxSpinCtrl values are always integral, they don't need to be rounded git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/spinctlg.h | 9 ++++----- include/wx/gtk/spinctrl.h | 8 ++++---- src/gtk/spinctrl.cpp | 3 --- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/wx/generic/spinctlg.h b/include/wx/generic/spinctlg.h index 9c18c06a6b..41fc00cb1b 100644 --- a/include/wx/generic/spinctlg.h +++ b/include/wx/generic/spinctlg.h @@ -264,11 +264,10 @@ public: } // accessors - int GetValue(wxSPINCTRL_GETVALUE_FIX) const - { return wxRound( DoGetValue() ); } - int GetMin() const { return wxRound( m_min ); } - int GetMax() const { return wxRound( m_max ); } - int GetIncrement() const { return wxRound( m_increment ); } + int GetValue(wxSPINCTRL_GETVALUE_FIX) const { return int(DoGetValue()); } + int GetMin() const { return int(m_min); } + int GetMax() const { return int(m_max); } + int GetIncrement() const { return int(m_increment); } // operations void SetValue(const wxString& value) diff --git a/include/wx/gtk/spinctrl.h b/include/wx/gtk/spinctrl.h index 39dc35089b..f9924ed224 100644 --- a/include/wx/gtk/spinctrl.h +++ b/include/wx/gtk/spinctrl.h @@ -117,10 +117,10 @@ public: } // accessors - int GetValue() const { return wxRound( DoGetValue() ); } - int GetMin() const { return wxRound( DoGetMin() ); } - int GetMax() const { return wxRound( DoGetMax() ); } - int GetIncrement() const { return wxRound( DoGetIncrement() ); } + int GetValue() const { return int(DoGetValue()); } + int GetMin() const { return int(DoGetMin()); } + int GetMax() const { return int(DoGetMax()); } + int GetIncrement() const { return int(DoGetIncrement()); } // operations void SetValue(const wxString& value) { wxSpinCtrlGTKBase::SetValue(value); } // visibility problem w/ gcc diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index bae8e7ea5b..6ba4071d28 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -218,9 +218,6 @@ void wxSpinCtrlGTKBase::DoSetValue( double value ) { wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") ); - if (wxIsKindOf(this, wxSpinCtrl)) - value = wxRound( value ); - GtkDisableEvents(); gtk_spin_button_set_value( GTK_SPIN_BUTTON(m_widget), value); GtkEnableEvents(); -- 2.45.2