after latest changes background of radio buttons _not_ inside the notebook wasn't redrawn at all, fixed this

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-04-11 14:41:36 +00:00
parent ed9c472e11
commit 1a784dfc80
4 changed files with 57 additions and 27 deletions

View File

@@ -146,6 +146,9 @@ protected:
#ifndef __WXWINCE__
virtual WXHRGN MSWGetRegionWithoutChildren();
virtual WXLRESULT MSWWindowProc(WXUINT nMsg,
WXWPARAM wParam,
WXLPARAM lParam);
#endif // __WXWINCE__

View File

@@ -290,7 +290,8 @@ public:
bool HandleDestroy();
bool HandlePaint();
bool HandleEraseBkgnd(WXHDC pDC);
bool HandlePrintClient(WXHDC hDC);
bool HandleEraseBkgnd(WXHDC hDC);
bool HandleMinimize();
bool HandleMaximize();

View File

@@ -667,6 +667,30 @@ WXHRGN wxRadioBox::MSWGetRegionWithoutChildren()
return (WXHRGN)hrgn;
}
WXLRESULT
wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
if ( nMsg == WM_PRINTCLIENT )
{
// we have to process WM_PRINTCLIENT ourselves as otherwise the radio
// buttons background would never be drawn unless we have a parent with
// non default background
// so check first if we have one
if ( !HandlePrintClient((WXHDC)wParam) )
{
// no, we don't, erase the background ourselves (don't use our own
// colour as with static box, see comments there)
wxFillRect(GetHwnd(), (HDC)wParam,
GetHbrushOf(wxBrush(GetParent()->GetBackgroundColour())));
}
return 0;
}
return wxStaticBox::MSWWindowProc(nMsg, wParam, lParam);
}
#endif // __WXWINCE__
// ---------------------------------------------------------------------------

View File

@@ -2319,30 +2319,7 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
break;
case WM_PRINTCLIENT:
// we receive this message when DrawThemeParentBackground() is
// called from def window proc of several controls under XP and we
// must draw properly themed background here
//
// note that naively I'd expect filling the client rect with the
// brush returned by MSWGetBgBrush() work -- but for some reason it
// doesn't and we have to call parents MSWPrintChild() which is
// supposed to call DrawThemeBackground() with appropriate params
//
// also note that in this case lParam == PRF_CLIENT but we're
// clearly expected to paint the background and nothing else!
{
for ( wxWindow *win = GetParent(); win; win = win->GetParent() )
{
if ( win->MSWPrintChild((WXHDC)wParam, (wxWindow *)this) )
{
processed = true;
break;
}
if ( win->IsTopLevel() || win->InheritsBackgroundColour() )
break;
}
}
processed = HandlePrintClient((WXHDC)wParam);
break;
case WM_PAINT:
@@ -3715,7 +3692,7 @@ bool wxWindowMSW::HandleDisplayChange()
#ifndef __WXMICROWIN__
bool wxWindowMSW::HandleCtlColor(WXHBRUSH *brush, WXHDC pDC, WXHWND hWnd)
bool wxWindowMSW::HandleCtlColor(WXHBRUSH *brush, WXHDC hDC, WXHWND hWnd)
{
#if !wxUSE_CONTROLS || defined(__WXUNIVERSAL__)
wxUnusedVar(pDC);
@@ -3724,7 +3701,7 @@ bool wxWindowMSW::HandleCtlColor(WXHBRUSH *brush, WXHDC pDC, WXHWND hWnd)
wxControl *item = wxDynamicCast(FindItemByHWND(hWnd, true), wxControl);
if ( item )
*brush = item->MSWControlColor(pDC, hWnd);
*brush = item->MSWControlColor(hDC, hWnd);
else
#endif // wxUSE_CONTROLS
*brush = NULL;
@@ -4062,6 +4039,31 @@ WXHBRUSH wxWindowMSW::MSWGetBgBrush(WXHDC hDC, WXHWND hWndToPaint)
return 0;
}
bool wxWindowMSW::HandlePrintClient(WXHDC hDC)
{
// we receive this message when DrawThemeParentBackground() is
// called from def window proc of several controls under XP and we
// must draw properly themed background here
//
// note that naively I'd expect filling the client rect with the
// brush returned by MSWGetBgBrush() work -- but for some reason it
// doesn't and we have to call parents MSWPrintChild() which is
// supposed to call DrawThemeBackground() with appropriate params
//
// also note that in this case lParam == PRF_CLIENT but we're
// clearly expected to paint the background and nothing else!
for ( wxWindow *win = GetParent(); win; win = win->GetParent() )
{
if ( win->MSWPrintChild(hDC, (wxWindow *)this) )
return true;
if ( win->IsTopLevel() || win->InheritsBackgroundColour() )
break;
}
return false;
}
// ---------------------------------------------------------------------------
// moving and resizing
// ---------------------------------------------------------------------------