Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I make a Wizard?

Status
Not open for further replies.

DJVisuaL

Programmer
May 31, 2000
52
US
VFP6.0

I need to make a wizard-like program...
There are several steps that need to be completed in order.
Steps cannot be skipped!

First I tryed to fit everything on one form.
Everything wouldn't fit! Plus there are some steps that need to be done before others so it was a mess.

Next I tryed to place controls in the same space and hide/show the controls of a particular step as needed at runtime. This became a mess in the form designer with a bunch of controls on top of each other all jumbled together.
So I abanded that approach

Next I tryed formsets which seemed perfect for this program.
Make a top level form and smaller forms inside for each step with no caption or border. Seemed workable. I made a "main" form as top level and planned to run each step form inside of it hiding/showing as needed. I couldn't get the forms for each step to show inside the main form. I had to make them "as" top level instead of "in" a top level form so then when they appeared they weren't part of the main form so if you moved the main form they stayed put.
So I gave up on formsets...

Then I tryed pageframes...
Place each step on a page and move between them as you go.
But the user could skip steps by clicking on the tabs of the later steps. So I turned the tabs off and re-compiled. Even though there were no tabs you can click where the tabs are supposed to be and guess what? Focus changes to that page LoL. Maybe a glitch in VFP? So my final solution was to move the pageframe up beyond the forms area so the tab portion would not be visible/clickable at all by the user. They would be behind the titlebar per say. This seems like a rigging approach but it will work I guess...

I thought about multiple forms but I need some common controls (next, back, etc..) that would have to be added to every form. Basically copies of the same buttons and if I ever had to change the code in one I'd have to go into every form and change it in all of the buttons.. another mess! :)

So I guess my question is.. is there an easier way? A better way? A faster way? A way that is not so... rigged?

thanks for reading this book ;)
 
Hi DJVisual,

Firstly, I prefer PageFrame. But I don't totally understand what is the problem you are facing about PageFrame.

Secondly, you could create class for those control. So that if anything changed, you could simply change in the class.
 
DJ,

I recently created a generic wizard class. I used a page frame, with hidden tabs (set the Tabs property to .F.). I put buttons for Forward, Back, Finish and Cancel. In the Click of the buttons, I wrote code to programmatically set the active page (or close the form in the case of Cancel).

Basically, it worked OK. I don't think my code is good enough to show you, but you might find the general technique useful.

Mike


Mike Lewis
Edinburgh, Scotland
 
Dear CSLAWTOM,

As U have suggested to create a class for the control. Well Sir I want the details regarding this and if U provide me with the usages then I will be more greatful.


Regards

Chandan
 
DJVisuaL

The source code for most VFP wizards is available in the xsource directory of your application.
E:\Visual Foxpro 7.0\Tools\xsource

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike Gagnon Sir,
Thanks for ur co-operation. I will follow ur suggestion.
And I will contact U Again

Regards

Chandan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top