Class: Wx::GridBagSizer

Inherits:
FlexGridSizer show all
Defined in:
lib/wx/doc/gen/grid_bag_sizer.rb

Overview

A Sizer that can lay out items in a virtual grid like a FlexGridSizer but in this case explicit positioning of the items is allowed using GBPosition, and items can optionally span more than one row and/or column using GBSpan.

Category: Window Layout

Instance Method Summary collapse

Methods inherited from FlexGridSizer

#add_growable_col, #add_growable_row, #get_col_widths, #get_flexible_direction, #get_non_flexible_grow_mode, #get_row_heights, #is_col_growable, #is_row_growable, #remove_growable_col, #remove_growable_row, #set_flexible_direction, #set_non_flexible_grow_mode

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_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(vgap = 0, hgap = 0) ⇒ Wx::GridBagSizer

Constructor, with optional parameters to specify the gap between the rows and columns.

Parameters:

  • vgap (Integer) (defaults to: 0)
  • hgap (Integer) (defaults to: 0)


167
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 167

def initialize(vgap=0, hgap=0) end

Instance Method Details

#add(window, pos, span = Wx::DEFAULT_SPAN, flag = 0, border = 0, userData = nil) ⇒ Wx::SizerItem #add(sizer, pos, span = Wx::DEFAULT_SPAN, flag = 0, border = 0, userData = nil) ⇒ Wx::SizerItem #add(width, height, pos, span = Wx::DEFAULT_SPAN, flag = 0, border = 0, userData = nil) ⇒ Wx::SizerItem

Overloads:

  • #add(window, pos, span = Wx::DEFAULT_SPAN, flag = 0, border = 0, userData = nil) ⇒ Wx::SizerItem

    Adds the given item to the given position.

    A valid pointer if the item was successfully placed at the given position, or NULL if something was already there.

    Parameters:

    Returns:

  • #add(sizer, pos, span = Wx::DEFAULT_SPAN, flag = 0, border = 0, userData = nil) ⇒ Wx::SizerItem

    Adds the given item to the given position.

    A valid pointer if the item was successfully placed at the given position, or NULL if something was already there.

    Parameters:

    Returns:

  • #add(width, height, pos, span = Wx::DEFAULT_SPAN, flag = 0, border = 0, userData = nil) ⇒ Wx::SizerItem

    Adds a spacer to the given position.

    width and height specify the dimension of the spacer to be added. A valid pointer if the spacer was successfully placed at the given position, or NULL if something was already there.

    Parameters:

    • width (Integer)
    • height (Integer)
    • pos (Wx::GBPosition)
    • span (Wx::GBSpan) (defaults to: Wx::DEFAULT_SPAN)
    • flag (Integer) (defaults to: 0)
    • border (Integer) (defaults to: 0)
    • userData (Object) (defaults to: nil)

    Returns:



54
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 54

def add(*args) end

#calc_minWx::Size

Called when the managed size of the sizer is needed or when layout needs done.

Returns:



171
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 171

def calc_min; end

#check_for_intersection(item, excludeItem = nil) ⇒ Boolean #check_for_intersection(pos, span, excludeItem = nil) ⇒ Boolean

Overloads:

  • #check_for_intersection(item, excludeItem = nil) ⇒ Boolean

    Look at all items and see if any intersect (or would overlap) the given item.

    Returns true if so, false if there would be no overlap. If an excludeItem is given then it will not be checked for intersection, for example it may be the item we are checking the position of.

    Parameters:

    Returns:

    • (Boolean)
  • #check_for_intersection(pos, span, excludeItem = nil) ⇒ Boolean

    Look at all items and see if any intersect (or would overlap) the given item.

    Returns true if so, false if there would be no overlap. If an excludeItem is given then it will not be checked for intersection, for example it may be the item we are checking the position of.

    Parameters:

    Returns:

    • (Boolean)


71
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 71

def check_for_intersection(*args) end

#find_item(window) ⇒ Wx::GBSizerItem #find_item(sizer) ⇒ Wx::GBSizerItem

Overloads:



85
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 85

def find_item(*args) end

#find_item_at_point(pt) ⇒ Wx::GBSizerItem

Return the sizer item located at the point given in pt, or NULL if there is no item at that point.

The (x,y) coordinates in pt correspond to the client coordinates of the window using the sizer for layout. (non-recursive)

Parameters:

Returns:



178
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 178

def find_item_at_point(pt) end

#find_item_at_position(pos) ⇒ Wx::GBSizerItem

Return the sizer item for the given grid cell, or NULL if there is no item at that position.

(non-recursive)

Parameters:

Returns:



185
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 185

def find_item_at_position(pos) end

#find_item_with_data(userData) ⇒ Wx::GBSizerItem

Return the sizer item that has a matching user data (it only compares pointer values) or NULL if not found.

(non-recursive)

Parameters:

Returns:



192
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 192

def find_item_with_data(userData) end

#get_cell_size(row, col) ⇒ Wx::Size Also known as: cell_size

Get the size of the specified cell, including hgap and vgap.

Only valid after window layout has been performed.

Parameters:

  • row (Integer)
  • col (Integer)

Returns:



200
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 200

def get_cell_size(row, col) end

#get_empty_cell_sizeWx::Size Also known as: empty_cell_size

Get the size used for cells in the grid with no item.

Returns:



205
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 205

def get_empty_cell_size; end

#get_item_position(window) ⇒ Wx::GBPosition #get_item_position(sizer) ⇒ Wx::GBPosition #get_item_position(index) ⇒ Wx::GBPosition Also known as: item_position

Overloads:



99
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 99

def get_item_position(*args) end

#get_item_span(window) ⇒ Wx::GBSpan #get_item_span(sizer) ⇒ Wx::GBSpan #get_item_span(index) ⇒ Wx::GBSpan Also known as: item_span

Overloads:

  • #get_item_span(window) ⇒ Wx::GBSpan

    Get the row/col spanning of the specified item.

    Parameters:

    Returns:

  • #get_item_span(sizer) ⇒ Wx::GBSpan

    Get the row/col spanning of the specified item.

    Parameters:

    Returns:

  • #get_item_span(index) ⇒ Wx::GBSpan

    Get the row/col spanning of the specified item.

    Parameters:

    • index (Integer)

    Returns:



114
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 114

def get_item_span(*args) end

#reposition_children(minSize) ⇒ void

This method returns an undefined value.

Called when the managed size of the sizer is needed or when layout needs done.

Parameters:

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


211
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 211

def reposition_children(minSize) end

#set_empty_cell_size(sz) ⇒ void Also known as: empty_cell_size=

This method returns an undefined value.

Set the size used for cells in the grid with no item.

Parameters:

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


216
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 216

def set_empty_cell_size(sz) end

#set_item_position(window, pos) ⇒ Boolean #set_item_position(sizer, pos) ⇒ Boolean #set_item_position(index, pos) ⇒ Boolean

Overloads:

  • #set_item_position(window, pos) ⇒ Boolean

    Set the grid position of the specified item.

    Returns true on success. If the move is not allowed (because an item is already there) then false is returned.

    Parameters:

    Returns:

    • (Boolean)
  • #set_item_position(sizer, pos) ⇒ Boolean

    Set the grid position of the specified item.

    Returns true on success. If the move is not allowed (because an item is already there) then false is returned.

    Parameters:

    Returns:

    • (Boolean)
  • #set_item_position(index, pos) ⇒ Boolean

    Set the grid position of the specified item.

    Returns true on success. If the move is not allowed (because an item is already there) then false is returned.

    Parameters:

    Returns:

    • (Boolean)


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

def set_item_position(*args) end

#set_item_span(window, span) ⇒ Boolean #set_item_span(sizer, span) ⇒ Boolean #set_item_span(index, span) ⇒ Boolean

Overloads:

  • #set_item_span(window, span) ⇒ Boolean

    Set the row/col spanning of the specified item.

    Returns true on success. If the move is not allowed (because an item is already there) then false is returned.

    Parameters:

    Returns:

    • (Boolean)
  • #set_item_span(sizer, span) ⇒ Boolean

    Set the row/col spanning of the specified item.

    Returns true on success. If the move is not allowed (because an item is already there) then false is returned.

    Parameters:

    Returns:

    • (Boolean)
  • #set_item_span(index, span) ⇒ Boolean

    Set the row/col spanning of the specified item.

    Returns true on success. If the move is not allowed (because an item is already there) then false is returned.

    Parameters:

    Returns:

    • (Boolean)


161
# File 'lib/wx/doc/gen/grid_bag_sizer.rb', line 161

def set_item_span(*args) end