*/
wxSize GetMinSize() const;
+ /**
+ Sets the minimum size to be allocated for this item.
+
+ If this item is a window, the @a size is also passed to
+ wxWindow::SetMinSize().
+ */
+ void SetMinSize(const wxSize& size);
+
+ /**
+ @overload
+ */
+ void SetMinSize(int x, int y);
+
/**
What is the current position of the item, as set in the last Layout.
*/
wxWindow* GetWindow() const;
/**
- Returns @true if this item is a window or a spacer and it is shown or if this
- item is a sizer and not all its elements are hidden. In other words, for sizer
- items, all of the child elements must be hidden for the sizer itself to be
- considered hidden.
+ Returns @true if this item is a window or a spacer and it is shown or
+ if this item is a sizer and not all of its elements are hidden.
+
+ In other words, for sizer items, all of the child elements must be
+ hidden for the sizer itself to be considered hidden.
+
+ As an exception, if the @c wxRESERVE_SPACE_EVEN_IF_HIDDEN flag was
+ used for this sizer item, then IsShown() always returns @true for it
+ (see wxSizerFlags::ReserveSpaceEvenIfHidden()).
*/
bool IsShown() const;
wxSizerFlags(int proportion = 0);
/**
- Sets the alignment of this wxSizerFlags to @e align.
- Note that if this method is not called, the wxSizerFlags has no specified
- alignment.
+ Sets the alignment of this wxSizerFlags to @e align. Note that if this
+ method is not called, the wxSizerFlags has no specified alignment.
- @see Top(), Left(), Right(),
- Bottom(), Centre()
+ @see Top(), Left(), Right(), Bottom(), Centre()
*/
- wxSizerFlags Align(int align = 0);
+ wxSizerFlags& Align(int align = 0);
- //@{
/**
- Sets the wxSizerFlags to have a border of a number of pixels specified by
- @a borderinpixels with the directions specified by @e direction.
- In the overloaded version without @a borderinpixels parameter, the border of
- default size, as returned by GetDefaultBorder(),
- is used.
+ Sets the wxSizerFlags to have a border of a number of pixels specified
+ by @a borderinpixels with the directions specified by @e direction.
*/
- wxSizerFlags Border(int direction, int borderinpixels);
- wxSizerFlags Border(int direction = wxALL);
- //@}
+ wxSizerFlags& Border(int direction, int borderinpixels);
+
+ /**
+ Sets the wxSizerFlags to have a border with size as returned by
+ GetDefaultBorder().
+
+ @param direction Direction(s) to apply the border in.
+ */
+ wxSizerFlags& Border(int direction = wxALL);
/**
- Aligns the object to the bottom, shortcut for @c Align(wxALIGN_BOTTOM)
+ Aligns the object to the bottom, shortcut for @c Align(wxALIGN_BOTTOM).
@see Align()
*/
- wxSizerFlags Bottom();
+ wxSizerFlags& Bottom();
/**
- Sets the object of the wxSizerFlags to center itself in the area it is given.
+ Sets the object of the wxSizerFlags to center itself in the area it is
+ given.
*/
- wxSizerFlags Center();
+ wxSizerFlags& Center();
/**
- Center() for people with the other dialect of english.
+ Center() for people with the other dialect of English.
*/
- wxSizerFlags Centre();
+ wxSizerFlags& Centre();
/**
- Sets the border in the given @a direction having twice the default border
- size.
+ Sets the border in the given @a direction having twice the default
+ border size.
*/
- wxSizerFlags DoubleBorder(int direction = wxALL);
+ wxSizerFlags& DoubleBorder(int direction = wxALL);
/**
- Sets the border in left and right directions having twice the default border
- size.
+ Sets the border in left and right directions having twice the default
+ border size.
*/
- wxSizerFlags DoubleHorzBorder();
+ wxSizerFlags& DoubleHorzBorder();
/**
- Sets the object of the wxSizerFlags to expand to fill as much area as it can.
+ Sets the object of the wxSizerFlags to expand to fill as much area as
+ it can.
*/
- wxSizerFlags Expand();
+ wxSizerFlags& Expand();
/**
- Set the @c wxFIXED_MINSIZE flag which indicates that the initial size of
- the window should be also set as its minimal size.
+ Set the @c wxFIXED_MINSIZE flag which indicates that the initial size
+ of the window should be also set as its minimal size.
*/
- wxSizerFlags FixedMinSize();
+ wxSizerFlags& FixedMinSize();
+
+ /**
+ Set the @c wxRESERVE_SPACE_EVEN_IF_HIDDEN flag. Normally wxSizers
+ don't allocate space for hidden windows or other items. This flag
+ overrides this behavior so that sufficient space is allocated for the
+ window even if it isn't visible. This makes it possible to dynamically
+ show and hide controls without resizing parent dialog, for example.
+
+ @since 2.8.8
+ */
+ wxSizerFlags& ReserveSpaceEvenIfHidden();
/**
Returns the border used by default in Border() method.
@see Align()
*/
- wxSizerFlags Left();
+ wxSizerFlags& Left();
/**
Sets the proportion of this wxSizerFlags to @e proportion
*/
- wxSizerFlags Proportion(int proportion = 0);
+ wxSizerFlags& Proportion(int proportion = 0);
/**
Aligns the object to the right, shortcut for @c Align(wxALIGN_RIGHT)
@see Align()
*/
- wxSizerFlags Right();
+ wxSizerFlags& Right();
/**
Set the @c wx_SHAPED flag which indicates that the elements should
always keep the fixed width to height ratio equal to its original value.
*/
- wxSizerFlags Shaped();
+ wxSizerFlags& Shaped();
/**
Aligns the object to the top, shortcut for @c Align(wxALIGN_TOP)
@see Align()
*/
- wxSizerFlags Top();
+ wxSizerFlags& Top();
/**
- Sets the border in the given @a direction having thrice the default border
- size.
+ Sets the border in the given @a direction having thrice the default
+ border size.
*/
- wxSizerFlags TripleBorder(int direction = wxALL);
+ wxSizerFlags& TripleBorder(int direction = wxALL);
};
Returns a wxOrientation value that specifies whether the sizer flexibly
resizes its columns, rows, or both (default).
- @returns One of the following values:
+ @return One of the following values:
@see SetFlexibleDirection()
*/
Returns the value that specifies how the sizer grows in the "non-flexible"
direction if there is one.
- @returns One of the following values:
+ @return One of the following values:
@see SetFlexibleDirection(),
SetNonFlexibleGrowMode()
item changes and its best size becomes different. If you would
rather have a window item stay the size it started with then use
wxFIXED_MINSIZE.}
+ @itemdef{wxRESERVE_SPACE_EVEN_IF_HIDDEN,
+ Normally wxSizers don't allocate space for hidden windows or other
+ items. This flag overrides this behavior so that sufficient space
+ is allocated for the window even if it isn't visible. This makes
+ it possible to dynamically show and hide controls without resizing
+ parent dialog, for example. (Available since 2.8.8.)
+ }
@itemdef{wxALIGN_CENTER<br>
wxALIGN_CENTRE<br>
wxALIGN_LEFT<br>
*/
~wxSizer();
+ /** @name Item Management */
+ //@{
+
/**
Appends a child to the sizer.
*/
wxSizerItem* AddStretchSpacer(int prop = 1);
+ //@}
+
/**
This method is abstract and has to be overwritten by any derived class.
Here, the sizer will do the actual calculation of its children's minimal sizes.
in
windows which manage it.
- @see wxScrolledWindow::SetScrollbars, SetVirtualSizeHints()
+ @see wxScrolled::SetScrollbars(), SetVirtualSizeHints()
*/
void FitInside(wxWindow* window);
*/
wxSizerItem* InsertStretchSpacer(size_t index, int prop = 1);
- //@{
/**
- Returns @true if the @e window, @e sizer, or item at @a index is shown.
+ Returns @true if the @e window is shown.
- @see Hide(), Show()
+ @see Hide(), Show(), wxSizerItem::IsShown()
*/
bool IsShown(wxWindow* window) const;
- const bool IsShown(wxSizer* sizer) const;
- const bool IsShown(size_t index) const;
- //@}
+
+ /**
+ Returns @true if the @e sizer is shown.
+
+ @see Hide(), Show(), wxSizerItem::IsShown()
+ */
+ bool IsShown(wxSizer* sizer) const;
+
+ /**
+ Returns @true if the item at @a index is shown.
+
+ @see Hide(), Show(), wxSizerItem::IsShown()
+ */
+ bool IsShown(size_t index) const;
/**
Call this to force layout of the children anew, e.g. after having added a child
rules defined by the parameter in the Add() and Prepend() methods.
*/
void SetDimension(int x, int y, int width, int height);
+ void SetDimension(const wxPoint& pos, const wxSize& size);
//@{
/**
- Set an item's minimum size by window, sizer, or position. The item will be
- found recursively
- in the sizer's descendants. This function enables an application to set the
- size of an item
- after initial creation.
+ Set an item's minimum size by window, sizer, or position.
+
+ The item will be found recursively in the sizer's descendants. This
+ function enables an application to set the size of an item after
+ initial creation.
+
+ @see wxSizerItem::SetMinSize()
*/
void SetItemMinSize(wxWindow* window, int width, int height);
void SetItemMinSize(wxSizer* sizer, int width, int height);
minimal size. For windows with managed scrollbars this will set them
appropriately.
- @see wxScrolledWindow::SetScrollbars
+ @see wxScrolled::SetScrollbars()
*/
void SetVirtualSizeHints(wxWindow* window);