/**
@name Scrolling and scrollbars functions
+
+ Note that these methods don't work with native controls which don't use
+ wxWidgets scrolling framework (i.e. don't derive from wxScrolledWindow).
*/
//@{
/**
Returns the built-in scrollbar position.
- @see See SetScrollbar()
+ @see SetScrollbar()
*/
virtual int GetScrollPos(int orientation) const;
/**
Sets the cached best size value.
+
+ @see GetBestSize()
*/
void CacheBestSize(const wxSize& size) const;
control label is not truncated. For windows containing subwindows (typically
wxPanel), the size returned by this function will be the same as the size
the window would have had after calling Fit().
+
+ Note that when you write your own widget you need to overload the
+ DoGetBestSize() function instead of this (non-virtual!) function.
+
+ @see CacheBestSize(), @ref overview_windowsizing
*/
wxSize GetBestSize() const;
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.
possible size as well as the upper bound on window's size settable using
SetClientSize().
- @see GetMaxSize()
+ @see GetMaxSize(), @ref overview_windowsizing
*/
virtual wxSize GetMaxClientSize() const;
This is an indication to the sizer layout mechanism that this is the maximum
possible size as well as the upper bound on window's size settable using SetSize().
- @see GetMaxClientSize()
+ @see GetMaxClientSize(), @ref overview_windowsizing
*/
virtual wxSize GetMaxSize() const;
It normally just returns the value set by SetMinClientSize(), but it can be
overridden to do the calculation on demand.
- @see GetMinSize()
+ @see GetMinSize(), @ref overview_windowsizing
*/
virtual wxSize GetMinClientSize() const;
This method normally just returns the value set by SetMinSize(), but it
can be overridden to do the calculation on demand.
- @see GetMinClientSize()
+ @see GetMinClientSize(), @ref overview_windowsizing
*/
virtual wxSize GetMinSize() const;
@param height
Receives the window height.
- @see GetClientSize(), GetVirtualSize()
+ @see GetClientSize(), GetVirtualSize(), @ref overview_windowsizing
*/
void GetSize(int* width, int* height) const;
This gets the virtual size of the window in pixels.
By default it returns the client size of the window, but after a call to
SetVirtualSize() it will return the size set with that method.
+
+ @see @ref overview_windowsizing
*/
wxSize GetVirtualSize() const;
/**
Resets the cached best size value so it will be recalculated the next time it
is needed.
+
+ @see CacheBestSize()
*/
void InvalidateBestSize();
+
/**
Posts a size event to the window.
than SetSize(), since the application need not worry about what dimensions
the border or title bar have when trying to fit the window around panel
items, for example.
+
+ @see @ref overview_windowsizing
*/
virtual void SetClientSize(int width, int height);
Sets the maximum client size of the window, to indicate to the sizer
layout mechanism that this is the maximum possible size of its client area.
- @see SetMaxSize()
+ Note that this method is just a shortcut for:
+ @code
+ SetMaxSize(ClientToWindowSize(size));
+ @endcode
+
+ @see SetMaxSize(), @ref overview_windowsizing
*/
virtual void SetMaxClientSize(const wxSize& size);
Sets the maximum size of the window, to indicate to the sizer layout mechanism
that this is the maximum possible size.
- @see SetMaxClientSize()
+ @see SetMaxClientSize(), @ref overview_windowsizing
*/
virtual void SetMaxSize(const wxSize& size);
prevent the program from explicitly making the window smaller than the
specified size.
- @see SetMinSize()
+ Note that this method is just a shortcut for:
+ @code
+ SetMinSize(ClientToWindowSize(size));
+ @endcode
+
+ @see SetMinSize(), @ref overview_windowsizing
*/
virtual void SetMinClientSize(const wxSize& size);
SetSize(), it just ensures that it won't become smaller than this size
during the automatic layout.
- @see SetMinClientSize()
+ @see SetMinClientSize(), @ref overview_windowsizing
*/
virtual void SetMinSize(const wxSize& size);
should be supplied by wxWidgets, or that the current value of the
dimension should be used.
- @see Move()
+ @see Move(), @ref overview_windowsizing
*/
void SetSize(int x, int y, int width, int height,
int sizeFlags = wxSIZE_AUTO);
@remarks This form must be used with non-default width and height values.
- @see Move()
+ @see Move(), @ref overview_windowsizing
*/
virtual void SetSize(const wxRect& rect);
(such as wxDialog or wxFrame) is discouraged.
Please use SetMinSize() and SetMaxSize() instead.
- @see wxTopLevelWindow::SetSizeHints
+ @see wxTopLevelWindow::SetSizeHints, @ref overview_windowsizing
*/
void SetSizeHints( const wxSize& minSize,
const wxSize& maxSize=wxDefaultSize,
/**
Sets the virtual size of the window in pixels.
+
+ @see @ref overview_windowsizing
*/
void SetVirtualSize(int width, int height);
@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);