*/
wxWindow* GetParent() const;
+ //@{
/**
This function shows a popup menu at the given position in this window and
- returns the selected id. It can be more convenient than the general purpose
- PopupMenu() function for simple menus proposing a choice in a list of
- strings to the user.
+ returns the selected id.
+
+ It can be more convenient than the general purpose PopupMenu() function
+ for simple menus proposing a choice in a list of strings to the user.
+
+ Notice that to avoid unexpected conflicts between the (usually
+ consecutive range of) ids used by the menu passed to this function and
+ the existing EVT_UPDATE_UI() handlers, this function temporarily
+ disables UI updates for the window, so you need to manually disable
+ (or toggle or ...) any items which should be disabled in the menu
+ before showing it.
@param menu
- The menu to show
+ The menu to show.
@param pos
- The position at which to show the menu in client coordinates
+ The position at which to show the menu in client coordinates.
- @return The selected menu item id or wxID_NONE if none selected or an
- error occurred.
- */
- int GetPopupMenuSelectionFromUser(wxMenu& menu, const wxPoint& pos);
+ @return
+ The selected menu item id or @c wxID_NONE if none selected or an
+ error occurred.
- /**
- See the GetPopupMenuSelectionFromUser(wxMenu&, const wxPoint&) overload.
- This overload differs only because it takes two integers for the
- menu position instead of a wxPoint.
+ @since 2.9.0
*/
+ int GetPopupMenuSelectionFromUser(wxMenu& menu, const wxPoint& pos);
int GetPopupMenuSelectionFromUser(wxMenu& menu, int x, int y);
+ //@}
/**
This gets the position of the window in pixels, relative to the parent window
Invokes the constraint-based layout algorithm or the sizer-based algorithm
for this window.
- See SetAutoLayout(): when auto layout is on, this function gets called automatically
- when the window is resized.
+ This function does not get called automatically when the window is resized
+ because lots of windows deriving from wxWindow does not need this functionality.
+ If you want to have Layout() called automatically, you should derive
+ from wxPanel (see wxPanel::Layout).
@see @ref overview_windowsizing
*/
/**
Lowers the window to the bottom of the window hierarchy (Z-order).
+ @remarks
+ This function only works for wxTopLevelWindow-derived classes.
+
@see Raise()
*/
virtual void Lower();
/**
Raises the window to the top of the window hierarchy (Z-order).
- In current version of wxWidgets this works both for managed and child windows.
+
+ @remarks
+ This function only works for wxTopLevelWindow-derived classes.
@see Lower()
*/
updated when its size changes.
@param autoLayout
- Set this to @true if you wish the Layout function to be
- called automatically when the window is resized.
+ Set this to @true if you wish the Layout() function to be
+ called automatically when the window is resized
+ (really happens only if you derive from wxPanel or wxTopLevelWindow).
@see SetConstraints()
*/
virtual void SetSize(int width, int height);
//@}
+ /**
+ 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
+ */
+ void SetSizeHints( const wxSize& minSize,
+ const wxSize& maxSize=wxDefaultSize,
+ const wxSize& incSize=wxDefaultSize);
+
/**
Sets the window to have the given layout sizer.
The window will then own the object, and will take care of its deletion.