+ (void)::SendMessage(GetHwnd(), UDM_SETBUDDY, (WPARAM)m_hwndBuddy, 0);
+
+ if ( !value.IsEmpty() )
+ {
+ SetValue(value);
+ }
+
+ return TRUE;
+}
+
+// ----------------------------------------------------------------------------
+// wxTextCtrl-like methods
+// ----------------------------------------------------------------------------
+
+void wxSpinCtrl::SetValue(const wxString& text)
+{
+ if ( ::SetWindowText((HWND)m_hwndBuddy, text.c_str()) )
+ {
+ wxLogLastError("SetWindowText(buddy)");
+ }
+}
+
+int wxSpinCtrl::GetValue() const
+{
+ wxString val = wxGetWindowText(m_hwndBuddy);
+
+ long n;
+ if ( (wxSscanf(val, wxT("%lu"), &n) != 1) )
+ n = INT_MIN;
+
+ return n;
+}
+
+// ----------------------------------------------------------------------------
+// when setting font, we need to do it for both controls
+// ----------------------------------------------------------------------------
+
+bool wxSpinCtrl::SetFont(const wxFont& font)
+{
+ if ( !wxWindowBase::SetFont(font) )
+ {
+ // nothing to do
+ return FALSE;
+ }
+
+ WXHANDLE hFont = GetFont().GetResourceHandle();
+ (void)::SendMessage((HWND)m_hwndBuddy, WM_SETFONT, (WPARAM)hFont, TRUE);