Skip to content
Permalink
Browse files

Sizers with growable columns or rows support the specification of the…

… proportion
  • Loading branch information...
sodevel committed Mar 23, 2019
1 parent 4bbedbc commit f49ea4459a7a00356c15bc33a988b81b56848109
Showing with 10 additions and 13 deletions.
  1. +2 −2 output/plugins/layout/xml/layout.xml
  2. +8 −11 plugins/layout/layout.cpp
@@ -114,8 +114,8 @@ Written by
<objectinfo class="flexgridsizerbase" icon="flex_grid_sizer.xpm" type="interface">
<property name="vgap" type="uint" help="The vertical gap (in pixels) between the cells in the sizer.">0</property>
<property name="hgap" type="uint" help="The horizontal gap (in pixels) between cells in the sizer.">0</property>
<property name="growablerows" type="uintlist" help="Comma separated list of row indices (starting from zero) that should be grown if there is extra space available to the sizer."/>
<property name="growablecols" type="uintlist" help="Comma separated list of column indices (starting from zero) that should be grown if there is extra space available to the sizer."/>
<property name="growablerows" type="uintpairlist" help="Comma separated list of row indices (starting from zero, optional proportion appended after a colon) that should be grown if there is extra space available to the sizer."/>
<property name="growablecols" type="uintpairlist" help="Comma separated list of column indices (starting from zero, optional proportion appended after a colon) that should be grown if there is extra space available to the sizer."/>
<property name="flexible_direction" type="option" help="Since wxWidgets 2.5.0, wxFlexGridSizer can size items equally in one direction but unequally ('flexibly') in the other" >
<option name="wxVERTICAL" help="Rows are flexibly sized." />
<option name="wxHORIZONTAL" help="Columns are flexibly sized." />
@@ -302,17 +302,14 @@ class FlexGridSizerBase : public ComponentBase
public:
void AddProperties( IObject* obj, wxFlexGridSizer* sizer )
{
wxArrayInt gcols, grows;
gcols = obj->GetPropertyAsArrayInt(_("growablecols"));
grows = obj->GetPropertyAsArrayInt(_("growablerows"));

unsigned int i;
for (i=0; i < gcols.GetCount() ; i++)
sizer->AddGrowableCol(gcols[i]);

for (i=0; i < grows.GetCount() ; i++)
sizer->AddGrowableRow(grows[i]);

for (const auto& col : obj->GetPropertyAsVectorIntPair(_("growablecols")))
{
sizer->AddGrowableCol(col.first, col.second);
}
for (const auto& row : obj->GetPropertyAsVectorIntPair(_("growablerows")))
{
sizer->AddGrowableRow(row.first, row.second);
}
sizer->SetMinSize( obj->GetPropertyAsSize(_("minimum_size")) );
sizer->SetFlexibleDirection( obj->GetPropertyAsInteger(_("flexible_direction")) );
sizer->SetNonFlexibleGrowMode( (wxFlexSizerGrowMode )obj->GetPropertyAsInteger(_("non_flexible_grow_mode")) );

0 comments on commit f49ea44

Please sign in to comment.
You can’t perform that action at this time.