wxRuby Documentation Home

Wx::GridBagSizer

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.

Derived from

FlexGridSizer

GridSizer

Sizer

Object

Methods

GridBagSizer.new

GridBagSizer.new(Integer vgap = 0,  Integer hgap = 0)

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

GridBagSizer#add

SizerItem add(Window window,  GBPosition pos, 
                GBSpan span = DefaultSpan, 
                Integer flag = 0, 
                Integer border = 0, 
                Object userData = nil)
SizerItem add(Sizer sizer,  GBPosition pos, 
                GBSpan span = DefaultSpan, 
                Integer flag = 0, 
                Integer border = 0, 
                Object userData = nil)
SizerItem add(Integer width,  Integer height, 
                GBPosition pos, 
                GBSpan span = DefaultSpan, 
                Integer flag = 0, 
                Integer border = 0, 
                Object userData = nil)
SizerItem add(GBSizerItem item)

The Add methods return a valid pointer if the item was successfully placed at the given position, NULL if something was already there.

GridBagSizer#calc_min

Size calc_min()

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

GridBagSizer#check_for_intersection

Boolean check_for_intersection(GBSizerItem item, 
                               GBSizerItem excludeItem = nil)
Boolean check_for_intersection(GBPosition pos,  GBSpan span, 
                               GBSizerItem excludeItem = nil)

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.

GridBagSizer#find_item

GBSizerItem find_item(Window window)
GBSizerItem find_item(Sizer sizer)

Find the sizer item for the given window or subsizer, returns NULL if not found. (non-recursive)

GridBagSizer#find_item_at_point

GBSizerItem find_item_at_point(Point pt)

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)

GridBagSizer#find_item_at_position

GBSizerItem find_item_at_position(GBPosition pos)

Return the sizer item for the given grid cell, or NULL if there is no item at that position. (non-recursive)

GridBagSizer#find_item_with_data

GBSizerItem find_item_with_data(Object userData)

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

GridBagSizer#get_cell_size

Size get_cell_size(Integer row,  Integer col)

Get the size of the specified cell, including hgap and vgap. Only valid after a Layout.

GridBagSizer#get_empty_cell_size

Size get_empty_cell_size()

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

GridBagSizer#get_item_position

GBPosition get_item_position(Window window)
GBPosition get_item_position(Sizer sizer)
GBPosition get_item_position(Integer index)

Get the grid position of the specified item.

GridBagSizer#get_item_span

GBSpan get_item_span(Window window)
GBSpan get_item_span(Sizer sizer)
GBSpan get_item_span(Integer index)

Get the row/col spanning of the specified item

GridBagSizer#recalc_sizes

recalc_sizes()

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

GridBagSizer#set_empty_cell_size

set_empty_cell_size(Size sz)

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

GridBagSizer#set_item_position

Boolean set_item_position(Window window,  GBPosition pos)
Boolean set_item_position(Sizer sizer,  GBPosition pos)
Boolean set_item_position(Integer index,  GBPosition pos)

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.

GridBagSizer#set_item_span

Boolean set_item_span(Window window,  GBSpan span)
Boolean set_item_span(Sizer sizer,  GBSpan span)
Boolean set_item_span(Integer index,  GBSpan span)

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.

[This page automatically generated from the Textile source at Thu Aug 28 20:29:10 +0100 2008]