// Purpose: interface of wxWindow
// Author: wxWidgets team
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
Process scroll events. See wxScrollWinEvent.
@event{EVT_SET_CURSOR(func)}
Process a @c wxEVT_SET_CURSOR event. See wxSetCursorEvent.
- @event{EVT_SHOW(func)}
- Process a @c wxEVT_SHOW event. See wxShowEvent.
@event{EVT_SIZE(func)}
Process a @c wxEVT_SIZE event. See wxSizeEvent.
@event{EVT_SYS_COLOUR_CHANGED(func)}
//@{
/**
- Clears the window by filling it with the current background colour. Does not
- cause an erase background event to be generated.
+ Clears the window by filling it with the current background colour.
+
+ Does not cause an erase background event to be generated.
+
+ Notice that this uses wxClientDC to draw on the window and the results
+ of doing it while also drawing on wxPaintDC for this window are
+ undefined. Hence this method shouldn't be used from EVT_PAINT handlers,
+ just use wxDC::Clear() on the wxPaintDC you already use there instead.
*/
virtual void ClearBackground();
@param colour
The colour to be used as the background colour; pass
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
wxEraseEvent event handler function under Windows and
@see GetBackgroundColour(), SetForegroundColour(),
GetForegroundColour(), ClearBackground(),
- Refresh(), wxEraseEvent
+ Refresh(), wxEraseEvent, wxSystemSettings
*/
virtual bool SetBackgroundColour(const wxColour& colour);
/**
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.
+ The default background style is @c wxBG_STYLE_ERASE which indicates that
+ 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
- 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
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
+ change the background style to @c wxBG_STYLE_PAINT if you define an
+ @c EVT_PAINT handler which completely overwrites the window background as
+ in this case erasing it previously, either in @c 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
+ @c 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
+ @c EVT_ERASE_BACKGROUND handler. Setting background style to
+ @c wxBG_STYLE_PAINT is a simpler and more efficient solution to the same
problem.
@see SetBackgroundColour(), GetForegroundColour(),
for a top level window if you want to bring it to top, although this is not
needed if Show() is called immediately after the frame creation.
+ Notice that the default state of newly created top level windows is hidden
+ (to allow you to create their contents without flicker) unlike for
+ all the other, not derived from wxTopLevelWindow, windows that
+ are by default created in the shown state.
+
@param show
If @true displays the window. Otherwise, hides it.
The search is recursive in both cases.
@see FindWindow()
+
+ @return Window with the given @a id or @NULL if not found.
*/
static wxWindow* FindWindowById(long id, const wxWindow* parent = 0);
The search is recursive in both cases.
@see FindWindow()
+
+ @return Window with the given @a label or @NULL if not found.
*/
static wxWindow* FindWindowByLabel(const wxString& label,
const wxWindow* parent = 0);
FindWindowByLabel() is called.
@see FindWindow()
+
+ @return Window with the given @a name or @NULL if not found.
*/
static wxWindow* FindWindowByName(const wxString& name,
const wxWindow* parent = 0);