Merges the window's best size into the min size and returns the result.
This is the value used by sizers to determine the appropriate
ammount of space to allocate for the widget.
+
+ This is the method called by any wxSizer when they query the size
+ of a certain window or control.
@see GetBestSize(), SetInitialSize(), @ref overview_windowsizing
*/
- wxSize GetEffectiveMinSize() const;
+ virtual wxSize GetEffectiveMinSize() const;
/**
Returns the maximum size of window's client area.
@code
GetEventHandler()->SafelyProcessEvent(event);
@endcode
+
+ @see ProcessWindowEvent()
*/
bool HandleWindowEvent(wxEvent& event) const;
+ /**
+ Convenient wrapper for ProcessEvent().
+
+ This is the same as writing @code GetEventHandler()->ProcessEvent(event);
+ @endcode but more convenient. Notice that ProcessEvent() itself can't
+ be called for wxWindow objects as it ignores the event handlers
+ associated with the window, use this function instead.
+ */
+ bool ProcessWindowEvent(wxEvent& event);
+
/**
Removes and returns the top-most event handler on the event handler stack.
*/
void SendDestroyEvent();
- //@{
/**
- This function is public in wxEvtHandler but is protected in wxWindow because
- for wxWindows you should always use this function on the pointer returned
- by GetEventHandler() and not on the wxWindow object itself.
+ This function is public in wxEvtHandler but protected in wxWindow
+ because for wxWindows you should always call ProcessEvent() on the
+ pointer returned by GetEventHandler() and not on the wxWindow object
+ itself.
+
+ For convenience, a ProcessWindowEvent() method is provided as a synonym
+ for @code GetEventHandler()->ProcessEvent() @endcode.
Note that it's still possible to call these functions directly on the
- wxWindow object (e.g. downcasting it to wxEvtHandler) but doing that
- will create subtle bugs when windows with event handlers pushed on them
- are involved.
+ wxWindow object (e.g. casting it to wxEvtHandler) but doing that will
+ create subtle bugs when windows with event handlers pushed on them are
+ involved.
+
+ This holds also for all other wxEvtHandler functions.
*/
virtual bool ProcessEvent(wxEvent& event);
+
+ //@{
+ /**
+ See ProcessEvent() for more info about why you shouldn't use this function
+ and the reason for making this function protected in wxWindow.
+ */
bool SafelyProcessEvent(wxEvent& event);
virtual void QueueEvent(wxEvent *event);
virtual void AddPendingEvent(const wxEvent& event);