/**
Returns the background style of the window.
- The background style can be one of the wxBackgroundStyle.
@see SetBackgroundColour(), GetForegroundColour(),
SetBackgroundStyle(), SetTransparent()
*/
virtual wxBackgroundStyle GetBackgroundStyle() const;
+
/**
Returns the character height for this window.
*/
virtual bool SetBackgroundColour(const wxColour& colour);
/**
- Sets the background style of the window. see GetBackgroundStyle() for
- the description of the possible style values.
+ Sets the background style of the window.
+
+ The default background style is wxBG_STYLE_ERASE which indicates that
+ the window background may be erased in EVT_ERASE_BACKGROUND handler.
+ 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
+ handlers at all to avoid unnecessary generation of erase background
+ events and always let system erase the background. And you should
+ change the background style to wxBG_STYLE_PAINT if you define an
+ EVT_PAINT handler which completely overwrites the window background as
+ in this case erasing it previously, either in EVT_ERASE_BACKGROUND
+ handler or in the system default handler, would result in flicker as
+ the background pixels will be repainted twice every time the window is
+ redrawn. Do ensure that the background is entirely erased by your
+ EVT_PAINT handler in this case however as otherwise garbage may be left
+ on screen.
+
+ Notice that in previous versions of wxWidgets a common way to work
+ around the above mentioned flickering problem was to define an empty
+ EVT_ERASE_BACKGROUND handler. Setting background style to
+ wxBG_STYLE_PAINT is a simpler and more efficient solution to the same
+ problem.
@see SetBackgroundColour(), GetForegroundColour(),
SetTransparent()