Jump to content
  • Advertisement
Sign in to follow this  
Magnus Olafson

A kind of wizard

This topic is 4320 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi there, i am about to code a little program - an RPG charcter generator (everything is ready except for GUI :( ). i want it to run as wizards do. i mean that one dialog window should be "replaced" by another one and so on, so that the user may go forward and backward through the whole process of his/her character generation. the problem is i have no idea yet, how to code that window "replacement" yet (always been staying off GUI and graphics :-\ ). could anyone be so kind and give me some clues about how to code this in c++/win32 or java? thanks a lot.

Share this post


Link to post
Share on other sites
Advertisement
The simplest way is to set up a panel (or other container component) as the wizard's content area on which you can stick the wizard pages. These pages can be other panels on which you've layed out the components needed for a specific page. Showing and hiding the components can then be done by removing the page component from the content area and adding a new one; in Java this can be done through the Controls (or Children?) collection of a container component IIRC.

In Java there's also a layoutmanager called CardLayout (or at least there used to be [smile]). By using this layoutmanager on your wizard's content panel, you can add all 'pages' to it at some index and then call showComponent (or something similar) with this index to display a specific page. I believe the docs for the CardLayout go into more detail about this, but it's been a long time since I've done anything with Java.

You also might want to check out CodeProject, they have some wizard component samples available. Google also seems to have some decent hits, like this article from Sun on creating wizards in Swing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!