Class: Wx::GridSizer

Inherits:
Sizer show all
Defined in:
lib/wx/doc/gen/grid_sizer.rb

Overview

A grid sizer is a sizer which lays out its children in a two-dimensional table with all table fields having the same size, i.e.

the width of each field is the width of the widest child, the height of each field is the height of the tallest child.

Category: Window Layout

See Also:

Direct Known Subclasses

FlexGridSizer

Instance Method Summary collapse

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::GridSizer #initialize(cols, gap = (Wx::Size.new(0, 0))) ⇒ Wx::GridSizer #initialize(rows, cols, vgap, hgap) ⇒ Wx::GridSizer #initialize(rows, cols, gap) ⇒ Wx::GridSizer

Returns a new instance of GridSizer.

Overloads:

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

    Wx::GridSizer constructors.

    Usually only the number of columns in the flex grid sizer needs to be specified using cols argument. The number of rows will be deduced automatically depending on the number of the elements added to the sizer. If a constructor form with rows parameter is used (and the value of rows argument is not zero, meaning “unspecified”) the sizer will check that no more than cols*rows elements are added to it, i.e. that no more than the given number of rows is used. Adding less than maximally allowed number of items is not an error however. Finally, it is also possible to specify the number of rows and use 0 for cols. In this case, the sizer will use the given fixed number of rows and as many columns as necessary. The gap (or vgap and hgap, which correspond to the height and width of the Size object) argument defines the size of the padding between the rows (its vertical component, or vgap) and columns (its horizontal component, or hgap), in pixels.

    Parameters:

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

    Wx::GridSizer constructors.

    Usually only the number of columns in the flex grid sizer needs to be specified using cols argument. The number of rows will be deduced automatically depending on the number of the elements added to the sizer. If a constructor form with rows parameter is used (and the value of rows argument is not zero, meaning “unspecified”) the sizer will check that no more than cols*rows elements are added to it, i.e. that no more than the given number of rows is used. Adding less than maximally allowed number of items is not an error however. Finally, it is also possible to specify the number of rows and use 0 for cols. In this case, the sizer will use the given fixed number of rows and as many columns as necessary. The gap (or vgap and hgap, which correspond to the height and width of the Size object) argument defines the size of the padding between the rows (its vertical component, or vgap) and columns (its horizontal component, or hgap), in pixels.

    Parameters:

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

    Wx::GridSizer constructors.

    Usually only the number of columns in the flex grid sizer needs to be specified using cols argument. The number of rows will be deduced automatically depending on the number of the elements added to the sizer. If a constructor form with rows parameter is used (and the value of rows argument is not zero, meaning “unspecified”) the sizer will check that no more than cols*rows elements are added to it, i.e. that no more than the given number of rows is used. Adding less than maximally allowed number of items is not an error however. Finally, it is also possible to specify the number of rows and use 0 for cols. In this case, the sizer will use the given fixed number of rows and as many columns as necessary. The gap (or vgap and hgap, which correspond to the height and width of the Size object) argument defines the size of the padding between the rows (its vertical component, or vgap) and columns (its horizontal component, or hgap), in pixels.

    Parameters:

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

    Wx::GridSizer constructors.

    Usually only the number of columns in the flex grid sizer needs to be specified using cols argument. The number of rows will be deduced automatically depending on the number of the elements added to the sizer. If a constructor form with rows parameter is used (and the value of rows argument is not zero, meaning “unspecified”) the sizer will check that no more than cols*rows elements are added to it, i.e. that no more than the given number of rows is used. Adding less than maximally allowed number of items is not an error however. Finally, it is also possible to specify the number of rows and use 0 for cols. In this case, the sizer will use the given fixed number of rows and as many columns as necessary. The gap (or vgap and hgap, which correspond to the height and width of the Size object) argument defines the size of the padding between the rows (its vertical component, or vgap) and columns (its horizontal component, or hgap), in pixels.

    Parameters:

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


64
# File 'lib/wx/doc/gen/grid_sizer.rb', line 64

def initialize(*args) end

Instance Method Details

#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:



132
# File 'lib/wx/doc/gen/grid_sizer.rb', line 132

def calc_min; end

#get_colsInteger Also known as: cols

Returns the number of columns that has been specified for the sizer.

Returns zero if the sizer is automatically adjusting the number of columns depending on number of its children. To get the effective number of columns or rows being currently used, see #get_effective_cols_count

Returns:

  • (Integer)


70
# File 'lib/wx/doc/gen/grid_sizer.rb', line 70

def get_cols; end

#get_effective_cols_countInteger Also known as: effective_cols_count

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.

Returns:

  • (Integer)


84
# File 'lib/wx/doc/gen/grid_sizer.rb', line 84

def get_effective_cols_count; end

#get_effective_rows_countInteger Also known as: effective_rows_count

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.

Returns:

  • (Integer)


91
# File 'lib/wx/doc/gen/grid_sizer.rb', line 91

def get_effective_rows_count; end

#get_h_gapInteger Also known as: h_gap

Returns the horizontal gap (in pixels) between cells in the sizer.

Returns:

  • (Integer)


96
# File 'lib/wx/doc/gen/grid_sizer.rb', line 96

def get_h_gap; end

#get_rowsInteger Also known as: rows

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 #get_effective_rows_count.

Returns:

  • (Integer)


77
# File 'lib/wx/doc/gen/grid_sizer.rb', line 77

def get_rows; end

#get_v_gapInteger Also known as: v_gap

Returns the vertical gap (in pixels) between the cells in the sizer.

Returns:

  • (Integer)


101
# File 'lib/wx/doc/gen/grid_sizer.rb', line 101

def get_v_gap; 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)


140
# File 'lib/wx/doc/gen/grid_sizer.rb', line 140

def reposition_children(minSize) end

#set_cols(cols) ⇒ void Also known as: cols=

This method returns an undefined value.

Sets the number of columns in the sizer.

Parameters:

  • cols (Integer)


107
# File 'lib/wx/doc/gen/grid_sizer.rb', line 107

def set_cols(cols) end

#set_h_gap(gap) ⇒ void Also known as: h_gap=

This method returns an undefined value.

Sets the horizontal gap (in pixels) between cells in the sizer.

Parameters:

  • gap (Integer)


113
# File 'lib/wx/doc/gen/grid_sizer.rb', line 113

def set_h_gap(gap) end

#set_rows(rows) ⇒ void Also known as: rows=

This method returns an undefined value.

Sets the number of rows in the sizer.

Parameters:

  • rows (Integer)


119
# File 'lib/wx/doc/gen/grid_sizer.rb', line 119

def set_rows(rows) end

#set_v_gap(gap) ⇒ void Also known as: v_gap=

This method returns an undefined value.

Sets the vertical gap (in pixels) between the cells in the sizer.

Parameters:

  • gap (Integer)


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

def set_v_gap(gap) end