]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/spinctrl.cpp
fixed wxXmlResource::Load's detection of filenames to be done as early as possible
[wxWidgets.git] / src / gtk / spinctrl.cpp
index 952d00378436cc7b079f554e9b6203c1471909a9..698e6f1365fb9614e86ef1c597f88a72a0aa2a39 100644 (file)
@@ -52,7 +52,7 @@ gtk_value_changed(GtkSpinButton* spinbutton, wxSpinCtrlGTKBase* win)
     {
         wxSpinEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, win->GetId());
         event.SetEventObject( win );
-        event.SetPosition((int)(win->m_value + 0.5)); // FIXME should be SetValue
+        event.SetPosition( wxRound(win->m_value) ); // FIXME should be SetValue
         event.SetString(GTK_ENTRY(spinbutton)->text);
         win->HandleWindowEvent( event );
     }
@@ -142,7 +142,7 @@ double wxSpinCtrlGTKBase::DoGetValue() const
 
     GtkDisableEvents();
     gtk_spin_button_update( GTK_SPIN_BUTTON(m_widget) );
-    wx_const_cast(wxSpinCtrlGTKBase*, this)->m_value =
+    const_cast<wxSpinCtrlGTKBase*>(this)->m_value =
         gtk_spin_button_get_value(GTK_SPIN_BUTTON(m_widget));
     GtkEnableEvents();
 
@@ -206,7 +206,7 @@ void wxSpinCtrlGTKBase::DoSetValue( double value )
     wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );
 
     if (wxIsKindOf(this, wxSpinCtrl))
-        value = int(value + 0.5);
+        value = wxRound( value );
 
     GtkDisableEvents();
     gtk_spin_button_set_value( GTK_SPIN_BUTTON(m_widget), value);