Sizer
 All Classes Files Functions Variables Enumerations Enumerator Pages
Classes | Public Member Functions | List of all members
BoxSizer Class Reference

Arranges items in a 1-dimensional box. More...

#include <Sizer.h>

Inheritance diagram for BoxSizer:
ISizer HBoxSizer VBoxSizer

Public Member Functions

 BoxSizer (bool pHorizontal)
 
virtual void OnCalcSizes ()
 
virtual void OnRectChanged (int x, int y, int w, int h)
 
virtual size_t GetItemCount ()
 
virtual ISizerGetItem (size_t i)
 
BoxSizerSetPadding (int pad)
 
BoxSizerSetOuterPadding (int pad)
 
BoxSizerAdd (ISizer *sizer, int proportion=0)
 
BoxSizerAdd (HWND window, int proportion=0)
 
BoxSizerAddStretchSpace (int proportion)
 
void RemoveAll ()
 
BoxSizerStretchItemInMinorDirection (bool stretch)
 
- Public Member Functions inherited from ISizer
void CalcSizes ()
 
SizerSize GetMinSize ()
 
void Move (int x, int y, int w, int h)
 
void Move (const SizerPoint &p, const SizerSize &s)
 
void Move (const SizerRect &r)
 
SizerRect GetRect () const
 
void WmSize (UINT type, int cx, int cy)
 
void WmGetMinMaxInfo (HWND window, MINMAXINFO *mmi)
 

Additional Inherited Members

- Protected Attributes inherited from ISizer
bool dirty
 
SizerRect rect
 
SizerSize minimumSize
 

Detailed Description

Arranges items in a 1-dimensional box.

Constructor & Destructor Documentation

BoxSizer::BoxSizer ( bool  pHorizontal)
Parameters
pHorizontalOrientation of the sizer, either horizontal or vertical.

Member Function Documentation

BoxSizer * BoxSizer::Add ( ISizer sizer,
int  proportion = 0 
)

Push a sizer to the end of the box.

Returns
A pointer to itself for method chaining.
BoxSizer* BoxSizer::Add ( HWND  window,
int  proportion = 0 
)
inline

Shortcut to add a window.

BoxSizer* BoxSizer::AddStretchSpace ( int  proportion)
inline

Better way of saying Add(NULL, proportion).

virtual ISizer* BoxSizer::GetItem ( size_t  i)
inlinevirtual
Parameters
iIndex of the sizer item to get. GetItemCount() returns the maximum for this index.

Reimplemented from ISizer.

virtual size_t BoxSizer::GetItemCount ( )
inlinevirtual
Returns
Number of sizer items contained by this sizer. Used in conjunction with GetItem().

Reimplemented from ISizer.

void BoxSizer::OnCalcSizes ( )
virtual

Calculates sizes, but does not move the sizer in any way.

Note
ISizer::minimumSize should be calculated here, because that's the place where it makes sense.

Implements ISizer.

void BoxSizer::OnRectChanged ( int  x,
int  y,
int  w,
int  h 
)
virtual

Moves the sizer and all children.

This function will always be called, even if the sizer is not dirty.

Implements ISizer.

void BoxSizer::RemoveAll ( )

Removes all items.

BoxSizer * BoxSizer::SetOuterPadding ( int  pad)

Set padding around this sizer.

Returns
A pointer to itself for method chaining.
BoxSizer * BoxSizer::SetPadding ( int  pad)

Set padding between items.

Returns
A pointer to itself for method chaining.
BoxSizer * BoxSizer::StretchItemInMinorDirection ( bool  stretch)

Default is True.

Parameters
stretchTrue if item should be stretch inside this sizer, False if items should keep their default size.

The documentation for this class was generated from the following files: