X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a5b1be33b7c93a69932d080fd544176bd9220615..a8a3ccb853083fef8c96ba7cb422790a8852dbde:/include/wx/msw/window.h diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index a65fa4910a..33b4354107 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -13,7 +13,7 @@ #ifndef _WX_WINDOW_H_ #define _WX_WINDOW_H_ -enum wxSystemColour; +#include "wx/settings.h" // solely for wxSystemColour // if this is set to 1, we use deferred window sizing to reduce flicker when // resizing complicated window hierarchies, but this can in theory result in @@ -234,15 +234,6 @@ public: // created yet) void MSWUpdateStyle(long flagsOld, long exflagsOld); - // translate wxWidgets coords into Windows ones suitable to be passed to - // ::CreateWindow() - // - // returns true if non default coords are returned, false otherwise - bool MSWGetCreateWindowCoords(const wxPoint& pos, - const wxSize& size, - int& x, int& y, - int& w, int& h) const; - // get the HWND to be used as parent of this window with CreateWindow() virtual WXHWND MSWGetParent() const; @@ -404,16 +395,16 @@ public: // 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 + // 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 - // quering the parent windows via their MSWGetBgBrushForChild() recursively - WXHBRUSH MSWGetBgBrush(WXHDC hDC) { return MSWGetBgBrush(hDC, this); } - WXHBRUSH MSWGetBgBrush(WXHDC hDC, wxWindowMSW *child); + // querying the parent windows via MSWGetBgBrushForChild() recursively + WXHBRUSH MSWGetBgBrush(WXHDC hDC); enum MSWThemeColour { @@ -428,7 +419,7 @@ public: int themePart, int themeState, MSWThemeColour themeColour, - wxSystemColour fallback); + 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() @@ -447,6 +438,27 @@ public: return true; } +#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, @@ -571,6 +583,13 @@ protected: // for state as the system will decide for us what needs to be set void MSWUpdateUIState(int action, int state = 0); + // translate wxWidgets coords into Windows ones suitable to be passed to + // ::CreateWindow(), called from MSWCreate() + virtual void MSWGetCreateWindowCoords(const wxPoint& pos, + const wxSize& size, + int& x, int& y, + int& w, int& h) const; + private: // common part of all ctors void Init();