Class: Wx::FlexGridSizer

Inherits:
GridSizer show all
Defined in:
lib/wx/doc/gen/flex_grid_sizer.rb

Overview

A flex grid sizer is a sizer which lays out its children in a two-dimensional table with all table fields in one row having the same height and all fields in one column having the same width, but all rows or all columns are not necessarily the same height or width as in the GridSizer.

Since wxWidgets 2.5.0, FlexGridSizer can also size items equally in one direction but unequally (“flexibly”) in the other. If the sizer is only flexible in one direction (this can be changed using #set_flexible_direction), it needs to be decided how the sizer should grow in the other (“non-flexible”) direction in order to fill the available space. The #set_non_flexible_grow_mode method serves this purpose.

Category: Window Layout

See Also:

Direct Known Subclasses

GridBagSizer

Instance Method Summary collapse

Methods inherited from GridSizer

#get_cols, #get_effective_cols_count, #get_effective_rows_count, #get_h_gap, #get_rows, #get_v_gap, #set_cols, #set_h_gap, #set_rows, #set_v_gap

Methods inherited from Sizer

#add, #add_spacer, #add_stretch_spacer, #clear, #compute_fitting_client_size, #compute_fitting_window_size, #detach, #each_child, #fit, #fit_inside, #get_children, #get_containing_window, #get_item, #get_item_by_id, #get_item_count, #get_min_size, #get_position, #get_size, #hide, #inform_first_direction, #insert, #insert_spacer, #insert_stretch_spacer, #is_empty, #layout, #prepend, #prepend_spacer, #prepend_stretch_spacer, #remove, #replace, #set_containing_window, #set_dimension, #set_item_min_size, #set_min_size, #set_size_hints, #show, #show_items

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initialize(cols, vgap, hgap) ⇒ Wx::FlexGridSizer #initialize(cols, gap = (Wx::Size.new(0, 0))) ⇒ Wx::FlexGridSizer #initialize(rows, cols, vgap, hgap) ⇒ Wx::FlexGridSizer #initialize(rows, cols, gap) ⇒ Wx::FlexGridSizer

Returns a new instance of FlexGridSizer.

Overloads:

  • #initialize(cols, vgap, hgap) ⇒ Wx::FlexGridSizer

    Wx::FlexGridSizer constructors.

    Please see GridSizer::GridSizer documentation.

    Parameters:

    • cols (Integer)
    • vgap (Integer)
    • hgap (Integer)
  • #initialize(cols, gap = (Wx::Size.new(0, 0))) ⇒ Wx::FlexGridSizer

    Wx::FlexGridSizer constructors.

    Please see GridSizer::GridSizer documentation.

    Parameters:

    • cols (Integer)
    • gap (Array(Integer, Integer), Wx::Size) (defaults to: (Wx::Size.new(0, 0)))
  • #initialize(rows, cols, vgap, hgap) ⇒ Wx::FlexGridSizer

    Wx::FlexGridSizer constructors.

    Please see GridSizer::GridSizer documentation.

    Parameters:

    • rows (Integer)
    • cols (Integer)
    • vgap (Integer)
    • hgap (Integer)
  • #initialize(rows, cols, gap) ⇒ Wx::FlexGridSizer

    Wx::FlexGridSizer constructors.

    Please see GridSizer::GridSizer documentation.

    Parameters:

    • rows (Integer)
    • cols (Integer)
    • gap (Array(Integer, Integer), Wx::Size)


52
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 52

def initialize(*args) end

Instance Method Details

#add_growable_col(idx, proportion = 0) ⇒ void

This method returns an undefined value.

Specifies that column idx (starting from zero) should be grown if there is extra space available to the sizer.

The proportion parameter has the same meaning as the stretch factor for the sizers (see BoxSizer) except that if all proportions are 0, then all columns are resized equally (instead of not being resized at all). Notice that the column must not be already growable, if you need to change the proportion you must call #remove_growable_col first and then make it growable (with a different proportion) again. You can use #is_col_growable to check whether a column is already growable.

Parameters:

  • idx (Integer)
  • proportion (Integer) (defaults to: 0)


61
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 61

def add_growable_col(idx, proportion=0) end

#add_growable_row(idx, proportion = 0) ⇒ void

This method returns an undefined value.

Specifies that row idx (starting from zero) should be grown if there is extra space available to the sizer.

This is identical to #add_growable_col except that it works with rows and not columns.

Parameters:

  • idx (Integer)
  • proportion (Integer) (defaults to: 0)


69
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 69

def add_growable_row(idx, proportion=0) end

#calc_minWx::Size

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.

Returns:



158
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 158

def calc_min; end

#get_col_widthsWx::ArrayInt Also known as: col_widths

Returns a read-only array containing the widths of the columns in the sizer.

Returns:

  • (Wx::ArrayInt)


143
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 143

def get_col_widths; end

#get_flexible_directionInteger Also known as: flexible_direction

Returns a Orientation value that specifies whether the sizer flexibly resizes its columns, rows, or both (default).

One of the following values:

Returns:

  • (Integer)

See Also:



80
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 80

def get_flexible_direction; end

#get_non_flexible_grow_modeWx::FlexSizerGrowMode Also known as: non_flexible_grow_mode

Returns the value that specifies how the sizer grows in the “non-flexible” direction if there is one.

The behaviour of the elements in the flexible direction (i.e. both rows and columns by default, or rows only if #get_flexible_direction is Orientation::VERTICAL or columns only if it is Orientation::HORIZONTAL) is always governed by their proportion as specified in the call to #add_growable_row or #add_growable_col. What happens in the other direction depends on the value of returned by this function as described below. One of the following values:



94
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 94

def get_non_flexible_grow_mode; end

#get_row_heightsWx::ArrayInt Also known as: row_heights

Returns a read-only array containing the heights of the rows in the sizer.

Returns:

  • (Wx::ArrayInt)


138
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 138

def get_row_heights; end

#is_col_growable(idx) ⇒ Boolean Also known as: col_growable?

Returns true if column idx is growable.

Parameters:

  • idx (Integer)

Returns:

  • (Boolean)


100
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 100

def is_col_growable(idx) end

#is_row_growable(idx) ⇒ Boolean Also known as: row_growable?

Returns true if row idx is growable.

Parameters:

  • idx (Integer)

Returns:

  • (Boolean)


106
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 106

def is_row_growable(idx) end

#remove_growable_col(idx) ⇒ void

This method returns an undefined value.

Specifies that the idx column index is no longer growable.

Parameters:

  • idx (Integer)


112
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 112

def remove_growable_col(idx) end

#remove_growable_row(idx) ⇒ void

This method returns an undefined value.

Specifies that the idx row index is no longer growable.

Parameters:

  • idx (Integer)


117
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 117

def remove_growable_row(idx) end

#reposition_children(minSize) ⇒ void

This method returns an undefined value.

Method which must be overridden in the derived sizer classes.

The implementation should reposition the children using the current total size available to the sizer (m_size) and the size computed by the last call to #calc_min. Note that you should never call this method directly, call Sizer#layout instead if you need to manually update the sizer elements positions. This method is only called by wxWidgets itself.

Parameters:

  • minSize (Array(Integer, Integer), Wx::Size)


152
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 152

def reposition_children(minSize) end

#set_flexible_direction(direction) ⇒ void Also known as: flexible_direction=

This method returns an undefined value.

Specifies whether the sizer should flexibly resize its columns, rows, or both.

Argument direction can be Orientation::VERTICAL, Orientation::HORIZONTAL or Orientation::BOTH (which is the default value). Any other value is ignored. See #get_flexible_direction for the explanation of these values. Note that this method does not trigger relayout.

Parameters:

  • direction (Integer)


125
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 125

def set_flexible_direction(direction) end

#set_non_flexible_grow_mode(mode) ⇒ void Also known as: non_flexible_grow_mode=

This method returns an undefined value.

Specifies how the sizer should grow in the non-flexible direction if there is one (so #set_flexible_direction must have been called previously).

Argument mode can be one of those documented in #get_non_flexible_grow_mode, please see there for their explanation. Note that this method does not trigger relayout.

Parameters:



133
# File 'lib/wx/doc/gen/flex_grid_sizer.rb', line 133

def set_non_flexible_grow_mode(mode) end