Fixed MSWClipBoxRegion
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2426,6 +2426,7 @@ typedef void * WXHBRUSH;
|
|||||||
typedef void * WXHPALETTE;
|
typedef void * WXHPALETTE;
|
||||||
typedef void * WXHCURSOR;
|
typedef void * WXHCURSOR;
|
||||||
typedef void * WXHRGN;
|
typedef void * WXHRGN;
|
||||||
|
typedef void * WXRECTPTR;
|
||||||
typedef void * WXHACCEL;
|
typedef void * WXHACCEL;
|
||||||
typedef void WXFAR * WXHINSTANCE;
|
typedef void WXFAR * WXHINSTANCE;
|
||||||
typedef void * WXHBITMAP;
|
typedef void * WXHBITMAP;
|
||||||
|
@@ -49,7 +49,7 @@ protected:
|
|||||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
|
|
||||||
virtual WXHRGN MSWCalculateClippingRegion();
|
virtual WXHRGN MSWCalculateClippingRegion();
|
||||||
virtual void MSWClipBoxRegion(HRGN hrgn, const RECT *rc);
|
virtual void MSWClipBoxRegion(WXHRGN hrgn, const WXRECTPTR rc);
|
||||||
void OnPaint(wxPaintEvent& event);
|
void OnPaint(wxPaintEvent& event);
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticBox)
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticBox)
|
||||||
|
@@ -199,28 +199,28 @@ void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// rc must be in client coords!
|
// rc must be in client coords!
|
||||||
void wxStaticBox::MSWClipBoxRegion(HRGN hrgn, const RECT *rc)
|
void wxStaticBox::MSWClipBoxRegion(WXHRGN hrgn, const WXRECTPTR rc)
|
||||||
{
|
{
|
||||||
HRGN hrgnchild;
|
HRGN hrgnchild;
|
||||||
|
|
||||||
// top
|
// top
|
||||||
hrgnchild = ::CreateRectRgn(0, 0, rc->right, 14);
|
hrgnchild = ::CreateRectRgn(0, 0, ((const RECT*) rc)->right, 14);
|
||||||
::CombineRgn(hrgn, hrgn, hrgnchild, RGN_DIFF);
|
::CombineRgn((HRGN) hrgn, (HRGN) hrgn, hrgnchild, RGN_DIFF);
|
||||||
::DeleteObject(hrgnchild);
|
::DeleteObject(hrgnchild);
|
||||||
|
|
||||||
// bottom
|
// bottom
|
||||||
hrgnchild = ::CreateRectRgn(0, rc->bottom - 7, rc->right, rc->bottom);
|
hrgnchild = ::CreateRectRgn(0, ((const RECT*) rc)->bottom - 7, ((const RECT*) rc)->right, ((const RECT*) rc)->bottom);
|
||||||
::CombineRgn(hrgn, hrgn, hrgnchild, RGN_DIFF);
|
::CombineRgn((HRGN) hrgn, (HRGN) hrgn, hrgnchild, RGN_DIFF);
|
||||||
::DeleteObject(hrgnchild);
|
::DeleteObject(hrgnchild);
|
||||||
|
|
||||||
// left
|
// left
|
||||||
hrgnchild = ::CreateRectRgn(0, 0, 7, rc->bottom);
|
hrgnchild = ::CreateRectRgn(0, 0, 7, ((const RECT*) rc)->bottom);
|
||||||
::CombineRgn(hrgn, hrgn, hrgnchild, RGN_DIFF);
|
::CombineRgn((HRGN) hrgn, (HRGN) hrgn, hrgnchild, RGN_DIFF);
|
||||||
::DeleteObject(hrgnchild);
|
::DeleteObject(hrgnchild);
|
||||||
|
|
||||||
// right
|
// right
|
||||||
hrgnchild = ::CreateRectRgn(rc->right - 7, 0, rc->right, rc->bottom);
|
hrgnchild = ::CreateRectRgn(((const RECT*) rc)->right - 7, 0, ((const RECT*) rc)->right, ((const RECT*) rc)->bottom);
|
||||||
::CombineRgn(hrgn, hrgn, hrgnchild, RGN_DIFF);
|
::CombineRgn((HRGN) hrgn, (HRGN) hrgn, hrgnchild, RGN_DIFF);
|
||||||
::DeleteObject(hrgnchild);
|
::DeleteObject(hrgnchild);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,7 +308,7 @@ void wxStaticBox::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
// paint the inner
|
// paint the inner
|
||||||
HRGN hrgn = (HRGN)MSWCalculateClippingRegion();
|
HRGN hrgn = (HRGN)MSWCalculateClippingRegion();
|
||||||
// now remove the box itself
|
// now remove the box itself
|
||||||
MSWClipBoxRegion(hrgn, &rc);
|
MSWClipBoxRegion((WXHRGN) hrgn, (const WXRECTPTR) &rc);
|
||||||
|
|
||||||
hbr = DoMSWControlColor(GetHdcOf(dc), wxNullColour);
|
hbr = DoMSWControlColor(GetHdcOf(dc), wxNullColour);
|
||||||
if ( !hbr )
|
if ( !hbr )
|
||||||
|
Reference in New Issue
Block a user