tsc_WizardPage

This tsc_Form subclass is provided to allow easy wizard creation.  For each page in your wizard produce a subclass of this form and customise its appearance and function.  The tsc_WizardData object can be subclassed and additional member information can be added to share amongst your forms, you can access this data with the GetWizardData call.

You will need to pass in the data object to your first page - it will be shared with your subsequent pages automatically.

Ownership of new wizard pages (other than the first page) is transferred and the pages will be deleted.

Remember to call the base class event handlers if you override them when inheriting from this class.  In particular the softkey events will need to be passed into the base class - take care in intercepting the keys as they are not consistent between platforms.

Each page needs to override these functions, use them to validate/allow wizard actions as they are requested - note that these do not control appearance.

    virtual bool AllowNext  (); // Return true to allow.

    virtual bool AllowFinish(); // Return true to allow.

    virtual bool AllowCancel(); // Return true to allow.

    virtual bool AllowBack  (); // Return true to allow.

You must override this function to provide the next page in the wizard, note that you can return NULL to indicate that there is no further page.

The ownership of the page is transferred and it will be deleted when finished with.

    virtual tsc_WizardPage* GetNextPage();

You must override this function to set the UI state for the next button.

    virtual tsc_WizardButtons GetNextButtonState() const;

At initialization and while running you can call this function to update the buttons.

    void UpdateButtons();

You can optionally override this function to control the user's ability to cancel or go back.

    virtual tsc_WizardButtons GetBackButtonState() const;

Call these functions to perform wizard actions as a result of your own UI, events or timers.  Note that your event handlers (Allow<xxxx>) will not be called as a result of these functions.

    void ForceNext  (tsc_WizardPage* nextPage); // Push this page onto the stack and show it. Ownership is transferred and the form will be deleted.

    void ForceFinish();                         // Close this and all other pages in the wizard with success result.

    void ForceCancel();                         // Close this and all other pages in the wizard with abort result.

    void ForceBack  ();                         // Close the current page.

For example, to programmatically force a particular page to be started as next call:

this->ForceNext(new MyNextPage());

To do the same using whatever page the form intends to use next call:

this->ForceNext(this->GetNextPage());

And again but this time using the check to test to see if the form is ready:

if (this->AllowNext()) {     this->ForceNext(this->GetNextPage()); }