Wizard Objects -
easy control of dialog flow

back to main page

Programming visual interfaces is quite complicated task. Visual Prolog VDE provides nice and easy tools to program user interface inside one dialog, but to implement complex interface with dialog sequence could be complex task.

Using Wizard Objects this task could be simplified by providing declarations for the dialog sequence and their flow.

To include Wizard object - open your project.inc file with VP Studio Setup utility and checkout necessary options:

Open your project and create custom control with the name "wizard_dialog".

Please use Visual Prolog VDE and create all necessary dialogs with necessary controls.

Define list of dialog elements in a form:

wizard_get_list(WIZARD_LIST):- % define dialog sequence

WIZARD1 = wizard(idd_first_wizard,"Stop...","Next >",dlg_first_wizard_eh),

WIZARD2 = wizard(idd_second_wizard,"< Back","Next >",dlg_second_wizard_eh),

WIZARD3 = wizard(idd_middle_dialog,"< Back","Next >",dlg_middle_dialog_eh),

WIZARD4 = wizard(idd_finish_dialog,"< Back","Stop...",dlg_finish_dialog_eh),

WIZARD_LIST = [WIZARD1,WIZARD2,WIZARD3,WIZARD4],!.

Define dialog logic flow in a form of :

wizard_navigation(WIN,DIRECTION, FROM,TO, STATUS)

Code sample from project:

wizard_navigation(_Win,back, idd_first_wizard,idd_first_wizard,[wsf_disabled]):-

dlg_note("Can't go back"),!.

wizard_navigation(_Win,next, idd_first_wizard,idd_second_wizard,[wsf_enabled]):-!.

wizard_navigation(_Win,back, idd_second_wizard,idd_first_wizard,[wsf_enabled]):-!.

wizard_navigation(_Win,next, idd_second_wizard,idd_middle_dialog,[wsf_enabled]):-!.

wizard_navigation(_Win,back, idd_middle_dialog,idd_second_wizard,[wsf_enabled]):-!.

wizard_navigation(_Win,next, idd_middle_dialog,idd_finish_dialog,[wsf_enabled]):-!.

wizard_navigation(_Win,back, idd_finish_dialog,idd_middle_dialog,[wsf_enabled]):-!.

wizard_navigation(_Win,next, idd_finish_dialog,idd_finish_dialog,[wsf_disabled]):-

dlg_note("This is finish"),!.

This project has been designed to implement programming technique, when several dialogs are used to guide user.

The use of such dialogs allow programmer to write individual dialogs using VPI GUI strategy, test them and integrate into one dialog or window.

(Download VIP 5.2 source project)

The sequence of appearing of the dialogs is controlled by one predicate, which defines where to go on NEXT/BACK button press.

Programmer can include it's own logical constrains to control dialog flow.


Copyright 1998-2000 EDMGROUP (Australia)

Last Updated: March 20, 2002