@library{wxcore}
@category{FIXME}
- @see @ref overview_eventhandling "Event handling overview",
+ @see @ref overview_eventhandling "Event handling overview",
@ref overview_windowsizing "Window sizing overview"
*/
class wxWindow : public wxEvtHandler
Default constructor
*/
wxWindow();
-
+
/**
Constructs a window, which can be a child of a frame, dialog or any other
non-control window.
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.
*/
virtual void DestroyChildren();
+ /**
+ Returns true if this window is in process of being destroyed.
+
+ The top level windows are not deleted immediately but are rather
+ scheduled for later destruction to give them time to process any
+ pending messages, see Destroy() description.
+
+ This function returns @true if this window, or one of its parent
+ windows, is scheduled for destruction and can be useful to avoid
+ manipulating it as it's usually useless to do something with a window
+ which is on the point of disappearing anyhow.
+ */
+ bool IsBeingDeleted() const;
+
/**
Disables the window. Same as @ref Enable() Enable(@false).
it matches itself.
*/
wxWindow* FindWindow(long id) const;
-
+
/**
Find a child of this window, by name. May return @a this if
bool PopupMenu(wxMenu* menu, int x, int y);
//@}
+ /**
+ Posts a size event to the window.
+
+ This is the same as SendSizeEvent() with @c wxSEND_EVENT_POST argument.
+ */
+ void PostSizeEvent();
+
+ /**
+ Posts a size event to the parent of this window.
+
+ This is the same as SendSizeEventToParent() with @c wxSEND_EVENT_POST
+ argument.
+ */
+ void PostSizeEventToParent();
+
/**
Pushes this event handler onto the event stack for the window.
virtual void ScrollWindow(int dx, int dy,
const wxRect* rect = NULL);
+ /**
+ This function sends a dummy @ref overview_wxsizeevent "size event" to
+ the window allowing it to re-layout its children positions.
+
+ It is sometimes useful to call this function after adding or deleting a
+ children after the frame creation or if a child size changes. Note that
+ if the frame is using either sizers or constraints for the children
+ layout, it is enough to call wxWindow::Layout() directly and this
+ function should not be used in this case.
+
+ If @a flags includes @c wxSEND_EVENT_POST value, this function posts
+ the event, i.e. schedules it for later processing, instead of
+ dispatching it directly. You can also use PostSizeEvent() as a more
+ readable equivalent of calling this function with this flag.
+
+ @param flags
+ May include @c wxSEND_EVENT_POST. Default value is 0.
+ */
+ void SendSizeEvent(int flags = 0);
+
+ /**
+ Safe wrapper for GetParent()->SendSizeEvent().
+
+ This function simply checks that the window has a valid parent which is
+ not in process of being deleted and calls SendSizeEvent() on it. It is
+ used internally by windows such as toolbars changes to whose state
+ should result in parent re-layout (e.g. when a toolbar is added to the
+ top of the window, all the other windows must be shifted down).
+
+ @see PostSizeEventToParent()
+
+ @param flags
+ See description of this parameter in SendSizeEvent() documentation.
+ */
+ void SendSizeEventToParent(int flags = 0);
+
/**
Sets the accelerator table for this window. See wxAcceleratorTable.
*/
//@{
/**
Attach a tooltip to the window.
- See also: GetToolTip(),
- wxToolTip
+
+ wxToolTip pointer can be @NULL in the overload taking the pointer,
+ meaning to unset any existing tooltips, however UnsetToolTip() provides
+ a more readable alternative to this operation.
+
+ Notice that these methods are always available, even if wxWidgets was
+ compiled with @c wxUSE_TOOLTIPS set to 0, but don't do anything in this
+ case.
+
+ @see GetToolTip(), wxToolTip
*/
void SetToolTip(const wxString& tip);
void SetToolTip(wxToolTip* tip);
*/
static void UnreserveControlId(wxWindowID id, int count = 1);
+ /**
+ Unset any existing tooltip.
+
+ @since 2.9.0
+
+ @see SetToolTip()
+ */
+ void UnsetToolTip();
+
/**
Calling this method immediately repaints the invalidated area of the window and
all of its children recursively while this would usually only happen when the