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);
::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
,SPBQ_UPDATEIFVALID
)
);
- lVal - atol(zVal);
- return lVal;
+ lVal = atol(zVal);
+ return (int)lVal;
} // end of wxSpinCtrl::GetValue
void wxSpinCtrl::OnChar (
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