Don't clip hidden windows from the staticbox's refresh. Also handle
non wxWindows better. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33617 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -258,19 +258,29 @@ WXHRGN wxStaticBox::MSWGetRegionWithoutChildren()
|
|||||||
child;
|
child;
|
||||||
child = ::GetWindow(child, GW_HWNDNEXT) )
|
child = ::GetWindow(child, GW_HWNDNEXT) )
|
||||||
{
|
{
|
||||||
wxWindow *childWindow = wxGetWindowFromHWND((WXHWND) child);
|
if ( ! ::IsWindowVisible(child) )
|
||||||
|
|
||||||
// can't just test for (this != child) here since if a wxStaticBox
|
|
||||||
// overlaps another wxStaticBox then neither are drawn. The overlapping
|
|
||||||
// region will flicker but we shouldn't have overlapping windows anyway.
|
|
||||||
if ( !childWindow || !wxDynamicCast(childWindow, wxStaticBox) )
|
|
||||||
{
|
{
|
||||||
|
// if the window isn't visible then it doesn't need clipped
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
LONG style = ::GetWindowLong(child, GWL_STYLE);
|
||||||
|
wxString str(wxGetWindowClass(child));
|
||||||
|
str.UpperCase();
|
||||||
|
if ( str == wxT("BUTTON") && (style & BS_GROUPBOX) != 0 )
|
||||||
|
{
|
||||||
|
// Don't clip any static boxes, not just this one. This will
|
||||||
|
// result in flicker in overlapping static boxes, but at least
|
||||||
|
// they will all be drawn correctly and we shouldn't have
|
||||||
|
// overlapping windows anyway.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
::GetWindowRect(child, &rc);
|
::GetWindowRect(child, &rc);
|
||||||
if ( ::RectInRegion(hrgn, &rc) )
|
if ( ::RectInRegion(hrgn, &rc) )
|
||||||
{
|
{
|
||||||
// need to remove WS_CLIPSIBLINGS from all sibling windows
|
// need to remove WS_CLIPSIBLINGS from all sibling windows
|
||||||
// that are within this staticbox if set
|
// that are within this staticbox if set
|
||||||
LONG style = ::GetWindowLong(child, GWL_STYLE);
|
|
||||||
if ( style & WS_CLIPSIBLINGS )
|
if ( style & WS_CLIPSIBLINGS )
|
||||||
{
|
{
|
||||||
style &= ~WS_CLIPSIBLINGS;
|
style &= ~WS_CLIPSIBLINGS;
|
||||||
@@ -288,7 +298,6 @@ WXHRGN wxStaticBox::MSWGetRegionWithoutChildren()
|
|||||||
::CombineRgn(hrgn, hrgn, hrgnChild, RGN_DIFF);
|
::CombineRgn(hrgn, hrgn, hrgnChild, RGN_DIFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return (WXHRGN)hrgn;
|
return (WXHRGN)hrgn;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user