X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/58d0deaac1af12c41b27de4c92dae023c2616b03..7447d53c35249d42128d6243c90998f03882859a:/docs/doxygen/overviews/sizer.h?ds=sidebyside
diff --git a/docs/doxygen/overviews/sizer.h b/docs/doxygen/overviews/sizer.h
index b7599dc106..e551e6af79 100644
--- a/docs/doxygen/overviews/sizer.h
+++ b/docs/doxygen/overviews/sizer.h
@@ -3,14 +3,15 @@
// Purpose: topic overview
// Author: wxWidgets team
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-/*!
+/**
-@page overview_sizer Sizer Overview
+@page overview_sizer Sizers Overview
-Classes: wxSizer, wxGridSizer, wxFlexGridSizer, wxBoxSizer, wxStaticBoxSizer
+Classes: wxSizer, wxBoxSizer, wxStaticBoxSizer, wxGridSizer, wxFlexGridSizer,
+ wxGridBagSizer
Sizers, as represented by the wxSizer class and its descendants in the
wxWidgets class hierarchy, have become the method of choice to define the
@@ -84,11 +85,11 @@ don't have any natural width or height and thus require an explicit size. Some
controls can calculate their height, but not their width (e.g. a single line
text control):
-@image html sizer03.bmp
+@image html overview_sizer_03.png
-@image html sizer04.bmp
+@image html overview_sizer_04.png
-@image html sizer05.bmp
+@image html overview_sizer_05.png
A border: The border is just empty space and is used to separate dialog
items in a dialog. This border can either be all around, or at any combination
@@ -97,11 +98,11 @@ must be set explicitly, typically 5 points. The following samples show dialogs
with only one dialog item (a button) and a border of 0, 5, and 10 pixels around
the button:
-@image html sizer00.bmp
+@image html overview_sizer_00.png
-@image html sizer01.bmp
+@image html overview_sizer_01.png
-@image html sizer02.bmp
+@image html overview_sizer_02.png
An alignment: Often, a dialog item is given more space than its minimal
size plus its border. Depending on what flags are used for the respective
@@ -112,7 +113,7 @@ space. The following sample shows a listbox and three buttons in a horizontal
box sizer; one button is centred, one is aligned at the top, one is aligned at
the bottom:
-@image html sizer06.bmp
+@image html overview_sizer_06.png
A stretch factor: If a sizer contains more than one child and it is
offered more space than its children and their borders need, the question
@@ -127,7 +128,7 @@ other or not. The following sample shows a dialog with three buttons, the
first one has a stretch factor of 1 and thus gets stretched, whereas the other
two buttons have a stretch factor of zero and keep their initial width:
-@image html sizer07.bmp
+@image html overview_sizer_07.png
Within wxDesigner, this stretch factor gets set from the @e Option menu.
@@ -157,14 +158,14 @@ horizontal box sizer, the stretch factor determines how much the child can be
stretched horizontally. The following sample shows the same dialog as in the
last sample, only the box sizer is a vertical box sizer now:
-@image html sizer08.bmp
+@image html overview_sizer_08.png
@subsection overview_sizer_hiding_static wxStaticBoxSizer
wxStaticBoxSixer is the same as a wxBoxSizer, but surrounded by a static box.
Here is a sample:
-@image html sizer09.bmp
+@image html overview_sizer_09.png
@subsection overview_sizer_hiding_grid wxGridSizer
@@ -174,7 +175,7 @@ control in the left bottom border. Either the number of columns or the number
or rows is fixed and the grid sizer will grow in the respectively other
orientation if new children are added:
-@image html sizer10.bmp
+@image html overview_sizer_10.png
For programming information, see wxGridSizer.
@@ -187,7 +188,7 @@ and rows can be declared to be stretchable if the sizer is assigned a size
different from the one it requested. The following sample shows the same dialog
as the one above, but using a flex grid sizer:
-@image html sizer11.bmp
+@image html overview_sizer_11.png
@section overview_sizer_box Programming with wxBoxSizer
@@ -295,7 +296,7 @@ MyDialog::MyDialog(wxFrame *parent, wxWindowID id, const wxString &title )
{
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
- // create text ctrl with minimal size 100x60 that is horizontally and
+ // create text ctrl with minimal size 100x60 that is horizontally and
// vertically stretchable with a border width of 10
topsizer->Add(
new wxTextCtrl( this, -1, "My text.", wxDefaultPosition, wxSize(100,60), wxTE_MULTILINE),
@@ -303,20 +304,20 @@ MyDialog::MyDialog(wxFrame *parent, wxWindowID id, const wxString &title )
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
- //create two buttons that are horizontally unstretchable,
+ //create two buttons that are horizontally unstretchable,
// with an all-around border with a width of 10 and implicit top alignment
button_sizer->Add(
new wxButton( this, wxID_OK, "OK" ),
- wxSizerFlags(0).Align().Border(wxALL, 10));
+ wxSizerFlags(0).Align().Border(wxALL, 10));
button_sizer->Add(
new wxButton( this, wxID_CANCEL, "Cancel" ),
- wxSizerFlags(0).Align().Border(wxALL, 10));
+ wxSizerFlags(0).Align().Border(wxALL, 10));
//create a sizer with no border and centered horizontally
topsizer->Add(
button_sizer,
- wxSizerFlags(0).Center() );
+ wxSizerFlags(0).Center() );
SetSizerAndFit(topsizer); // use the sizer for layout and set size and hints
}
@@ -339,10 +340,13 @@ necessarily the same height or width as in the wxGridSizer.
wxStaticBoxSizer is a sizer derived from wxBoxSizer but adds a static box
around the sizer. Note that this static box has to be created separately.
+wxGridBagSizer is a rather special kind of sizer which, unlike the other
+classes, allows to directly put the elements at the given position in the
+sizer. Please see its documentation for more details.
@section overview_sizer_button CreateButtonSizer
-As a convenience, CreateButtonSizer(long flags) can be used to create a
+As a convenience, wxDialog::CreateButtonSizer(long flags) can be used to create a
standard button sizer in which standard buttons are displayed. The following
flags can be passed to this function: