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
{
use Destroy() so that wxWidgets
can delete a window only when it is safe to do so, in idle time.
- @see @ref overview_windowdeletionoverview "Window deletion overview",
+ @see @ref overview_windowdeletion "Window Deletion Overview",
Destroy(), wxCloseEvent
*/
~wxWindow();
@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;
- virtual wxPoint ClientToScreen(const wxPoint& pt) const;
+ void ClientToScreen(int* x, int* y) const;
+ wxPoint ClientToScreen(const wxPoint& pt) const;
//@}
/**
windows (wxFrame and wxDialog classes) as the others
are not supposed to have any special OnClose() logic.
- @see @ref overview_windowdeletionoverview "Window deletion overview",
+ @see @ref overview_windowdeletion "Window Deletion Overview",
Destroy(), wxCloseEvent
*/
bool Close(bool force = false);
virtual void DestroyChildren();
/**
- Disables the window, same as @ref enable() Enable(@false).
+ Disables the window. Same as @ref Enable() Enable(@false).
@return Returns @true if the window has been disabled, @false if it had
been already disabled before the call to this function.
/**
Does the window-specific updating after processing the update event.
- This function is called by UpdateWindowUI()
- in order to check return values in the wxUpdateUIEvent and
- act appropriately. For example, to allow frame and dialog title updating,
- wxWidgets
- implements this function as follows:
+ This function is called by UpdateWindowUI() in order to check return
+ values in the wxUpdateUIEvent and act appropriately.
*/
virtual void DoUpdateWindowUI(wxUpdateUIEvent& event);
is more precise as Fit() adds some margin to account for fuzziness of its calculations)
to call:
- @begincode
+ @code
window->SetClientSize(child->GetSize());
@endcode
@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:
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.
/**
Returns the associated drop target, which may be @NULL.
- @see SetDropTarget(), @ref overview_wxdndoverview
+ @see SetDropTarget(), @ref overview_dnd
*/
wxDropTarget* GetDropTarget() const;
@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;
+ 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.
window creation to intelligently set up the window visual attributes, that is
the font and the foreground and background colours.
By "intelligently" the following is meant: by default, all windows use their
- own @ref getclassdefaultattributes() default attributes. However
+ own @ref GetClassDefaultAttributes() default attributes. However
if some of the parents attributes are explicitly (that is, using
SetFont() and not
wxWindow::SetOwnFont) changed and if the
/**
Returns @true if this window is intrinsically enabled, @false otherwise,
i.e.
- if @ref enable() Enable(@false) had been called. This method is
+ if @ref Enable() Enable(@false) had been called. This method is
mostly used for wxWidgets itself, user code should normally use
IsEnabled() instead.
*/
Create a new ID or range of IDs that are not currently in use. The
IDs will be reserved until assigned to a wxWindowIDRef()
or unreserved with UnreserveControlId().
- See @ref overview_windowidsoverview "Window IDs overview" for more information.
+ See @ref overview_windowids "Window IDs Overview" for more information.
@param count
The number of sequential IDs to reserve.
@return Returns the ID or the first ID of the range, or wxID_NONE if the
specified number of identifiers couldn't be allocated.
- @see UnreserveControlId(), wxIdManager, @ref overview_windowidsoverview
- "Window IDs overview"
+ @see UnreserveControlId(), wxIdManager, @ref overview_windowids
+ "Window IDs Overview"
*/
static wxWindowID NewControlId(int count = 1);
Associates a drop target with this window.
If the window already has a drop target, it is deleted.
- @see GetDropTarget(), @ref overview_wxdndoverview
+ @see GetDropTarget(), @ref overview_dnd
*/
void SetDropTarget(wxDropTarget* target);
for them is found. Using this style allows to prevent them from being
propagated beyond this window. Notice that wxDialog has this style on by
default for the reasons explained in the
- @ref overview_eventprocessing "event processing overview".
+ @ref overview_eventhandling "Event Handling Overview".
@b wxWS_EX_TRANSIENT
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.
@param sizer
The sizer to set. Pass @NULL to disassociate and conditionally delete
- the window's sizer. See below.
+ the window's sizer. See below.
@param deleteOld
If @true (the default), this will delete any pre-existing sizer.
Pass @false if you wish to handle deleting the old sizer yourself.
-
- @remarks SetSizer now enables and disables Layout automatically, but
- prior to wxWidgets 2.3.3 the following applied:
+ @remarks SetSizer enables and disables Layout automatically.
*/
void SetSizer(wxSizer* sizer, bool deleteOld = true);
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().
*/
/**
Unreserve an ID or range of IDs that was reserved by NewControlId().
- See @ref overview_windowidsoverview "Window IDs overview" for more information.
+ See @ref overview_windowids "Window IDs Overview" for more information.
@param id
The starting ID of the range of IDs to unreserve.
@param count
The number of sequential IDs to unreserve.
- @see NewControlId(), wxIdManager, @ref overview_windowidsoverview
- "Window IDs overview"
+ @see NewControlId(), wxIdManager, @ref overview_windowids
+ "Window IDs Overview"
*/
static void UnreserveControlId(wxWindowID id, int count = 1);