1.18.1.4.2 Wizard Dialog

This section describes how to open a wizard dialog in Origin C. The examples in this section will use an existing wizard dialog resource DLL that gets installed with Origin C's Developer Kit. The DLL can be found in this zip file, under \Dialog Builder\Wizard sub-folder.

To open a wizard dialog we need to first define some user-defined classes. We will need a class derived from the Dialog class, another derived from the WizardSheet class, and a class for each page derived from the PropertyPage class.

The WizardSheet::AddPathControl method is used to provide a wizard map which helps the user navigate through steps or pages of a wizard. The map also allows the user to skip to any page in the wizard by clicking on the map.

The first class we define is derived from the PropertyPage class. This first class will contain all the information shared by all the pages in the wizard.

class WizPage : public PropertyPage
{
protected:	
    WizardSheet* m_Sheet;
};

Now that we have defined our class based on PropertyPage we can define a class for handling each page in the wizard. These next classes will be derived from our page class defined above.

class WizPage1 : public WizPage
{
};

class WizPage2 : public WizPage
{
};

class WizPage3 : public WizPage
{
};

The next class to be defined is the place holder class. This class is derived from the WizardSheet class which in turn is derived from the PropertySheet class. This class will hold the instances of all our pages as data members.

class WizSheet : public WizardSheet
{
public:
    // Data members of PropertySheet are WizPage objects
    WizPage1 m_WizPage1;
    WizPage2 m_WizPage2;
    WizPage3 m_WizPage3;
};

With the definitions of all the pages and sheet classes completed we can now define our dialog class.

class WizPageDialog : public Dialog
{
public:
    // Constructor for main Dialog
    WizPageDialog(int ID) : Dialog(ID, "Wizard.DLL")
    {	
    }

    // Data member of main Dialog is PropertySheet (place holder)
    WizSheet m_Sheet;
};