+// ----------------------------------------------------------------------------
+// wxTextCtrl-like methods
+// ----------------------------------------------------------------------------
+
+void wxSpinCtrl::SetValue(const wxString& text)
+{
+ // TODO:
+ /*
+ 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;
+}
+
+// ----------------------------------------------------------------------------
+// forward some methods to subcontrols
+// ----------------------------------------------------------------------------
+
+bool wxSpinCtrl::SetFont(const wxFont& font)
+{
+ if ( !wxWindowBase::SetFont(font) )
+ {
+ // nothing to do
+ return FALSE;
+ }
+
+ WXHANDLE hFont = GetFont().GetResourceHandle();
+ // TODO:
+ /*
+ (void)::SendMessage((HWND)m_hwndBuddy, WM_SETFONT, (WPARAM)hFont, TRUE);
+ */
+ return TRUE;
+}
+
+bool wxSpinCtrl::Show(bool show)
+{
+ if ( !wxControl::Show(show) )
+ {
+ return FALSE;
+ }
+
+ // TODO:
+ /*
+ ::ShowWindow((HWND)m_hwndBuddy, show ? SW_SHOW : SW_HIDE);
+ */
+ return TRUE;
+}
+
+bool wxSpinCtrl::Enable(bool enable)
+{
+ if ( !wxControl::Enable(enable) )
+ {
+ return FALSE;
+ }
+
+ // TODO:
+ /*
+ ::EnableWindow((HWND)m_hwndBuddy, enable);
+ */
+ return TRUE;
+}
+
+// ----------------------------------------------------------------------------
+// event processing
+// ----------------------------------------------------------------------------
+
+void wxSpinCtrl::OnSpinChange(wxSpinEvent& eventSpin)
+{
+ wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, GetId());
+ event.SetEventObject(this);
+ event.SetInt(eventSpin.GetPosition());
+
+ (void)GetEventHandler()->ProcessEvent(event);
+
+ if ( eventSpin.GetSkipped() )
+ {
+ event.Skip();
+ }
+}
+