+
+ // Functions dealing with painting the window background. The derived
+ // classes should normally only need to reimplement MSWGetBgBrush() if they
+ // need to use a non-solid brush for erasing their background. This
+ // function is called by MSWGetBgBrushForChild() which only exists for the
+ // weird wxToolBar case and MSWGetBgBrushForChild() itself is used by
+ // MSWGetBgBrush() to actually find the right brush to use.
+
+ // The brush returned from here must remain valid at least until the next
+ // event loop iteration. Returning 0, as is done by default, indicates
+ // there is no custom background brush.
+ virtual WXHBRUSH MSWGetCustomBgBrush() { return 0; }
+
+ // this function should return the brush to paint the children controls
+ // background or 0 if this window doesn't impose any particular background
+ // on its children
+ //
+ // the hDC parameter is the DC background will be drawn on, it can be used
+ // to call SetBrushOrgEx() on it if the returned brush is a bitmap one
+ //
+ // child parameter is never NULL, it can be this window itself or one of
+ // its (grand)children
+ //
+ // the base class version returns a solid brush if we have a non default
+ // background colour or 0 otherwise
+ virtual WXHBRUSH MSWGetBgBrushForChild(WXHDC hDC, wxWindowMSW *child);
+
+ // return the background brush to use for painting the given window by
+ // querying the parent windows via MSWGetBgBrushForChild() recursively
+ WXHBRUSH MSWGetBgBrush(WXHDC hDC);
+
+ enum MSWThemeColour
+ {
+ ThemeColourText = 0,
+ ThemeColourBackground,
+ ThemeColourBorder
+ };
+
+ // returns a specific theme colour, or if that is not possible then
+ // wxSystemSettings::GetColour(fallback)
+ wxColour MSWGetThemeColour(const wchar_t *themeName,
+ int themePart,
+ int themeState,
+ MSWThemeColour themeColour,
+ wxSystemColour fallback) const;
+
+ // gives the parent the possibility to draw its children background, e.g.
+ // this is used by wxNotebook to do it using DrawThemeBackground()
+ //
+ // return true if background was drawn, false otherwise
+ virtual bool MSWPrintChild(WXHDC WXUNUSED(hDC), wxWindow * WXUNUSED(child))
+ {
+ return false;
+ }
+
+ // some controls (e.g. wxListBox) need to set the return value themselves
+ //
+ // return true to let parent handle it if we don't, false otherwise
+ virtual bool MSWShouldPropagatePrintChild()
+ {
+ return true;
+ }
+
+ // This should be overridden to return true for the controls which have
+ // themed background that should through their children. Currently only
+ // wxNotebook uses this.
+ virtual bool MSWHasInheritableBackground() const { return false; }
+
+#if !defined(__WXWINCE__) && !defined(__WXUNIVERSAL__)
+ #define wxHAS_MSW_BACKGROUND_ERASE_HOOK
+#endif
+
+#ifdef wxHAS_MSW_BACKGROUND_ERASE_HOOK
+ // allows the child to hook into its parent WM_ERASEBKGND processing: call
+ // MSWSetEraseBgHook() with a non-NULL window to make parent call
+ // MSWEraseBgHook() on this window (don't forget to reset it to NULL
+ // afterwards)
+ //
+ // this hack is used by wxToolBar, see comments there
+ void MSWSetEraseBgHook(wxWindow *child);
+
+ // return true if WM_ERASEBKGND is currently hooked
+ bool MSWHasEraseBgHook() const;
+
+ // called when the window on which MSWSetEraseBgHook() had been called
+ // receives WM_ERASEBKGND
+ virtual bool MSWEraseBgHook(WXHDC WXUNUSED(hDC)) { return false; }
+#endif // wxHAS_MSW_BACKGROUND_ERASE_HOOK
+
+ // common part of Show/HideWithEffect()
+ bool MSWShowWithEffect(bool show,
+ wxShowEffect effect,
+ unsigned timeout);