From 9a78988fedc6e5364368cd09e60308180d3a7425 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 22 Sep 2003 11:36:48 +0000 Subject: [PATCH] support full 32bit range in wxGauge git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23804 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/msw/gauge95.cpp | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index f1ddb7ee4e..af3b8bbe6f 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -61,6 +61,7 @@ wxMSW: - changed wxCrashReport to generate minidumps instead of text files - wxRadioButtons are now checked when they get focus (standard behaviour) - several fixes to owner drawn menu items (Christian Sturmlechner) +- wxGauge now supports full 32 bit range (Miroslav Rajcic) wxGTK: diff --git a/src/msw/gauge95.cpp b/src/msw/gauge95.cpp index 421f8062d7..9d8669063f 100644 --- a/src/msw/gauge95.cpp +++ b/src/msw/gauge95.cpp @@ -140,7 +140,6 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id, #endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); - m_rangeMax = range; m_gaugePos = 0; m_windowStyle = style; @@ -177,7 +176,7 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id, // Subclass again for purposes of dialog editing mode SubclassWin((WXHWND) wx_button); - SendMessage((HWND) GetHWND(), PBM_SETRANGE, 0, MAKELPARAM(0, range)); + SetRange(range); SetFont(parent->GetFont()); @@ -187,7 +186,7 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id, height = 28; SetSize(x, y, width, height); - ShowWindow((HWND) GetHWND(), SW_SHOW); + ShowWindow(GetHwnd(), SW_SHOW); return TRUE; } @@ -204,14 +203,19 @@ void wxGauge95::SetRange(int r) { m_rangeMax = r; - SendMessage((HWND) GetHWND(), PBM_SETRANGE, 0, MAKELPARAM(0, r)); +#ifdef PBM_SETRANGE32 + SendMessage(GetHwnd(), PBM_SETRANGE32, 0, r); +#else // !PBM_SETRANGE32 + // fall back to PBM_SETRANGE (limited to 16 bits) + SendMessage(GetHwnd(), PBM_SETRANGE, 0, MAKELPARAM(0, r)); +#endif // PBM_SETRANGE32/!PBM_SETRANGE32 } void wxGauge95::SetValue(int pos) { m_gaugePos = pos; - SendMessage((HWND) GetHWND(), PBM_SETPOS, pos, 0); + SendMessage(GetHwnd(), PBM_SETPOS, pos, 0); } int wxGauge95::GetShadowWidth() const -- 2.45.2