mention wxSystemSettings::GetColour() in wxWindow::SetBackgroundColour() docs

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65115 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2010-07-27 09:21:22 +00:00
parent 6333ffcca0
commit 9b756edd0d

View File

@@ -1633,6 +1633,8 @@ public:
@param colour @param colour
The colour to be used as the background colour; pass The colour to be used as the background colour; pass
wxNullColour to reset to the default colour. wxNullColour to reset to the default colour.
Note that you may want to use wxSystemSettings::GetColour() to retrieve
a suitable colour to use rather than setting an hard-coded one.
@remarks The background colour is usually painted by the default @remarks The background colour is usually painted by the default
wxEraseEvent event handler function under Windows and wxEraseEvent event handler function under Windows and
@@ -1650,32 +1652,32 @@ public:
@see GetBackgroundColour(), SetForegroundColour(), @see GetBackgroundColour(), SetForegroundColour(),
GetForegroundColour(), ClearBackground(), GetForegroundColour(), ClearBackground(),
Refresh(), wxEraseEvent Refresh(), wxEraseEvent, wxSystemSettings
*/ */
virtual bool SetBackgroundColour(const wxColour& colour); virtual bool SetBackgroundColour(const wxColour& colour);
/** /**
Sets the background style of the window. Sets the background style of the window.
The default background style is wxBG_STYLE_ERASE which indicates that The default background style is @c wxBG_STYLE_ERASE which indicates that
the window background may be erased in EVT_ERASE_BACKGROUND handler. the window background may be erased in @c EVT_ERASE_BACKGROUND handler.
This is a safe, compatibility default; however you may want to change it This is a safe, compatibility default; however you may want to change it
to wxBG_STYLE_SYSTEM if you don't define any erase background event to @c wxBG_STYLE_SYSTEM if you don't define any erase background event
handlers at all, to avoid unnecessary generation of erase background handlers at all, to avoid unnecessary generation of erase background
events and always let system erase the background. And you should events and always let system erase the background. And you should
change the background style to wxBG_STYLE_PAINT if you define an change the background style to @c wxBG_STYLE_PAINT if you define an
EVT_PAINT handler which completely overwrites the window background as @c EVT_PAINT handler which completely overwrites the window background as
in this case erasing it previously, either in EVT_ERASE_BACKGROUND in this case erasing it previously, either in @c EVT_ERASE_BACKGROUND
handler or in the system default handler, would result in flicker as handler or in the system default handler, would result in flicker as
the background pixels will be repainted twice every time the window is the background pixels will be repainted twice every time the window is
redrawn. Do ensure that the background is entirely erased by your redrawn. Do ensure that the background is entirely erased by your
EVT_PAINT handler in this case however as otherwise garbage may be left @c EVT_PAINT handler in this case however as otherwise garbage may be left
on screen. on screen.
Notice that in previous versions of wxWidgets a common way to work Notice that in previous versions of wxWidgets a common way to work
around the above mentioned flickering problem was to define an empty around the above mentioned flickering problem was to define an empty
EVT_ERASE_BACKGROUND handler. Setting background style to @c EVT_ERASE_BACKGROUND handler. Setting background style to
wxBG_STYLE_PAINT is a simpler and more efficient solution to the same @c wxBG_STYLE_PAINT is a simpler and more efficient solution to the same
problem. problem.
@see SetBackgroundColour(), GetForegroundColour(), @see SetBackgroundColour(), GetForegroundColour(),