From 2f059e30a1de9f4416d39e7747a6cdd6e39c6c30 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 31 Mar 2005 15:19:14 +0000 Subject: [PATCH] Fixed MSWClipBoxRegion git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 1 + include/wx/msw/statbox.h | 2 +- src/msw/statbox.cpp | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 98646a60dc..39459d328e 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -2426,6 +2426,7 @@ typedef void * WXHBRUSH; typedef void * WXHPALETTE; typedef void * WXHCURSOR; typedef void * WXHRGN; +typedef void * WXRECTPTR; typedef void * WXHACCEL; typedef void WXFAR * WXHINSTANCE; typedef void * WXHBITMAP; diff --git a/include/wx/msw/statbox.h b/include/wx/msw/statbox.h index e222abbeb1..ae0cd5030e 100644 --- a/include/wx/msw/statbox.h +++ b/include/wx/msw/statbox.h @@ -49,7 +49,7 @@ protected: virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); virtual WXHRGN MSWCalculateClippingRegion(); - virtual void MSWClipBoxRegion(HRGN hrgn, const RECT *rc); + virtual void MSWClipBoxRegion(WXHRGN hrgn, const WXRECTPTR rc); void OnPaint(wxPaintEvent& event); DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticBox) diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index 9ad9cb9eb2..ea27a85d60 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -199,28 +199,28 @@ void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const } // rc must be in client coords! -void wxStaticBox::MSWClipBoxRegion(HRGN hrgn, const RECT *rc) +void wxStaticBox::MSWClipBoxRegion(WXHRGN hrgn, const WXRECTPTR rc) { HRGN hrgnchild; // top - hrgnchild = ::CreateRectRgn(0, 0, rc->right, 14); - ::CombineRgn(hrgn, hrgn, hrgnchild, RGN_DIFF); + hrgnchild = ::CreateRectRgn(0, 0, ((const RECT*) rc)->right, 14); + ::CombineRgn((HRGN) hrgn, (HRGN) hrgn, hrgnchild, RGN_DIFF); ::DeleteObject(hrgnchild); // bottom - hrgnchild = ::CreateRectRgn(0, rc->bottom - 7, rc->right, rc->bottom); - ::CombineRgn(hrgn, hrgn, hrgnchild, RGN_DIFF); + hrgnchild = ::CreateRectRgn(0, ((const RECT*) rc)->bottom - 7, ((const RECT*) rc)->right, ((const RECT*) rc)->bottom); + ::CombineRgn((HRGN) hrgn, (HRGN) hrgn, hrgnchild, RGN_DIFF); ::DeleteObject(hrgnchild); // left - hrgnchild = ::CreateRectRgn(0, 0, 7, rc->bottom); - ::CombineRgn(hrgn, hrgn, hrgnchild, RGN_DIFF); + hrgnchild = ::CreateRectRgn(0, 0, 7, ((const RECT*) rc)->bottom); + ::CombineRgn((HRGN) hrgn, (HRGN) hrgn, hrgnchild, RGN_DIFF); ::DeleteObject(hrgnchild); // right - hrgnchild = ::CreateRectRgn(rc->right - 7, 0, rc->right, rc->bottom); - ::CombineRgn(hrgn, hrgn, hrgnchild, RGN_DIFF); + hrgnchild = ::CreateRectRgn(((const RECT*) rc)->right - 7, 0, ((const RECT*) rc)->right, ((const RECT*) rc)->bottom); + ::CombineRgn((HRGN) hrgn, (HRGN) hrgn, hrgnchild, RGN_DIFF); ::DeleteObject(hrgnchild); } @@ -308,7 +308,7 @@ void wxStaticBox::OnPaint(wxPaintEvent& WXUNUSED(event)) // paint the inner HRGN hrgn = (HRGN)MSWCalculateClippingRegion(); // now remove the box itself - MSWClipBoxRegion(hrgn, &rc); + MSWClipBoxRegion((WXHRGN) hrgn, (const WXRECTPTR) &rc); hbr = DoMSWControlColor(GetHdcOf(dc), wxNullColour); if ( !hbr ) -- 2.45.2