Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


How to have Multiple Dialog Boxes on the Screen

Keywords:     dialog editor dialog boxes

Question:

I would like to call a second dialog box pop up when a user selects an item in an itemlist, or when then hit a pushbutton. Can I do this?

Answer:

If you want to have multiple dialog boxes on the screen at the same time, you will have to run a separate Winbatch script for each one, because a single WinBatch program will wait for a Dialog box to close before it continues on with its code.

To have two WinBatch scripts running simultaneously, you can create the dialog in the second script and launch it with the RUN function just before your dialog editor code begins in your script.

Your second script could also be used to send keys to the first (for example, the second one could be used to select an item or push a button) and could be used to close the first dialogue when you're finished with the selection.

;mainscript
run("c:\seconddialog.wbt","")

MyDialog1Format=`WWWDLGED,5.0`

MyDialog1Caption=`dialog 1`
MyDialog1X=117
MyDialog1Y=161
MyDialog1Width=236
MyDialog1Height=75
MyDialog1NumControls=4

MyDialog101=`49,46,51,DEFAULT,PUSHBUTTON,DEFAULT,"OK",1`
MyDialog102=`107,46,51,DEFAULT,PUSHBUTTON,DEFAULT,"CANCEL",0`
MyDialog103=`24,3,200,DEFAULT,STATICTEXT,DEFAULT,"This is an example that shows how to have multiple dialogs."`
MyDialog104=`80,25,51,DEFAULT,PUSHBUTTON,DEFAULT,"Do stuff",3`

ButtonPushed=Dialog("MyDialog1")
;****************************************************************
;seconddialog.wbt
timedelay(1)
MyDialog2Format=`WWWDLGED,5.0`

MyDialog2Caption=`dialog 2`
MyDialog2X=32
MyDialog2Y=52
MyDialog2Width=144
MyDialog2Height=58
MyDialog2NumControls=3

MyDialog201=`6,35,51,DEFAULT,PUSHBUTTON,DEFAULT,"ok",1`
MyDialog202=`68,35,51,DEFAULT,PUSHBUTTON,DEFAULT,"Cancel",0`
MyDialog203=`43,11,51,DEFAULT,RADIOBUTTON,dostuff,"Do stuff here",4`

ButtonPushed=Dialog("MyDialog2")



Article ID:   W12852
Filename:   Multiple Dialog Boxes.txt