]> git.saurik.com Git - wxWidgets.git/commitdiff
support full 32bit range in wxGauge
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 22 Sep 2003 11:36:48 +0000 (11:36 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 22 Sep 2003 11:36:48 +0000 (11:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23804 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/msw/gauge95.cpp

index f1ddb7ee4ea83d141bea07200e758050a1a69798..af3b8bbe6feedd83896d2a5febe3a7ddc2c410dc 100644 (file)
@@ -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:
 
index 421f8062d7fa0ad43ff078ba636d075a91e640fe..9d8669063f5c617d0a627635961d6a46bb4ad9e9 100644 (file)
@@ -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