Version: 3.1.0
wxGBSizerItem Class Reference

#include <wx/gbsizer.h>

+ Inheritance diagram for wxGBSizerItem:

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=wxDefaultSpan, int flag=0, int border=0, wxObject *userData=NULL)
 Construct a sizer item for tracking a spacer.
 
 wxGBSizerItem (wxWindow *window, const wxGBPosition &pos, const wxGBSpan &span=wxDefaultSpan, int flag=0, int border=0, wxObject *userData=NULL)
 Construct a sizer item for tracking a window.
 
 wxGBSizerItem (wxSizer *sizer, const wxGBPosition &pos, const wxGBSpan &span=wxDefaultSpan, int flag=0, int border=0, wxObject *userData=NULL)
 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.
 
wxGridBagSizerGetGBSizer () const
 
void SetGBSizer (wxGridBagSizer *sizer)
 
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.
 
- Public Member Functions inherited from wxSizerItem
 wxSizerItem (int width, int height, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL)
 Construct a sizer item for tracking a spacer.
 
virtual ~wxSizerItem ()
 Deletes the user data and subsizer, if any.
 
void AssignWindow (wxWindow *window)
 Set the window to be tracked by this item.
 
void AssignSizer (wxSizer *sizer)
 Set the sizer tracked by this item.
 
virtual wxSize CalcMin ()
 Calculates the minimum desired size for the item, including any space needed by borders.
 
virtual void DeleteWindows ()
 Destroy the window or the windows in a subsizer, depending on the type of item.
 
void DetachSizer ()
 Enable deleting the SizerItem without destroying the contained sizer.
 
int GetBorder () const
 Return the border attribute.
 
int GetFlag () const
 Return the flags attribute.
 
int GetId () const
 Return the numeric id of wxSizerItem, or wxID_NONE if the id has not been set.
 
wxSize GetMinSize () const
 Get the minimum size needed for the item.
 
void SetMinSize (const wxSize &size)
 Sets the minimum size to be allocated for this item.
 
void SetMinSize (int x, int y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
wxPoint GetPosition () const
 What is the current position of the item, as set in the last Layout.
 
int GetProportion () const
 Get the proportion item attribute.
 
float GetRatio () const
 Get the ration item attribute.
 
virtual wxRect GetRect ()
 Get the rectangle of the item on the parent window, excluding borders.
 
virtual wxSize GetSize () const
 Get the current size of the item, as set in the last Layout.
 
wxSizerGetSizer () const
 If this item is tracking a sizer, return it.
 
wxSize GetSpacer () const
 If this item is tracking a spacer, return its size.
 
wxObjectGetUserData () const
 Get the userData item attribute.
 
wxWindowGetWindow () const
 If this item is tracking a window then return it.
 
bool IsShown () const
 Returns true if this item is a window or a spacer and it is shown or if this item is a sizer and not all of its elements are hidden.
 
bool IsSizer () const
 Is this item a sizer?
 
bool IsSpacer () const
 Is this item a spacer?
 
bool IsWindow () const
 Is this item a window?
 
void SetBorder (int border)
 Set the border item attribute.
 
virtual void SetDimension (const wxPoint &pos, const wxSize &size)
 Set the position and size of the space allocated to the sizer, and adjust the position and size of the item to be within that space taking alignment and borders into account.
 
void SetFlag (int flag)
 Set the flag item attribute.
 
void SetId (int id)
 Sets the numeric id of the wxSizerItem to id.
 
void SetInitSize (int x, int y)
 
void SetProportion (int proportion)
 Set the proportion item attribute.
 
void SetSizer (wxSizer *sizer)
 Set the sizer tracked by this item.
 
void SetSpacer (const wxSize &size)
 Set the size of the spacer tracked by this item.
 
void SetUserData (wxObject *userData)
 
void SetWindow (wxWindow *window)
 Set the window to be tracked by this item.
 
void Show (bool show)
 Set the show item attribute, which sizers use to determine if the item is to be made part of the layout or not.
 
 wxSizerItem (wxWindow *window, const wxSizerFlags &flags)
 Construct a sizer item for tracking a window.
 
 wxSizerItem (wxWindow *window, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL)
 Construct a sizer item for tracking a window.
 
 wxSizerItem (wxSizer *sizer, const wxSizerFlags &flags)
 Construct a sizer item for tracking a subsizer.
 
 wxSizerItem (wxSizer *sizer, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL)
 Construct a sizer item for tracking a subsizer.
 
void AssignSpacer (const wxSize &size)
 Set the size of the spacer tracked by this item.
 
void AssignSpacer (int w, int h)
 Set the size of the spacer tracked by this item.
 
void SetRatio (int width, int height)
 Set the ratio item attribute.
 
void SetRatio (wxSize size)
 Set the ratio item attribute.
 
void SetRatio (float ratio)
 Set the ratio item attribute.
 
- Public Member Functions inherited from wxObject
 wxObject ()
 Default ctor; initializes to NULL the internal reference data.
 
 wxObject (const wxObject &other)
 Copy ctor.
 
virtual ~wxObject ()
 Destructor.
 
virtual wxClassInfoGetClassInfo () const
 This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar).
 
wxObjectRefDataGetRefData () const
 Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
 
bool IsKindOf (const wxClassInfo *info) const
 Determines whether this class is a subclass of (or the same class as) the given class.
 
bool IsSameAs (const wxObject &obj) const
 Returns true if this object has the same data pointer as obj.
 
void Ref (const wxObject &clone)
 Makes this object refer to the data in clone.
 
void SetRefData (wxObjectRefData *data)
 Sets the wxObject::m_refData pointer.
 
void UnRef ()
 Decrements the reference count in the associated data, and if it is zero, deletes the data.
 
void UnShare ()
 This is the same of AllocExclusive() but this method is public.
 
void operator delete (void *buf)
 The delete operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined.
 
void * operator new (size_t size, const wxString &filename=NULL, int lineNum=0)
 The new operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined.
 

Additional Inherited Members

- Protected Member Functions inherited from wxObject
void AllocExclusive ()
 Ensure that this object's data is not shared with any other object.
 
virtual wxObjectRefDataCreateRefData () const
 Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it.
 
virtual wxObjectRefDataCloneRefData (const wxObjectRefData *data) const
 Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data.
 
- Protected Attributes inherited from wxObject
wxObjectRefDatam_refData
 Pointer to an object which is the object's reference-counted data.
 

Constructor & Destructor Documentation

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

Construct a sizer item for tracking a spacer.

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

Construct a sizer item for tracking a window.

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

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.

wxGridBagSizer* wxGBSizerItem::GetGBSizer ( ) const
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 wxGBSizerItem other)

Returns true if this item and the other item intersect.

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

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

void wxGBSizerItem::SetGBSizer ( wxGridBagSizer sizer)
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.