wxGridBagSizer Class Reference
[Window Layout]

#include <wx/gbsizer.h>

Inheritance diagram for wxGridBagSizer:

wxFlexGridSizer wxGridSizer wxSizer wxObject

List of all members.


Detailed Description

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

Library:  wxCore

Category:  Window Layout

Public Member Functions

 wxGridBagSizer (int vgap=0, int hgap=0)
wxSize CalcMin ()
wxGBSizerItemFindItemAtPoint (const wxPoint &pt)
wxGBSizerItemFindItemAtPosition (const wxGBPosition &pos)
wxGBSizerItemFindItemWithData (const wxObject *userData)
wxSize GetCellSize (int row, int col) const
wxSize GetEmptyCellSize () const
void RecalcSizes ()
void SetEmptyCellSize (const wxSize &sz)
wxSizerItemAdd (wxWindow *window, const wxGBPosition &pos, const wxGBSpan &span=wxDefaultSpan, int flag=0, int border=0, wxObject *userData=NULL)
wxSizerItemAdd (wxSizer *sizer, const wxGBPosition &pos, const wxGBSpan &span=wxDefaultSpan, int flag=0, int border=0, wxObject *userData=NULL)
wxSizerItemAdd (int width, int height, const wxGBPosition &pos, const wxGBSpan &span=wxDefaultSpan, int flag=0, int border=0, wxObject *userData=NULL)
wxSizerItemAdd (wxGBSizerItem *item)
bool CheckForIntersection (wxGBSizerItem *item, wxGBSizerItem *excludeItem=NULL)
bool CheckForIntersection (const wxGBPosition &pos, const wxGBSpan &span, wxGBSizerItem *excludeItem=NULL)
wxGBSizerItemFindItem (wxWindow *window)
wxGBSizerItemFindItem (wxSizer *sizer)
wxGBPosition GetItemPosition (wxWindow *window)
wxGBPosition GetItemPosition (wxSizer *sizer)
wxGBPosition GetItemPosition (size_t index)
wxGBSpan GetItemSpan (wxWindow *window)
wxGBSpan GetItemSpan (wxSizer *sizer)
wxGBSpan GetItemSpan (size_t index)
bool SetItemPosition (wxWindow *window, const wxGBPosition &pos)
bool SetItemPosition (wxSizer *sizer, const wxGBPosition &pos)
bool SetItemPosition (size_t index, const wxGBPosition &pos)
bool SetItemSpan (wxWindow *window, const wxGBSpan &span)
bool SetItemSpan (wxSizer *sizer, const wxGBSpan &span)
bool SetItemSpan (size_t index, const wxGBSpan &span)

Constructor & Destructor Documentation

wxGridBagSizer::wxGridBagSizer ( int  vgap = 0,
int  hgap = 0 
)

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


Member Function Documentation

wxSizerItem* wxGridBagSizer::Add ( wxWindow window,
const wxGBPosition pos,
const wxGBSpan span = wxDefaultSpan,
int  flag = 0,
int  border = 0,
wxObject userData = NULL 
)

Adds the given item to the given position.

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

wxSizerItem* wxGridBagSizer::Add ( wxSizer sizer,
const wxGBPosition pos,
const wxGBSpan span = wxDefaultSpan,
int  flag = 0,
int  border = 0,
wxObject userData = NULL 
)

Adds the given item to the given position.

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

wxSizerItem* wxGridBagSizer::Add ( int  width,
int  height,
const wxGBPosition pos,
const wxGBSpan span = wxDefaultSpan,
int  flag = 0,
int  border = 0,
wxObject userData = NULL 
)

Adds the given item to the given position.

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

wxSizerItem* wxGridBagSizer::Add ( wxGBSizerItem item  ) 

Adds the given item to the given position.

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

wxSize wxGridBagSizer::CalcMin (  )  [virtual]

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

Reimplemented from wxSizer.

bool wxGridBagSizer::CheckForIntersection ( wxGBSizerItem item,
wxGBSizerItem excludeItem = NULL 
)

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.

bool wxGridBagSizer::CheckForIntersection ( const wxGBPosition pos,
const wxGBSpan span,
wxGBSizerItem excludeItem = NULL 
)

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.

wxGBSizerItem* wxGridBagSizer::FindItem ( wxWindow window  ) 

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

wxGBSizerItem* wxGridBagSizer::FindItem ( wxSizer sizer  ) 

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

wxGBSizerItem* wxGridBagSizer::FindItemAtPoint ( const wxPoint 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)

wxGBSizerItem* wxGridBagSizer::FindItemAtPosition ( const wxGBPosition pos  ) 

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

wxGBSizerItem* wxGridBagSizer::FindItemWithData ( const wxObject userData  ) 

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

wxSize wxGridBagSizer::GetCellSize ( int  row,
int  col 
) const

Get the size of the specified cell, including hgap and vgap. Only valid after window layout has been performed.

wxSize wxGridBagSizer::GetEmptyCellSize (  )  const

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

wxGBPosition wxGridBagSizer::GetItemPosition ( wxWindow window  ) 

Get the grid position of the specified item.

wxGBPosition wxGridBagSizer::GetItemPosition ( wxSizer sizer  ) 

Get the grid position of the specified item.

wxGBPosition wxGridBagSizer::GetItemPosition ( size_t  index  ) 

Get the grid position of the specified item.

wxGBSpan wxGridBagSizer::GetItemSpan ( wxWindow window  ) 

Get the row/col spanning of the specified item.

wxGBSpan wxGridBagSizer::GetItemSpan ( wxSizer sizer  ) 

Get the row/col spanning of the specified item.

wxGBSpan wxGridBagSizer::GetItemSpan ( size_t  index  ) 

Get the row/col spanning of the specified item.

void wxGridBagSizer::RecalcSizes (  )  [virtual]

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

Reimplemented from wxSizer.

void wxGridBagSizer::SetEmptyCellSize ( const wxSize sz  ) 

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

bool wxGridBagSizer::SetItemPosition ( wxWindow window,
const wxGBPosition 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.

bool wxGridBagSizer::SetItemPosition ( wxSizer sizer,
const wxGBPosition 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.

bool wxGridBagSizer::SetItemPosition ( size_t  index,
const wxGBPosition 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.

bool wxGridBagSizer::SetItemSpan ( wxWindow window,
const wxGBSpan 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.

bool wxGridBagSizer::SetItemSpan ( wxSizer sizer,
const wxGBSpan 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.

bool wxGridBagSizer::SetItemSpan ( size_t  index,
const wxGBSpan 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.



wxWidgets logo

[ top ]