X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/debe6624c1e9d4bf3243381153d1e173c849bcd8..20e85460c40ebc4dcc9577928771adb264cc998f:/src/msw/gauge95.cpp diff --git a/src/msw/gauge95.cpp b/src/msw/gauge95.cpp index 7fbe861c1d..d287e72444 100644 --- a/src/msw/gauge95.cpp +++ b/src/msw/gauge95.cpp @@ -24,12 +24,12 @@ #include "wx/defs.h" #endif -#if USE_GAUGE && defined(__WIN95__) +#if wxUSE_GAUGE && defined(__WIN95__) #include "wx/msw/gauge95.h" #include "wx/msw/private.h" -#if defined(__WIN95__) && !defined(__GNUWIN32__) +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) #include #endif @@ -50,9 +50,10 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id, if (parent) parent->AddChild(this); m_rangeMax = range; + m_gaugePos = 0; - SetBackgroundColour(parent->GetDefaultBackgroundColour()) ; - SetForegroundColour(parent->GetDefaultForegroundColour()) ; + SetBackgroundColour(parent->GetBackgroundColour()) ; + SetForegroundColour(parent->GetForegroundColour()) ; m_windowStyle = style; @@ -80,12 +81,12 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id, SendMessage((HWND) GetHWND(), PBM_SETRANGE, 0, MAKELPARAM(0, range)); - SetFont(* parent->GetFont()); + SetFont(parent->GetFont()); if (width == -1) width = 50; if (height == -1) - height = 50; + height = 28; SetSize(x, y, width, height); ShowWindow((HWND) GetHWND(), SW_SHOW); @@ -93,7 +94,7 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id, return TRUE; } -void wxGauge95::SetSize(int x, int y, int width, int height, int sizeFlags) +void wxGauge95::DoSetSize(int x, int y, int width, int height, int sizeFlags) { int currentX, currentY; GetPosition(¤tX, ¤tY); @@ -107,6 +108,8 @@ void wxGauge95::SetSize(int x, int y, int width, int height, int sizeFlags) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) y1 = currentY; + AdjustForParentClientOrigin(x1, y1, sizeFlags); + // If we're prepared to use the existing size, then... if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO)) { @@ -175,4 +178,4 @@ void wxGauge95::SetBackgroundColour(const wxColour& col) m_backgroundColour = col ; } -#endif // USE_GAUGE +#endif // wxUSE_GAUGE