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__
// ---------------------------------------------------------------------------
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:
#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);
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;
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
// ---------------------------------------------------------------------------