Please note that all children of the window will be deleted automatically by
the destructor before the window itself is deleted which means that you don't
have to worry about deleting them manually. Please see the @ref
- overview_windowdeletionoverview "window
- deletion overview" for more information.
+ overview_windowdeletion "window deletion overview" for more information.
Also note that in this, and many others, wxWidgets classes some
@c GetXXX() methods may be overloaded (as, for example,
- wxWindow::GetSize or
- wxWindow::GetClientSize). In this case, the overloads
+ wxWindow::GetSize or wxWindow::GetClientSize). In this case, the overloads
are non-virtual because having multiple virtual functions with the same name
results in a virtual function name hiding at the derived class level (in
English, this means that the derived class has to override all overloaded
@library{wxcore}
@category{FIXME}
- @see @ref overview_eventhandlingoverview, @ref overview_windowsizingoverview
- "Window sizing overview"
+ @see @ref overview_eventhandling "Event handling overview",
+ @ref overview_windowsizing "Window sizing overview"
*/
class wxWindow : public wxEvtHandler
{
public:
- //@{
+ /**
+ Default constructor
+ */
+ wxWindow();
+
/**
Constructs a window, which can be a child of a frame, dialog or any other
non-control window.
@param name
Window name.
*/
- wxWindow();
wxWindow(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
- //@}
/**
Destructor. Deletes all sub-windows, then deletes itself. Instead of using
@see AcceptsFocusFromKeyboard()
*/
- bool AcceptsFocus() const;
+ virtual bool AcceptsFocus() const;
/**
This method may be overridden in the derived classes to return @false to
clicks it with the mouse, it shouldn't be included in the TAB traversal chain
when using the keyboard.
*/
- bool AcceptsFocusFromKeyboard() const;
+ virtual bool AcceptsFocusFromKeyboard() const;
+ /**
+ Overridden to indicate wehter this window or one of its children accepts
+ focus. Usually it's the same as AcceptsFocus() but is overridden for
+ container windows
+ */
+ virtual bool AcceptsFocusRecursively() const;
+
/**
Adds a child window. This is called automatically by window creation
functions so should not be required by the application programmer.
@param pt
The client position for the second form of the function.
*/
- virtual void ClientToScreen(int* x, int* y) const;
- const virtual wxPoint ClientToScreen(const wxPoint& pt) const;
+ void ClientToScreen(int* x, int* y) const;
+ wxPoint ClientToScreen(const wxPoint& pt) const;
//@}
/**
*/
static wxWindow* FindFocus();
- //@{
/**
- Find a child of this window, by name.
+ Find a child of this window, by @a id. May return @a this if
+ it matches itself.
*/
wxWindow* FindWindow(long id) const;
- const wxWindow* FindWindow(const wxString& name) const;
- //@}
+
+
+ /**
+ Find a child of this window, by name. May return @a this if
+ it matches itself.
+ */
+ wxWindow* FindWindow(const wxString& name) const;
/**
Find the first window with the given @e id.
@see SetBackgroundColour(), SetForegroundColour(),
GetForegroundColour()
*/
- virtual wxColour GetBackgroundColour() const;
+ wxColour GetBackgroundColour() const;
/**
Returns the background style of the window. The background style can be one of:
//@{
/**
Returns a reference to the list of the window's children. @c wxWindowList
- is a type-safe wxList-like class whose elements are of type
- @c wxWindow *.
+ is a type-safe wxList-like class whose elements are of type @c wxWindow*.
*/
- wxWindowList GetChildren() const;
- const wxWindowList GetChildren() const;
+ wxWindowList& GetChildren();
+ const wxWindowList& GetChildren() const;
//@}
/**
@see GetSize(), GetVirtualSize()
*/
void GetClientSize(int* width, int* height) const;
- const wxSize GetClientSize() const;
+ wxSize GetClientSize() const;
//@}
/**
Return the sizer that this window is a member of, if any, otherwise
@NULL.
*/
- const wxSizer* GetContainingSizer() const;
+ wxSizer* GetContainingSizer() const;
/**
Return the cursor associated with this window.
@see SetCursor()
*/
- const wxCursor GetCursor() const;
+ const wxCursor& GetCursor() const;
/**
Currently this is the same as calling
@see SetForegroundColour(), SetBackgroundColour(),
GetBackgroundColour()
*/
- virtual wxColour GetForegroundColour();
+ wxColour GetForegroundColour();
/**
Returns the grandparent of a window, or @NULL if there isn't one.
@see GetScreenPosition()
*/
- virtual void GetPosition(int* x, int* y) const;
- const wxPoint GetPosition() const;
+ void GetPosition(int* x, int* y) const;
+ wxPoint GetPosition() const;
//@}
/**
@see GetScreenRect()
*/
- virtual wxRect GetRect() const;
+ wxRect GetRect() const;
//@{
/**
@see GetPosition()
*/
- virtual void GetScreenPosition(int* x, int* y) const;
- const wxPoint GetScreenPosition() const;
+ void GetScreenPosition(int* x, int* y) const;
+ wxPoint GetScreenPosition() const;
//@}
/**
@see GetRect()
*/
- virtual wxRect GetScreenRect() const;
+ wxRect GetScreenRect() const;
/**
Returns the built-in scrollbar position.
virtual void SetSize(const wxSize& size);
//@}
- /**
- Use of this function for windows which are not toplevel windows
- (such as wxDialog or wxFrame) is discouraged. Please use
- SetMinSize() and SetMaxSize()
- instead.
-
- @see wxTopLevelWindow::SetSizeHints.
- */
-
-
/**
Sets the window to have the given layout sizer. The window
will then own the object, and will take care of its deletion.
void SetVirtualSize(const wxSize& size);
//@}
- //@{
- /**
- Allows specification of minimum and maximum virtual window sizes.
- If a pair of values is not set (or set to -1), the default values
- will be used.
-
- @param minW
- Specifies the minimum width allowable.
- @param minH
- Specifies the minimum height allowable.
- @param maxW
- Specifies the maximum width allowable.
- @param maxH
- Specifies the maximum height allowable.
- @param minSize
- Minimum size.
- @param maxSize
- Maximum size.
-
- @remarks If this function is called, the user will not be able to size
- the virtual area of the window outside the given bounds.
- */
- virtual void SetVirtualSizeHints(int minW, int minH, int maxW = -1,
- int maxH = -1);
- void SetVirtualSizeHints(const wxSize& minSize = wxDefaultSize,
- const wxSize& maxSize = wxDefaultSize);
- //@}
-
/**
Identical to SetWindowStyleFlag().
*/