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.
ISizer.h
An interface for sizing dialog windows. | |
The ISizer constructor. | |
The ISizer destructor. | |
Creates the window layout. | |
The wxWindow to be sized. |
|
| virtual ~ISizer()=0 |
|
| wxWindow *mpWindow |