]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/spinctrl.cpp
UNICODE-capatable UTF8 implementation of wxStringXXXStream
[wxWidgets.git] / src / os2 / spinctrl.cpp
index d5fb52d270ef35df9f2320d0bd52c86ce99031de..5328a895ea8785189870f3711838049ffc316427 100644 (file)
@@ -31,7 +31,7 @@
     #include "wx/wx.h"
 #endif
 
     #include "wx/wx.h"
 #endif
 
-#if wxUSE_SPINBTN
+#if wxUSE_SPINCTRL
 
 #include "wx/spinctrl.h"
 #include "wx/os2/private.h"
 
 #include "wx/spinctrl.h"
 #include "wx/os2/private.h"
@@ -50,7 +50,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
 
 BEGIN_EVENT_TABLE(wxSpinCtrl, wxSpinButton)
     EVT_CHAR(wxSpinCtrl::OnChar)
 
 BEGIN_EVENT_TABLE(wxSpinCtrl, wxSpinButton)
     EVT_CHAR(wxSpinCtrl::OnChar)
-    EVT_SPIN(-1, wxSpinCtrl::OnSpinChange)
+    EVT_SPIN(wxID_ANY, wxSpinCtrl::OnSpinChange)
     EVT_SET_FOCUS(wxSpinCtrl::OnSetFocus)
 END_EVENT_TABLE()
 // ----------------------------------------------------------------------------
     EVT_SET_FOCUS(wxSpinCtrl::OnSetFocus)
 END_EVENT_TABLE()
 // ----------------------------------------------------------------------------
@@ -73,8 +73,7 @@ MRESULT EXPENTRY wxSpinCtrlWndProc(
     wxSpinCtrl*                    pSpin = (wxSpinCtrl *)::WinQueryWindowULong( hWnd
                                                                                ,QWL_USER
                                                                               );
     wxSpinCtrl*                    pSpin = (wxSpinCtrl *)::WinQueryWindowULong( hWnd
                                                                                ,QWL_USER
                                                                               );
-    bool                            bProccesed = FALSE;
-    MRESULT                         rc = (MRESULT)0;
+
     //
     // Forward some messages (the key ones only so far) to the spin ctrl
     //
     //
     // Forward some messages (the key ones only so far) to the spin ctrl
     //
@@ -133,7 +132,7 @@ bool wxSpinCtrl::Create(
 {
     SWP                             vSwp;
 
 {
     SWP                             vSwp;
 
-    if (vId == -1)
+    if (vId == wxID_ANY)
         m_windowId = NewControlId();
     else
         m_windowId = vId;
         m_windowId = NewControlId();
     else
         m_windowId = vId;
@@ -175,7 +174,7 @@ bool wxSpinCtrl::Create(
                                       );
     if (m_hWnd == 0)
     {
                                       );
     if (m_hWnd == 0)
     {
-        return FALSE;
+        return false;
     }
     m_hWndBuddy = m_hWnd; // One in the same for OS/2
     if(pParent)
     }
     m_hWndBuddy = m_hWnd; // One in the same for OS/2
     if(pParent)
@@ -208,7 +207,7 @@ bool wxSpinCtrl::Create(
     fnWndProcSpinCtrl = (WXFARPROC)::WinSubclassWindow(m_hWnd, (PFNWP)wxSpinCtrlWndProc);
     m_svAllSpins.Add(this);
     delete pTextFont;
     fnWndProcSpinCtrl = (WXFARPROC)::WinSubclassWindow(m_hWnd, (PFNWP)wxSpinCtrlWndProc);
     m_svAllSpins.Add(this);
     delete pTextFont;
-    return TRUE;
+    return true;
 } // end of wxSpinCtrl::Create
 
 wxSize wxSpinCtrl::DoGetBestSize() const
 } // end of wxSpinCtrl::Create
 
 wxSize wxSpinCtrl::DoGetBestSize() const
@@ -302,10 +301,10 @@ bool wxSpinCtrl::Enable(
 {
     if (!wxControl::Enable(bEnable))
     {
 {
     if (!wxControl::Enable(bEnable))
     {
-        return FALSE;
+        return false;
     }
     ::WinEnableWindow(GetHwnd(), bEnable);
     }
     ::WinEnableWindow(GetHwnd(), bEnable);
-    return TRUE;
+    return true;
 } // end of wxSpinCtrl::Enable
 
 wxSpinCtrl* wxSpinCtrl::GetSpinForTextCtrl(
 } // end of wxSpinCtrl::Enable
 
 wxSpinCtrl* wxSpinCtrl::GetSpinForTextCtrl(
@@ -347,7 +346,7 @@ void wxSpinCtrl::OnChar (
   wxKeyEvent&                       rEvent
 )
 {
   wxKeyEvent&                       rEvent
 )
 {
-    switch (rEvent.KeyCode())
+    switch (rEvent.GetKeyCode())
     {
         case WXK_RETURN:
             {
     {
         case WXK_RETURN:
             {
@@ -456,7 +455,7 @@ bool wxSpinCtrl::ProcessTextCommand(
     //
     // Not processed
     //
     //
     // Not processed
     //
-    return FALSE;
+    return false;
 } // end of wxSpinCtrl::ProcessTextCommand
 
 void wxSpinCtrl::SetFocus()
 } // end of wxSpinCtrl::ProcessTextCommand
 
 void wxSpinCtrl::SetFocus()
@@ -471,14 +470,13 @@ bool wxSpinCtrl::SetFont(
     if (!wxWindowBase::SetFont(rFont))
     {
         // nothing to do
     if (!wxWindowBase::SetFont(rFont))
     {
         // nothing to do
-        return FALSE;
+        return false;
     }
 
     }
 
-    WXHANDLE                        hFont = GetFont().GetResourceHandle();
     wxOS2SetFont( m_hWnd
                  ,rFont
                 );
     wxOS2SetFont( m_hWnd
                  ,rFont
                 );
-    return TRUE;
+    return true;
 } // end of wxSpinCtrl::SetFont
 
 void wxSpinCtrl::SetValue(
 } // end of wxSpinCtrl::SetFont
 
 void wxSpinCtrl::SetValue(
@@ -497,9 +495,9 @@ bool wxSpinCtrl::Show(
 {
     if (!wxControl::Show(bShow))
     {
 {
     if (!wxControl::Show(bShow))
     {
-        return FALSE;
+        return false;
     }
     }
-    return TRUE;
+    return true;
 } // end of wxSpinCtrl::Show
 
 void wxSpinCtrl::SetSelection (
 } // end of wxSpinCtrl::Show
 
 void wxSpinCtrl::SetSelection (
@@ -508,7 +506,7 @@ void wxSpinCtrl::SetSelection (
 )
 {
     //
 )
 {
     //
-    // If from and to are both -1, it means (in wxWindows) that all text should
+    // If from and to are both -1, it means (in wxWidgets) that all text should
     // be selected - translate into Windows convention
     //
     if ((lFrom == -1) && (lTo == -1))
     // be selected - translate into Windows convention
     //
     if ((lFrom == -1) && (lTo == -1))
@@ -518,4 +516,4 @@ void wxSpinCtrl::SetSelection (
     ::WinSendMsg(m_hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lFrom, (USHORT)lTo), (MPARAM)0);
 } // end of wxSpinCtrl::SetSelection
 
     ::WinSendMsg(m_hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lFrom, (USHORT)lTo), (MPARAM)0);
 } // end of wxSpinCtrl::SetSelection
 
-#endif //wxUSE_SPINBTN
+#endif //wxUSE_SPINCTRL