# wxGBSizerItem Class Reference
[Window Layout]

`#include </home/work/projects/wx/2.9/wx/interface/wx/gbsizer.h>`

Inheritance diagram for wxGBSizerItem:
[legend]

## Detailed Description

The wxGBSizerItem class is used by the wxGridBagSizer for tracking the items in the sizer.

It adds grid position and spanning information to the normal wxSizerItem by adding wxGBPosition and wxGBSpan attributes. Most of the time you will not need to use a wxGBSizerItem directly in your code, but there are a couple of cases where it is handy.

##

Library: wxCore
Category: Window Layout

## Public Member Functions

| wxGBSizerItem (int width, int height, const wxGBPosition &pos, const wxGBSpan &span, int flag, int border, wxObject *userData)
| Construct a sizer item for tracking a spacer.
| wxGBSizerItem (wxWindow *window, const wxGBPosition &pos, const wxGBSpan &span, int flag, int border, wxObject *userData)
| Construct a sizer item for tracking a window.
| wxGBSizerItem (wxSizer *sizer, const wxGBPosition &pos, const wxGBSpan &span, int flag, int border, wxObject *userData)
| Construct a sizer item for tracking a subsizer.
void | GetEndPos (int &row, int &col)
| Get the row and column of the endpoint of this item.
bool | Intersects (const wxGBSizerItem &other)
| Returns true if this item and the other item intersect.
bool | Intersects (const wxGBPosition &pos, const wxGBSpan &span)
| Returns true if the given pos/span would intersect with this item.
bool | SetPos (const wxGBPosition &pos)
| If the item is already a member of a sizer then first ensure that there is no other item that would intersect with this one at the new position, then set the new position.
bool | SetSpan (const wxGBSpan &span)
| If the item is already a member of a sizer then first ensure that there is no other item that would intersect with this one with its new spanning size, then set the new spanning.
wxGBPosition | GetPos () const
| Get the grid position of the item.
void | GetPos (int &row, int &col) const
| Get the grid position of the item.
wxGBSpan | GetSpan () const
| Get the row and column spanning of the item.
void | GetSpan (int &rowspan, int &colspan) const
| Get the row and column spanning of the item.

List of all members.

## Constructor & Destructor Documentation

wxGBSizerItem::wxGBSizerItem | ( | int | width,
|  | int | height,
|  | const wxGBPosition & | pos,
|  | const wxGBSpan & | span,
|  | int | flag,
|  | int | border,
|  | wxObject * | userData |
| ) |  |  |

Construct a sizer item for tracking a spacer.

wxGBSizerItem::wxGBSizerItem | ( | wxWindow * | window,
|  | const wxGBPosition & | pos,
|  | const wxGBSpan & | span,
|  | int | flag,
|  | int | border,
|  | wxObject * | userData |
| ) |  |  |

Construct a sizer item for tracking a window.

wxGBSizerItem::wxGBSizerItem | ( | wxSizer * | sizer,
|  | const wxGBPosition & | pos,
|  | const wxGBSpan & | span,
|  | int | flag,
|  | int | border,
|  | wxObject * | userData |
| ) |  |  |

Construct a sizer item for tracking a subsizer.

## Member Function Documentation

void wxGBSizerItem::GetEndPos | ( | int & | row,
|  | int & | col |
| ) |  |  |

Get the row and column of the endpoint of this item.

wxGBPosition wxGBSizerItem::GetPos | ( |  | ) | const

Get the grid position of the item.

void wxGBSizerItem::GetPos | ( | int & | row,
|  | int & | col |
| ) |  |  | const

Get the grid position of the item.

wxGBSpan wxGBSizerItem::GetSpan | ( |  | ) | const

Get the row and column spanning of the item.

void wxGBSizerItem::GetSpan | ( | int & | rowspan,
|  | int & | colspan |
| ) |  |  | const

Get the row and column spanning of the item.

bool wxGBSizerItem::Intersects | ( | const wxGBPosition & | pos,
|  | const wxGBSpan & | span |
| ) |  |  |

Returns true if the given pos/span would intersect with this item.

bool wxGBSizerItem::Intersects | ( | const wxGBSizerItem & | other | ) |

Returns true if this item and the other item intersect.

bool wxGBSizerItem::SetPos | ( | const wxGBPosition & | pos | ) |

If the item is already a member of a sizer then first ensure that there is no other item that would intersect with this one at the new position, then set the new position.

Returns true if the change is successful and after the next Layout the item will be moved.

bool wxGBSizerItem::SetSpan | ( | const wxGBSpan & | span | ) |

If the item is already a member of a sizer then first ensure that there is no other item that would intersect with this one with its new spanning size, then set the new spanning.

Returns true if the change is successful and after the next Layout the item will be resized.

|  | [ top ]