One of the projects that I was working on at the time was an editor for an XML datafile. For simplicity sake, the file had a structure something like the following:
The goal of the program was to create an editor that could handle each child element. I created two forms, one named tBookWizardForm and another named tMovieWizardForm. Invoking these pages from the first page of the wizard looked something like the following:
NodeAware : IXmlNodeAware;
if Supports(fWizMgr.CurForm,IXmlNodeAware,NodeAware) then
Note in this example: The call to NavigateToPage automatically inserts the current page into the "to be deleted" list so there is no need to perform any manual cleanup.
The interface IXmlNodeAware actually exists in another unit which is shared by both wizard forms, it looks like the following:
IXmlNodeAware = interface
This would automatically perform the dispatch to the proper wizard form, if it ran into a node which it did not understand, it would generate an exception which would be handled and displayed by the wizard manager (displays a dialog that states that the requested form was not registered).
In my next post, I will cover SetAllowDeletion, and why one would need to use it.