]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/msw/window.h
Add wxSize::IncBy() and DecBy() overloads taking wxPoint.
[wxWidgets.git] / include / wx / msw / window.h
index c4670e733689a610ade7385d52c10878e12ab06f..33b4354107859885c4653756466d2dcd0a781b68 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef _WX_WINDOW_H_
 #define _WX_WINDOW_H_
 
+#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
 // different behaviour than the old code so we keep the possibility to use it
@@ -232,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;
 
@@ -402,16 +395,31 @@ 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
+    {
+        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()
@@ -430,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,
@@ -554,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();