add full 32 bit range support to wxSpinButton/Ctrl

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-05-26 12:19:53 +00:00
parent dea077b164
commit 3d9fe7b26d
2 changed files with 37 additions and 13 deletions

View File

@@ -177,6 +177,8 @@ wxMSW:
- improvements to wxWindows applications behaviour when the system colours
are changed
- fixed wxProgressDialog for ranges > 65535
- wxSpinButton and wxSpinCtrl now support full 32 bit range (if the version
of comctl32.dll installed on the system supports it)
- wxFontEnumerator now returns all fonts, not only TrueType ones
- bugs in handling wxFrame styles (border/caption related) fixed
- showing a dialog from EVT_RADIOBUTTON handler doesn't lead to an infinite

View File

@@ -179,20 +179,52 @@ wxSize wxSpinButton::DoGetBestSize() const
int wxSpinButton::GetValue() const
{
#ifdef UDM_GETPOS32
if ( wxTheApp->GetComCtl32Version() >= 580 )
{
// use the full 32 bit range if available
return ::SendMessage(GetHwnd(), UDM_GETPOS32, 0, 0);
}
#endif // UDM_GETPOS32
// we're limited to 16 bit
return (short)LOWORD(::SendMessage(GetHwnd(), UDM_GETPOS, 0, 0));
}
void wxSpinButton::SetValue(int val)
{
::SendMessage(GetHwnd(), UDM_SETPOS, 0, (LPARAM) MAKELONG((short) val, 0));
// wxSpinButtonBase::SetValue(val); -- no, it is pure virtual
#ifdef UDM_SETPOS32
if ( wxTheApp->GetComCtl32Version() >= 580 )
{
// use the full 32 bit range if available
::SendMessage(GetHwnd(), UDM_SETPOS32, 0, val);
}
else // we're limited to 16 bit
#endif // UDM_SETPOS32
{
::SendMessage(GetHwnd(), UDM_SETPOS, 0, MAKELONG((short) val, 0));
}
}
void wxSpinButton::SetRange(int minVal, int maxVal)
{
wxSpinButtonBase::SetRange(minVal, maxVal);
#ifdef UDM_SETRANGE32
if ( wxTheApp->GetComCtl32Version() >= 471 )
{
// use the full 32 bit range if available
::SendMessage(GetHwnd(), UDM_SETRANGE32, minVal, maxVal);
}
else // we're limited to 16 bit
#endif // UDM_SETRANGE32
{
::SendMessage(GetHwnd(), UDM_SETRANGE, 0,
(LPARAM) MAKELONG((short)maxVal, (short)minVal));
}
}
bool wxSpinButton::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
WXWORD pos, WXHWND control)
@@ -214,14 +246,7 @@ bool wxSpinButton::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
bool wxSpinButton::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM *result)
{
#ifndef __GNUWIN32__
#if defined(__BORLANDC__) || defined(__WATCOMC__)
LPNM_UPDOWN lpnmud = (LPNM_UPDOWN)lParam;
#elif defined(__VISUALC__) && (__VISUALC__ >= 1000) && (__VISUALC__ < 1020)
LPNM_UPDOWN lpnmud = (LPNM_UPDOWN)lParam;
#else
LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam;
#endif
if (lpnmud->hdr.hwndFrom != GetHwnd()) // make sure it is the right control
return FALSE;
@@ -237,9 +262,6 @@ bool wxSpinButton::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM *
*result = event.IsAllowed() ? 0 : 1;
return processed;
#else // GnuWin32
return FALSE;
#endif
}
bool wxSpinButton::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD WXUNUSED(id))