added MSWPrintChild() for drawing child background (replaces patch 1108389)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32208 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -212,6 +212,9 @@ protected:
|
|||||||
|
|
||||||
// creates the brush to be used for drawing the tab control background
|
// creates the brush to be used for drawing the tab control background
|
||||||
void UpdateBgBrush();
|
void UpdateBgBrush();
|
||||||
|
|
||||||
|
// paint themed children background here
|
||||||
|
virtual bool MSWPrintChild(wxWindow *win, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
#endif // wxUSE_UXTHEME
|
#endif // wxUSE_UXTHEME
|
||||||
|
|
||||||
// the current selection (-1 if none)
|
// the current selection (-1 if none)
|
||||||
|
@@ -398,6 +398,16 @@ public:
|
|||||||
// windows via their MSWGetBgBrushForChild() recursively
|
// windows via their MSWGetBgBrushForChild() recursively
|
||||||
WXHBRUSH MSWGetBgBrush(WXHDC hDC);
|
WXHBRUSH MSWGetBgBrush(WXHDC hDC);
|
||||||
|
|
||||||
|
// overriding this method gives the parent window the opportunity to
|
||||||
|
// process WM_PRINTCLIENT for its children: this is currently used by
|
||||||
|
// wxNotebook to draw themed background for them
|
||||||
|
//
|
||||||
|
// return true if the message was processed or false to use default logic
|
||||||
|
// for it (currently this means handling it just as WM_PAINT i.e. render
|
||||||
|
// the control into the provided DC)
|
||||||
|
virtual bool MSWPrintChild(wxWindow *win, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
|
|
||||||
|
|
||||||
// Responds to colour changes: passes event on to children.
|
// Responds to colour changes: passes event on to children.
|
||||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||||
|
|
||||||
|
@@ -1002,6 +1002,33 @@ wxColour wxNotebook::MSWGetBgColourForChild(wxWindow *win)
|
|||||||
return c == CLR_INVALID ? wxNullColour : wxRGBToColour(c);
|
return c == CLR_INVALID ? wxNullColour : wxRGBToColour(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
wxNotebook::MSWPrintChild(wxWindow *win,
|
||||||
|
WXWPARAM wParam,
|
||||||
|
WXLPARAM WXUNUSED(lParam))
|
||||||
|
{
|
||||||
|
RECT rc;
|
||||||
|
::GetClientRect(GetHwnd(), &rc);
|
||||||
|
TabCtrl_AdjustRect(GetHwnd(), true, &rc);
|
||||||
|
::MapWindowPoints(GetHwnd(), GetHwndOf(win), (POINT *)&rc, 2);
|
||||||
|
|
||||||
|
wxUxThemeHandle theme(win, L"TAB");
|
||||||
|
if ( theme )
|
||||||
|
{
|
||||||
|
wxUxThemeEngine::Get()->DrawThemeBackground
|
||||||
|
(
|
||||||
|
theme,
|
||||||
|
(WXHDC)wParam,
|
||||||
|
9 /* TABP_PANE */,
|
||||||
|
0,
|
||||||
|
&rc,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // wxUSE_UXTHEME
|
#endif // wxUSE_UXTHEME
|
||||||
|
|
||||||
// Windows only: attempts to get colour for UX theme page background
|
// Windows only: attempts to get colour for UX theme page background
|
||||||
|
@@ -2312,12 +2312,21 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WM_PRINT
|
#ifdef WM_PRINT
|
||||||
|
case WM_PRINTCLIENT:
|
||||||
|
if ( GetParent() &&
|
||||||
|
GetParent()->MSWPrintChild(this, wParam, lParam) )
|
||||||
|
{
|
||||||
|
processed = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case WM_PRINT:
|
case WM_PRINT:
|
||||||
{
|
{
|
||||||
if ( lParam & PRF_ERASEBKGND )
|
if ( lParam & PRF_ERASEBKGND )
|
||||||
HandleEraseBkgnd((WXHDC)(HDC)wParam);
|
HandleEraseBkgnd((WXHDC)(HDC)wParam);
|
||||||
|
|
||||||
wxPaintDCEx dc((wxWindow *)this, (WXHDC)wParam);
|
wxPaintDCEx dc((wxWindow *)this, (WXHDC)wParam);
|
||||||
|
|
||||||
processed = HandlePaint();
|
processed = HandlePaint();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -4035,6 +4044,14 @@ WXHBRUSH wxWindowMSW::MSWGetBgBrush(WXHDC hDC)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
wxWindowMSW::MSWPrintChild(wxWindow * WXUNUSED(win),
|
||||||
|
WXWPARAM WXUNUSED(wParam),
|
||||||
|
WXLPARAM WXUNUSED(lParam))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// moving and resizing
|
// moving and resizing
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user