]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/spinctrl.cpp
new module def file for .dll build
[wxWidgets.git] / src / os2 / spinctrl.cpp
index 516ee8f9cb1c504cb645962971ad2a585dca2b10..d526cfa43f47d5f62ef667e6eb06866319cc15c6 100644 (file)
@@ -178,7 +178,12 @@ bool wxSpinCtrl::Create(
     m_hWndBuddy = m_hWnd; // One in the same for OS/2
     if(pParent)
         pParent->AddChild((wxSpinButton *)this);
-    SetFont(pParent->GetFont());
+    wxFont*                          pTextFont = new wxFont( 10
+                                                            ,wxMODERN
+                                                            ,wxNORMAL
+                                                            ,wxNORMAL
+                                                           );
+    SetFont(*pTextFont);
     ::WinQueryWindowPos(m_hWnd, &vSwp);
     SetXComp(vSwp.x);
     SetYComp(vSwp.y);
@@ -200,6 +205,7 @@ bool wxSpinCtrl::Create(
     ::WinSetWindowULong(GetHwnd(), QWL_USER, (LONG)this);
     fnWndProcSpinCtrl = (WXFARPROC)::WinSubclassWindow(m_hWnd, (PFNWP)wxSpinCtrlWndProc);
     m_svAllSpins.Add(this);
+    delete pTextFont;
     return TRUE;
 } // end of wxSpinCtrl::Create
 
@@ -331,8 +337,8 @@ int wxSpinCtrl::GetValue() const
                                ,SPBQ_UPDATEIFVALID
                               )
                 );
-    lVal - atol(zVal);
-    return lVal;
+    lVal = atol(zVal);
+    return (int)lVal;
 } // end of wxSpinCtrl::GetValue
 
 void wxSpinCtrl::OnChar (
@@ -482,4 +488,20 @@ bool wxSpinCtrl::Show(
     return TRUE;
 } // end of wxSpinCtrl::Show
 
-#endif //wxUSE_SPINBTN
\ No newline at end of file
+void wxSpinCtrl::SetSelection (
+  long                              lFrom
+, long                              lTo
+)
+{
+    //
+    // If from and to are both -1, it means (in wxWindows) that all text should
+    // be selected - translate into Windows convention
+    //
+    if ((lFrom == -1) && (lTo == -1))
+    {
+        lFrom = 0;
+    }
+    ::WinSendMsg(m_hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lFrom, (USHORT)lTo), (MPARAM)0);
+} // end of wxSpinCtrl::SetSelection
+
+#endif //wxUSE_SPINBTN