<rows>0</rows>
<vgap>0</vgap>
<hgap>0</hgap>
- <growablecols>0</growablecols>
- <growablerows>0</growablerows>
+ <growablecols>0:1</growablecols>
+ <growablerows>0:1</growablerows>
<object class="sizeritem">
<flag>wxALIGN_CENTRE|wxALL</flag>
<border>5</border>
@row3col{cols, integer, Number of columns in the grid (default: 0 - determine automatically).}
@row3col{vgap, integer, Vertical gap between children (default: 0).}
@row3col{hgap, integer, Horizontal gap between children (default: 0).}
+@row3col{flexibledirection, @ref overview_xrcformat_type_style,
+ Flexible direction, @c wxVERTICAL, @c wxHORIZONTAL or @c wxBOTH (default).
+ This property is only available since wxWidgets 2.9.5.}
+@row3col{nonflexiblegrowmode, @ref overview_xrcformat_type_style,
+ Grow mode in the non-flexible direction,
+ @c wxFLEX_GROWMODE_NONE, @c wxFLEX_GROWMODE_SPECIFIED (default) or
+ @c wxFLEX_GROWMODE_ALL.
+ This property is only available since wxWidgets 2.9.5.}
@row3col{growablerows, comma-separated integers list,
- Comma-separated list of indexes of rows that are growable
- (default: none).}
+ Comma-separated list of indexes of rows that are growable (none by default).
+ Since wxWidgets 2.9.5 optional proportion can be appended to each number
+ after a colon (@c :).}
@row3col{growablecols, comma-separated integers list,
- Comma-separated list of indexes of columns that are growable
- (default: none).}
+ Comma-separated list of indexes of columns that are growable (none by default).
+ Since wxWidgets 2.9.5 optional proportion can be appended to each number
+ after a colon (@c :).}
@endTable
@subsection overview_xrcformat_wxgridbagsizer wxGridBagSizer
@hdr3col{property, type, description}
@row3col{vgap, integer, Vertical gap between children (default: 0).}
@row3col{hgap, integer, Horizontal gap between children (default: 0).}
+@row3col{flexibledirection, @ref overview_xrcformat_type_style,
+ Flexible direction, @c wxVERTICAL, @c wxHORIZONTAL, @c wxBOTH (default: @c wxBOTH).}
+@row3col{nonflexiblegrowmode, @ref overview_xrcformat_type_style,
+ Grow mode in the non-flexible direction,
+ @c wxFLEX_GROWMODE_NONE, @c wxFLEX_GROWMODE_SPECIFIED, @c wxFLEX_GROWMODE_ALL
+ (default: @c wxFLEX_GROWMODE_SPECIFIED).}
@row3col{growablerows, comma-separated integers list,
- Comma-separated list of indexes of rows that are growable
+ Comma-separated list of indexes of rows that are growable,
+ optionally the proportion can be appended after each number
+ separated by a @c :
(default: none).}
@row3col{growablecols, comma-separated integers list,
- Comma-separated list of indexes of columns that are growable
+ Comma-separated list of indexes of columns that are growable,
+ optionally the proportion can be appended after each number
+ separated by a @c :
(default: none).}
@endTable
// set growable rows and cols for sizers which support this
if ( wxFlexGridSizer *flexsizer = wxDynamicCast(sizer, wxFlexGridSizer) )
{
+ SetFlexibleMode(flexsizer);
SetGrowables(flexsizer, wxT("growablerows"), true);
SetGrowables(flexsizer, wxT("growablecols"), false);
}
}
+void wxSizerXmlHandler::SetFlexibleMode(wxFlexGridSizer* fsizer)
+{
+ if (HasParam(wxT("flexibledirection")))
+ {
+ wxString dir = GetParamValue(wxT("flexibledirection"));
+
+ if (dir == wxT("wxVERTICAL"))
+ fsizer->SetFlexibleDirection(wxVERTICAL);
+ else if (dir == wxT("wxHORIZONTAL"))
+ fsizer->SetFlexibleDirection(wxHORIZONTAL);
+ else if (dir == wxT("wxBOTH"))
+ fsizer->SetFlexibleDirection(wxBOTH);
+ else
+ {
+ ReportParamError
+ (
+ wxT("flexibledirection"),
+ wxString::Format("unknown direction \"%s\"", dir)
+ );
+ }
+ }
+
+ if (HasParam(wxT("nonflexiblegrowmode")))
+ {
+ wxString mode = GetParamValue(wxT("nonflexiblegrowmode"));
+
+ if (mode == wxT("wxFLEX_GROWMODE_NONE"))
+ fsizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_NONE);
+ else if (mode == wxT("wxFLEX_GROWMODE_SPECIFIED"))
+ fsizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
+ else if (mode == wxT("wxFLEX_GROWMODE_ALL"))
+ fsizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_ALL);
+ else
+ {
+ ReportParamError
+ (
+ wxT("nonflexiblegrowmode"),
+ wxString::Format("unknown grow mode \"%s\"", mode)
+ );
+ }
+ }
+}
+
+
void wxSizerXmlHandler::SetGrowables(wxFlexGridSizer* sizer,
const wxChar* param,
bool rows)
while (tkn.HasMoreTokens())
{
- unsigned long l;
- if (!tkn.GetNextToken().ToULong(&l))
+ wxString propStr;
+ wxString idxStr = tkn.GetNextToken().BeforeFirst(wxT(':'), &propStr);
+
+ unsigned long li;
+ if (!idxStr.ToULong(&li))
{
ReportParamError
(
param,
- "value must be comma-separated list of row numbers"
+ "value must be a comma-separated list of numbers"
);
break;
}
- const int n = static_cast<int>(l);
+ unsigned long lp = 0;
+ if (!propStr.empty())
+ {
+ if (!propStr.ToULong(&lp))
+ {
+ ReportParamError
+ (
+ param,
+ "value must be a comma-separated list of numbers"
+ );
+ break;
+ }
+ }
+
+ const int n = static_cast<int>(li);
if ( n >= nslots )
{
ReportParamError
}
if (rows)
- sizer->AddGrowableRow(n);
+ sizer->AddGrowableRow(n, static_cast<int>(lp));
else
- sizer->AddGrowableCol(n);
+ sizer->AddGrowableCol(n, static_cast<int>(lp));
}
}