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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Dialogboxes

Status
Not open for further replies.

MyFlight

Technical User
Feb 4, 2002
193
I have a Script that when run launches a Dialogbox with Push buttons. Depending on the Selection, another dialog box opens, etc. Hoever when I get to the 3rd Level, if I decdie to hit the Exit Button it Brings up another dialogbox. I wnat the script to just quit and destroy the Dialogbox whenever EXIT is hit. Here is the Script I currently have:

1st Dialog Box:

proc Main
integer Event
dialogbox 0 187 54 268 238 2 "Switch Vesion Selection Screen"
pushbutton 1 82 2 100 24 "9006 Version 6.2"
pushbutton 2 82 34 100 24 "9006 Version 6.3"
pushbutton 3 82 67 100 24 "9006 Version 6.4"
pushbutton 4 82 101 100 24 "9006 Version 6.5"
pushbutton 5 82 134 100 24 "9006 Version 6.6"
pushbutton 6 82 167 100 24 "HiPath"
pushbutton 7 109 202 50 28 "Exit" CANCEL
enddialog
while 1
dlgevent 0 Event
switch Event
case 0
endcase
case 1
execute "9006 Command Select62.wax"
disable DLGCTRL 0 1
endcase
case 2
execute "9006 Command Select63.wax"
disable DLGCTRL 0 2
endcase
case 3
execute "9006 Command Select64.wax"
disable DLGCTRL 0 3
endcase
case 4
execute "9006 Command Select65.wax"
disable DLGCTRL 0 4
endcase
case 5
execute "9006 Command Select66.wax"
disable DLGCTRL 0 5
endcase
case 6
execute "9006 Command SelectHP.wax"
disable DLGCTRL 0 6
endcase
default
exitwhile
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL
endproc

9006 Comman Select63.was Script File:

proc Main
integer Event
dialogbox 0 206 54 268 238 2 "Switch Commands"
pushbutton 21 82 2 100 24 "Activate LtDr"
pushbutton 22 82 34 100 24 "DeActive Patches"
pushbutton 23 82 67 100 24 "Direct AMO Switch Access"
pushbutton 24 82 101 100 24 "EMML Switch Access"
pushbutton 25 82 134 100 24 "ROOT Switch Access"
pushbutton 26 82 168 100 24 "Run REPORTS"
pushbutton 27 110 202 50 28 "Exit" CANCEL
enddialog
while 1
dlgevent 0 Event
switch Event
case 0
endcase
case 21
execute "9006 Activate LtDr.wax"
disable DLGCTRL 0 21
case 22
execute "9006 Patch DeActivate63.wax"
disable DLGCTRL 0 22
case 23
execute "DirectAmo63.wax"
disable DLGCTRL 0 23
case 24
execute "EMML63.wax"
disable DLGCTRL 0 24
case 25
execute "Root63.wax"
disable DLGCTRL 0 25
case 26
execute "9006 Report Selection63.wax"
disable DLGCTRL 0 26
endcase
default
exitwhile
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL
endproc

9006 DeActivate63.was Script:

proc Main
integer Event
dialogbox 0 190 96 266 132 3 "DeActivate Patches for Versions 6.3 & 6.4"
pushbutton 73 81 12 100 24 "PS10J50"
pushbutton 74 82 51 100 24 "PS10d96"
pushbutton 78 106 91 50 28 "Exit" CANCEL
enddialog
while 1
dlgevent 0 Event
switch Event
case 0
endcase
case 73
execute "9006 LtDr Ps10j50.wax"
disable DLGCTRL 0 73
case 74
execute "9006 LtDr ps10d96.wax"
disable DLGCTRL 0 74
endcase
default
exitwhile
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL
endproc



Here is the PushButton sequence I am Attempting.

First: PUSHBUTTON-2 (OPENS: 9006 Version 6.3 Dialog Box)
Second: PUSHBUTTON-22 (OPENS: DeActive Patches DialogBox)
Third: PUSHBUTTON-78 (EXIT Button)

When I hit the Exit Button at Level-1, or Level-2, the Dialogbox dissappears properly. However, when I get to Level-3, it opens the Following Dialogbox (which actullay belongs to PUSHBUTTON 26.

HELP
Any suggestions would be very helpful.
 
When I ran your scripts on my machine, I got the results you expected (hitting the Exit button in the DeActivate Patches in Version 6.3 & 6.4 dialog ended the script) without seeing any additional dialog boxes.
 
Knob,

Attached is the Script that is Running is is PUSHBUTTON-26 on the (9006 Comman Select63.was Script File)


9006 Report Selection63.wax SCRIPT FILE:

proc main
integer Event

dialogbox 0 187 54 268 238 2 "Switch Report Selection Screen"
pushbutton 111 82 2 100 24 "Analog Line Report"
pushbutton 112 82 34 100 24 "Capacity Study Report"
pushbutton 113 82 67 100 24 "Digital Line Report"
pushbutton 114 82 101 100 24 "Extension Line Report"
pushbutton 115 82 134 100 24 "Hardware Report"
pushbutton 116 82 167 100 24 "Trunk Line Report"
pushbutton 117 109 202 50 28 "Exit" CANCEL
enddialog
while 1
dlgevent 0 Event
switch Event
case 0
endcase
case 111
execute "Analog63.wax"
disable DLGCTRL 0 111
endcase
case 112
execute "Capacity63.wax"
disable DLGCTRL 0 112
endcase
case 113
execute "Digital63.wax"
disable DLGCTRL 0 113
endcase
case 114
execute "Extension63.wax"
disable DLGCTRL 0 114
endcase
case 115
execute "Hardware63.wax"
disable DLGCTRL 0 115
endcase
case 116
execute "Trunk63.wax"
disable DLGCTRL 0 116
endcase
default
exitwhile
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL
endproc

See if this makes a Difference. THANKS
 
Yep, I'm definitely seeing it now, but I'm not sure why yet. I'll keep working at it.
 
Is button 26 the only button you are seeing this problem with? Still haven't tracked down what is going on, this had better not keep me up too late tonight. I've tried commenting out all of the disable commands, renumbered the dialogs so each script is not using the same dialogbox id, renamed the event integers for each script, and still I'm seeing the problem.
 
Yes,

The Other PushButtons seem to work fine, even when I move to a 3rd level button.

 
In Your Last Case 117 insert an EXIT Case .. This should Force an Exit.

Just an Idea..

Hank
 
Well, I can't believe it took me so long to figure out what the problem was. There was no corresponding encase to the various case statements in 9006 Command Select63.was. This caused all cases after a succesful match to also be executed. When I matched an endcase statement with all case statements in that particular script, I got the results that you were expecting.
aspect@aspectscripting.com
 
Thanks Knob,

I can't believe that i miised that.
I guess I could not see the Forest for the Trees.

That or I just wasn't paying attention.
Thanks for catching my error, and for all the Time you put into this!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top