ISizer

An interface for sizing dialog windows.  ISizer is a workaround for the inability to call virtual functions from within a constructor.  All classes that are derived from wxBaseDialog must have a mechanism to size themselves correctly and layout their objects when created.  Ideally, this should happen in the constructor, and not in some other abritrary initialization function.  However, it is not possible to have a virtual function in the derived dialog classes be called in the constructor of wxBaseDialog.  The ISizer interface solves this problem.  Each wxBaseDialog-derived class must create its own Sizer, derived from ISizer, and pass it down to the wxBaseDialog constructor.  The constructor of wxBaseDialog takes an ISizer pointer as a parameter, and calls its CreateSizers function.  Since each ISizer must be created with the pointer to the dialog it belongs to, CreateSizers can then create all the sizing for the dialog while still in the base class constructor.

Project

UICore

Include

ISizer.h

Summary
An interface for sizing dialog windows.
The ISizer constructor.
The ISizer destructor.
Creates the window layout.
The wxWindow to be sized.

Public

Summary
The ISizer constructor.
The ISizer destructor.
Creates the window layout.

Constructors

ISizer

ISizer(wxWindow *window) : mpWindow(window)

The ISizer constructor.  The given wxWindow must be the window to be sized by ISizer.

Parameters

windowThe wxWindow to be sized in CreateSizers.

Destructor

~ISizer

virtual ~ISizer()=0

The ISizer destructor.  It is pure virtual because ISizer must be derived from to be used.

Pure Virtual Functions

CreateSizers

virtual void CreateSizers(wxBoxSizer *pSizer)=0

Creates the window layout.  Derived classes must supply this function to provide the layout needed for their dialog window.

Parameters

pSizerThe top level wxBoxSizer.  All subsequent sizers should be added as children to pSizer.

Protected

Summary
The wxWindow to be sized.

Variables

mpWindow

wxWindow *mpWindow

The wxWindow to be sized.

ISizer(wxWindow *window) : mpWindow(window)
The ISizer constructor.
virtual ~ISizer()=0
The ISizer destructor.
virtual void CreateSizers(wxBoxSizer *pSizer)=0
Creates the window layout.
wxWindow *mpWindow
The wxWindow to be sized.
A common base class for dialog boxes.
UICore provides a set of common UI controls that promote a constant look and feel across all aspects of the UI.