Re: CPropertySheet - dynamic pages in wizard mode

Tech-Archive recommends: Fix windows errors by optimizing your registry



I am not sure why you would want to add a page dynamically after the ***
has been created when you have added a certain number during creation -
apart from the fact that the documentation may lead you to believe this is a
normal thing to do (which seems reasonable). As indicated already, AddPage
all of them and selectively provide Next and Prior according to your needs.
You have to know all the pages at coding time... so this is not an issue.

Another method that I considered using was a Tree or List / splitter / child
dialog forms with the List (or Tree) showing the currently active sequece of
'Tabs' to show however decided against it as while it would have been
informative, it would have provided the user with an excess of info. In this
case the Tree or List becomes the Selector for the form to show on the RHS
of the splitter. I have complete applications that use this as a UI (EG one
is an Asset Management system) where the Assets are shown in a tree on the
left with varying levels reflecting ownership / parent / child and also
branches by category of asset. When a node is selected the system shows the
appropriate form type (which is also tabbed) using child dialogs. Quite a
neat UI format.

Using dialogs as child windows opens many options for the UI in forms based
systems as you can use a very wide variety of methods of showing Menus,
Data, Actions, Reports etc in trees, menus, lists with splitters and the
child dialogs.

Another method that I use in the "Maintain xxx Form" variant - where the
Wizard does the Create of the xxx ojbect type. It is a Tabbed (non Wizard)
format where I put a Red X as the icon for tabs that are inappropriate for
this 'object' type and prevent the selection of these tabs using the
TCN_SELCHANGE message. Obviously not suitable in situations where the
majority of tabs may be inappropriate for a given object type.

- Tim



"Tim Ward" <tw2@xxxxxxxxxxxx> wrote in message
news:3qurncFgquhlU1@xxxxxxxxxxxxxxxxx
> "AliR" <AliR@xxxxxxxxxxxxx> wrote in message
> news:4346d5fc$1_3@xxxxxxxxxxxxxxxxxxxxx
>> I think what you are trying to avoid is have to recreate your pages over
> and
>> over because they will loose their states.
>> The only way I can see around the problem is to add all your pages at the
>> begining and use the SetActivePage in your Pages OnWizardNext method to
> skip
>> pages on some conditions.
>
> That works, provided that the complete set of possible pages is known at
> dialog creation time, which as it happens is the case for all my current
> set
> of wizards, so I've recoded it that way. Pity the documentation is wrong
> isn't it.
>
> This copes with
>
> - several pages based on the same dialog template
> - changing your mind about the order of pages and whether pages are
> skipped
> as the user progresses through the wizard
>
> I have seen a post somewhere that this method fails if you add pages
> dynamically rather that at dialog creation time, but I haven't tried this
> for myself so don't know whether that's true. None of my wizards currently
> requires this, I can always predict the maximal set of possible pages at
> creation time and create them all even if most of them end up never being
> used.
>
> --
> Tim Ward
> Brett Ward Limited - www.brettward.co.uk
>
>


.


Quantcast