Abstract interface for Sizers. More...
#include <Sizer.h>
Public Member Functions | |
virtual void | OnCalcSizes ()=0 |
virtual void | OnRectChanged (int x, int y, int w, int h)=0 |
virtual size_t | GetItemCount () |
virtual ISizer * | GetItem (size_t i) |
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) |
Protected Attributes | |
bool | dirty |
SizerRect | rect |
SizerSize | minimumSize |
Abstract interface for Sizers.
This class handles the stuff that must be done for every sizer. For example, delegating CalcSizes() calls to the items of a sizer. A new class just needs to override OnCalcSizes() and OnRectChanged() to be usable.
void ISizer::CalcSizes | ( | ) |
Starts size calculation if the sizer is dirty.
|
inlinevirtual |
i | Index of the sizer item to get. GetItemCount() returns the maximum for this index. |
Reimplemented in FlowSizer, GridSizer, VAlignSizer, HAlignSizer, BoxSizer, OverlapSizer, and GroupboxSizer.
|
inlinevirtual |
Reimplemented in FlowSizer, GridSizer, VAlignSizer, HAlignSizer, BoxSizer, OverlapSizer, and GroupboxSizer.
SizerSize ISizer::GetMinSize | ( | ) |
SizerRect ISizer::GetRect | ( | ) | const |
Read-only access to current rect of the sizer.
void ISizer::Move | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
Moves the sizer and all its items.
|
inline |
|
pure virtual |
Calculates sizes, but does not move the sizer in any way.
Implemented in FlowSizer, GridSizer, VAlignSizer, HAlignSizer, BoxSizer, OverlapSizer, GroupboxSizer, WindowSizer, and EmptySizer.
|
pure virtual |
Moves the sizer and all children.
This function will always be called, even if the sizer is not dirty.
Implemented in FlowSizer, GridSizer, VAlignSizer, HAlignSizer, BoxSizer, OverlapSizer, GroupboxSizer, WindowSizer, and EmptySizer.
|
inline |
Handle the WM_GETMINMAXINFO message.
|
inline |
Handle the WM_SIZE message.
|
protected |
CalcSizes() only does its work if the dirty flag is set. Subclasses should set the dirty flag when a parameter changes, e.g. a new sizer was added to a container, padding was changed, horizontal alignment was changed, etc.
|
protected |
Minimum size as calculated in OnCalcSizes(). This is needed for the layout algorithm.
|
protected |