]> git.saurik.com Git - wxWidgets.git/commitdiff
First step in background erase optimization
authorJulian Smart <julian@anthemion.co.uk>
Sun, 29 Aug 2004 10:22:34 +0000 (10:22 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 29 Aug 2004 10:22:34 +0000 (10:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28951 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/window.tex
include/wx/defs.h
include/wx/window.h
src/common/wincmn.cpp

index 12745281a313f55c76d14884fb0e65a15de7a13a..eb5af0361b7f1e2715c7801a5288a3156c19f160 100644 (file)
@@ -700,6 +700,23 @@ Returns the background colour of the window.
 \helpref{wxWindow::SetForegroundColour}{wxwindowsetforegroundcolour},\rtfsp
 \helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour}
 
+\membersection{wxWindow::GetBackgroundStyle}\label{wxwindowgetbackgroundstyle}
+
+\constfunc{virtual wxBackgroundStyle}{GetBackgroundStyle}{\void}
+
+Returns the background style of the window. The background style indicates
+whether background colour should be determined by the system (wxBG\_STYLE\_SYSTEM),
+be set to a specific colour (wxBG\_STYLE\_COLOUR), or should be left to the
+application to implement (wxBG\_STYLE\_CUSTOM).
+
+On GTK+, use of wxBG\_STYLE\_CUSTOM allows the flicker-free drawing of a custom
+background, such as a tiled bitmap. Currently the style has no effect on other platforms.
+
+\wxheading{See also}
+
+\helpref{wxWindow::SetBackgroundColour}{wxwindowsetbackgroundcolour},\rtfsp
+\helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour},\rtfsp
+\helpref{wxWindow::SetBackgroundStyle}{wxwindowsetbackgroundstyle}
 
 \membersection{wxWindow::GetBestFittingSize}\label{wxwindowgetbestfittingsize}
 
@@ -2431,6 +2448,24 @@ applications on the system.
 \helpref{wxWindow::Refresh}{wxwindowrefresh},\rtfsp
 \helpref{wxEraseEvent}{wxeraseevent}
 
+\membersection{wxWindow::SetBackgroundStyle}\label{wxwindowsetbackgroundstyle}
+
+\func{virtual void}{SetBackgroundStyle}{\param{wxBackgroundStyle}{ style}}
+
+Sets the background style of the window. The background style indicates
+whether background colour should be determined by the system (wxBG\_STYLE\_SYSTEM),
+be set to a specific colour (wxBG\_STYLE\_COLOUR), or should be left to the
+application to implement (wxBG\_STYLE\_CUSTOM).
+
+On GTK+, use of wxBG\_STYLE\_CUSTOM allows the flicker-free drawing of a custom
+background, such as a tiled bitmap. Currently the style has no effect on other platforms.
+
+\wxheading{See also}
+
+\helpref{wxWindow::SetBackgroundColour}{wxwindowsetbackgroundcolour},\rtfsp
+\helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour},\rtfsp
+\helpref{wxWindow::GetBackgroundStyle}{wxwindowgetbackgroundstyle}
+
 
 \membersection{wxWindow::SetBestFittingSize}\label{wxwindowsetbestfittingsize}
 
index 354fe9842bbba91c466f5128a1b4b77ec0619af5..1fde19526879b76b6eca09231e04cd1cebe09035 100644 (file)
@@ -1405,6 +1405,17 @@ enum wxBorder
 #define  wxMORE                 0x00010000
 #define  wxSETUP                0x00020000
 
+/*
+ * Background styles. See wxWindow::SetBackgroundStyle
+ */
+
+enum wxBackgroundStyle
+{
+  wxBG_STYLE_SYSTEM,
+  wxBG_STYLE_COLOUR,
+  wxBG_STYLE_CUSTOM
+};
+
 /*  ---------------------------------------------------------------------------- */
 /*  standard IDs */
 /*  ---------------------------------------------------------------------------- */
index dd75d380eebf613a52112e1be907c852a9789471..a407cbbb047351de936e19a145be519d776d0f83 100644 (file)
@@ -751,6 +751,11 @@ public:
     }
     wxColour GetForegroundColour() const;
 
+        // Set/get the background style.
+        // Pass one of wxBG_STYLE_SYSTEM, wxBG_STYLE_COLOUR, wxBG_STYLE_CUSTOM
+    virtual bool SetBackgroundStyle(wxBackgroundStyle style) { m_backgroundStyle = style; return true; }
+    virtual wxBackgroundStyle GetBackgroundStyle() const { return m_backgroundStyle; }
+
         // set/retrieve the font for the window (SetFont() returns true if the
         // font really changed)
     virtual bool SetFont(const wxFont& font) = 0;
@@ -1150,7 +1155,7 @@ protected:
                          m_exStyle;
     wxString             m_windowName;
     bool                 m_themeEnabled;
-
+    wxBackgroundStyle    m_backgroundStyle;
 #if wxUSE_PALETTE
     wxPalette            m_palette;
     bool                 m_hasCustomPalette;
index f6551938a2951e12c583f435f4f19c40fe469c47..c4fba2a8abe3bbbe6450409ba0c38725c2c4c53e 100644 (file)
@@ -152,6 +152,8 @@ wxWindowBase::wxWindowBase()
     // no style bits
     m_exStyle =
     m_windowStyle = 0;
+    
+    m_backgroundStyle = wxBG_STYLE_SYSTEM;
 
 #if wxUSE_CONSTRAINTS
     // no constraints whatsoever