views:

125

answers:

2

Hi all,

What's the best way to create a set of windows like in installers where you can click next/back and move between screens.

My idea is to define a class which holdes all the necessary 'current window' information, such as buttons, dialogue boxes and all that. And basically have the next/previous increment between displaying these boxes.

Smart idea or utterly retarded and there is a better way?

A: 

Instead of having different dialog boxes, why can't you update the one dialog depending on the previous state.

For Example:

  1. Login Screen -> User Enters the info and Submits
  2. Update the dialog to display the controls -> User clicks "Next"
  3. Update the screen depending upon the 2 step.

Mainly you should maintain the "Steps" array as state. And depending upon the previous state update the dialog by retrieving the state from the "Steps" array.

Vinay
-1, drawbacks e.g.: 1. Error prone to programatically build form contents 2. Makes it hard to have a visual/graphic department designing the UI.
sharkin
I don't think, I am doing this in MFC. It is not hard to create the controls at runtime and align them.
Vinay
+4  A: 

What you are describing is property sheets and property pages in wizard mode.

See Win32 description of property sheets/pages: http://msdn.microsoft.com/en-us/library/bb774540(VS.85).aspx

Are you using Win32 directly or MFC? If you are using MFC see the CPropertySheet and CPropertyPage classes.

dalle