// Purpose: interface of wxStdDialogButtonSizer
// Author: wxWidgets team
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
window, the library wouldn't be able to delete such an orphan sizer and in
this, and only this, case it should be deleted explicitly.
- @beginWxPythonOnly
- If you wish to create a sizer class in wxPython you should
- derive the class from @c wxPySizer in order to get Python-aware
- capabilities for the various virtual methods.
- @endWxPythonOnly
-
@section wxsizer_flags wxSizer flags
The "flag" argument accepted by wxSizeItem constructors and other
@c 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
+ items. This flag overrides this behaviour 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.)}
to make them grow and shrink equally with the sizer's horizontal
dimension.
@param flag
- OR-combination of flags affecting sizer's behavior. See
+ OR-combination of flags affecting sizer's behaviour. See
@ref wxsizer_flags "wxSizer flags list" for details.
@param border
Determines the border width, if the flag parameter is set to
to make them grow and shrink equally with the sizer's horizontal
dimension.
@param flag
- OR-combination of flags affecting sizer's behavior. See
+ OR-combination of flags affecting sizer's behaviour. See
@ref wxsizer_flags "wxSizer flags list" for details.
@param border
Determines the border width, if the flag parameter is set to
to make them grow and shrink equally with the sizer's horizontal
dimension.
@param flag
- OR-combination of flags affecting sizer's behavior. See
+ OR-combination of flags affecting sizer's behaviour. See
@ref wxsizer_flags "wxSizer flags list" for details.
@param border
Determines the border width, if the flag parameter is set to
int flag = 0,
int border = 0,
wxObject* userData = NULL);
+
+ /**
+ Appends a spacer child to the sizer.
+
+ @param width
+ Width of the spacer.
+ @param height
+ Height of the spacer.
+ @param flags
+ A wxSizerFlags object that enables you to specify most of the other
+ parameters more conveniently.
+ */
+ wxSizerItem* Add( int width, int height, const wxSizerFlags& flags);
+ wxSizerItem* Add(wxSizerItem* item);
+
/**
This base function adds non-stretchable space to both the horizontal
and vertical orientation of the sizer.
*/
void FitInside(wxWindow* window);
+ /**
+ Inform sizer about the first direction that has been decided (by
+ parent item). Returns true if it made use of the information (and
+ recalculated min size).
+ */
+ virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
+
+
//@{
/**
Returns the list of the items in this sizer.
*/
wxWindow* GetContainingWindow() const;
+ /**
+ Set the window this sizer is used in.
+ */
+ void SetContainingWindow(wxWindow *window);
+
/**
Returns the number of items in the sizer.
int flag = 0,
int border = 0,
wxObject* userData = NULL);
+ /**
+ Insert a child into the sizer before any existing item at @a index.
+
+ See Add() for the meaning of the other parameters.
+ */
+ wxSizerItem* Insert(size_t index,
+ int width,
+ int height,
+ const wxSizerFlags& flags);
+ wxSizerItem* Insert(size_t index, wxSizerItem* item);
+
/**
Inserts non-stretchable space to the sizer.
More readable way of calling wxSizer::Insert(index, size, size).
bool IsShown(size_t index) const;
/**
- Call this to force layout of the children anew, e.g. after having added a child
+ Call this to force layout of the children anew, e.g.\ after having added a child
to or removed a child (window, other sizer or space) from the sizer while
keeping the current dimension.
*/
int border = 0,
wxObject* userData = NULL);
+ /**
+ Same as Add(), but prepends the items to the beginning of the
+ list of items (windows, subsizers or spaces) owned by this sizer.
+ */
+ wxSizerItem* Prepend(int width, int height, const wxSizerFlags& flags);
+
+ wxSizerItem* Prepend(wxSizerItem* item);
+
/**
Prepends non-stretchable space to the sizer.
More readable way of calling wxSizer::Prepend(size, size, 0).
the sizer's minimal size. For windows with managed scrollbars this will set them
appropriately.
- @deprecated @todo provide deprecation description
+ @deprecated This is exactly the same as FitInside() in wxWidgets 2.9
+ and later, please replace calls to it with FitInside().
@see wxScrolled::SetScrollbars()
*/
@see Hide(), IsShown()
*/
bool Show(size_t index, bool show = true);
+
+
+ /**
+ Show or hide all items managed by the sizer.
+ */
+ virtual void ShowItems(bool show);
+
};
outlined above.
*/
void SetNegativeButton(wxButton* button);
+
+ virtual void RecalcSizes();
+ virtual wxSize CalcMin();
};
/**
Construct a sizer item for tracking a spacer.
*/
- wxSizerItem(int width, int height, int proportion, int flag,
- int border, wxObject* userData);
+ wxSizerItem(int width, int height, int proportion=0, int flag=0,
+ int border=0, wxObject* userData=NULL);
//@{
/**
Construct a sizer item for tracking a window.
*/
wxSizerItem(wxWindow* window, const wxSizerFlags& flags);
- wxSizerItem(wxWindow* window, int proportion, int flag,
- int border,
- wxObject* userData);
+ wxSizerItem(wxWindow* window, int proportion=0, int flag=0,
+ int border=0,
+ wxObject* userData=NULL);
//@}
//@{
/**
Construct a sizer item for tracking a subsizer.
*/
- wxSizerItem(wxSizer* window, const wxSizerFlags& flags);
- wxSizerItem(wxSizer* sizer, int proportion, int flag,
- int border,
- wxObject* userData);
+ wxSizerItem(wxSizer* sizer, const wxSizerFlags& flags);
+ wxSizerItem(wxSizer* sizer, int proportion=0, int flag=0,
+ int border=0,
+ wxObject* userData=NULL);
//@}
/**
Old spacer, if any, is deleted.
*/
void AssignSpacer(const wxSize& size);
- void AssignSpacer(int w, int h) { AssignSpacer(wxSize(w, h)); }
+ void AssignSpacer(int w, int h);
//@}
/**
*/
void SetSpacer(const wxSize& size);
+ void SetUserData(wxObject* userData);
+
/**
Set the window to be tracked by this item.
@deprecated @todo provide deprecation description
/**
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
+ overrides this behaviour 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.
Note that this method does not trigger relayout.
*/
void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode);
+
+ virtual void RecalcSizes();
+ virtual wxSize CalcMin();
+
};
wxGridSizer( int rows, int cols, const wxSize& gap );
//@}
- //@{
/**
- Returns the number of columns or rows that has been specified for the
+ Returns the number of columns that has been specified for the
sizer.
Returns zero if the sizer is automatically adjusting the number of
- columns/rows depending on number of its children. To get the effective
- number of columns or rows being currently used, see
- GetEffectiveColsCount() and GetEffectiveRowsCount().
+ columns depending on number of its children. To get the effective
+ number of columns or rows being currently used, see GetEffectiveColsCount()
*/
int GetCols() const;
+
+ /**
+ Returns the number of rows that has been specified for the
+ sizer.
+
+ Returns zero if the sizer is automatically adjusting the number of
+ rows depending on number of its children. To get the effective
+ number of columns or rows being currently used, see GetEffectiveRowsCount().
+ */
int GetRows() const;
- //@}
- //@{
/**
- Returns the number of columns or rows currently used by the sizer.
+ Returns the number of columns currently used by the sizer.
This will depend on the number of children the sizer has if
the sizer is automatically adjusting the number of columns/rows.
@since 2.9.1
*/
int GetEffectiveColsCount() const;
+
+ /**
+ Returns the number of rows currently used by the sizer.
+
+ This will depend on the number of children the sizer has if
+ the sizer is automatically adjusting the number of columns/rows.
+
+ @since 2.9.1
+ */
int GetEffectiveRowsCount() const;
- //@}
/**
Returns the horizontal gap (in pixels) between cells in the sizer.
Sets the vertical gap (in pixels) between the cells in the sizer.
*/
void SetVGap(int gap);
+
+ virtual wxSize CalcMin();
+ virtual void RecalcSizes();
};
Returns the static box associated with the sizer.
*/
wxStaticBox* GetStaticBox() const;
+
+ virtual wxSize CalcMin();
+ virtual void RecalcSizes();
};
*/
int GetOrientation() const;
+ /**
+ Sets the orientation of the box sizer, either wxVERTICAL
+ or wxHORIZONTAL.
+ */
+ void SetOrientation(int orient);
+
/**
Implements the calculation of a box sizer's dimensions and then sets
the size of its children (calling wxWindow::SetSize if the child is a window).
It is used internally only and must not be called by the user
(call Layout() if you want to resize). Documented for information.
*/
- void RecalcSizes();
+ virtual void RecalcSizes();
};