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

DIALOG BOX QUESTIONS

Status
Not open for further replies.

hankm3

Programmer
Jan 27, 2002
284
US
Hello,

I'm working on my First Dialog Box and want to make sure I'm headed in the right direction. From the Documentation I have read, the ID Numbers are numbered 0-999 and so I numbered mine in order. Is this correct and also is there a good Style Number to begin playing with. I want all my Test selections to run in the Background and keep the Dialog Box on the Screen. One last thing. I want a small Box to store a Count of say the number of Lines in a File. Any suggestions are welcome.

Heres what I have so far.

Thanks

dialogbox 0 8 20 656 359 3 "VERSION 1.0"
groupbox 1 12 28 260 308 "TOOL SELECTION"
radiogroup 2 Var
radiobutton 3 19 55 96 12 "&OPEN TIP AND RINGS"
radiobutton 4 19 70 89 12 "&BUSY LINES"
radiobutton 5 19 85 102 12 "&LINE BUSY REVERSALS"
radiobutton 6 19 100 106 12 "&TIP AND/OR RING SHORTS"
radiobutton 7 19 115 100 12 "&HIGH VOLTAGE"
radiobutton 8 19 130 102 12 "&REVERSALS"
radiobutton 9 19 145 98 12 "&CROSSED TIP AND/OR RINGS"
radiobutton 10 19 160 122 12 "&GROUND START MISMATCHES"
radiobutton 11 19 175 158 12 "&ACCESS ( NO TEST TRUNK OLD / NEW )"
radiobutton 12 19 190 120 12 "&NEVER BEEN TESTED"
radiobutton 13 19 205 122 12 "&SOFTWARE TRANSLATIONS"
radiobutton 14 19 220 146 12 "&KNOWN TROUBLES ( EXCLUDE LIST )"
radiobutton 15 19 235 116 12 "&INTEGRATED SLC-96 FAMILY"
radiobutton 16 19 250 118 12 "&FILE BACKUP GENERATOR"
radiobutton 17 19 265 112 12 "&PURGE FILE HEADER"
radiobutton 18 19 280 113 12 "&MAKE FOMS TN INPUT FILE"
radiobutton 19 19 295 108 12 "&VIEW A FILE"
endgroup
dirlistbox 20 282 50 190 59 FnameVar1 SINGLE SelectVar1
text 21 282 34 186 11 "SOURCE FILE SELECTION" center
pushbutton 22 332 325 82 14 "START" OK
pushbutton 23 587 325 40 13 "EXIT" OK
pushbutton 24 579 4 58 13 "HELP"
text 25 288 191 49 9 "COUNT" center
enddialog
 
The numbering you use is not arbitrary, so your method is fine. It is whatever helps you keep them organized when you are adding your case statements for the dialog event.

Sometimes when I am working with dialog boxes where I continually add and delete options, I will label in ranges (e.g. - all my labels are 101 to 199, all my buttons are 201-299, etc.) so I can add as needed and still keep them organized.

My suggestion for the styles is that you exepriment with the features of each style to become familiar with it. If you stick with style 0 for you production testing you will have better control over the script. I have tried testing with other styles that you could not close easily and ended up having to reboot the whole machine to get my script to stop!
Robert Harris
Communications Advantage
 
When I design a dialog box larger than a few elements, I usually find it easier to use the Dialog Editor that ships with Procomm. This app is available via the Tools | Dialog Editor in the ASPECT Editor. This lets you visually create a dialog (somewhat like the corresponding tool in Visual C or Visual Basic), without having to worry quite so much about getting your syntax correct or referring to the help file. Once you are finished, you save your dialog to a .wud file, which you can use in an ASPECT script using the #include command. There is a little bit of a learning curve with the tool, but it's not too steep and will definitely help you out in the long run, especially if you find yourself creating a lot of dialogs.

As far as displaying a small box with the number of lines in a file, you could use a dialog box with a text control or edit box control whose value you update using the dlgupdate command. Here is a quick example I came up with that displays the initial value of sNumLines in a dialog box, then updates the dialog with an updated value.

proc main

string sNumLines = "25"

dialogbox 0 8 20 213 110 2 "Caption"
text 1 51 26 72 11 "Number of Lines:" left
text 2 128 26 34 11 sNumLines left
enddialog

pause 5
sNumLines = "30"
dlgupdate 0 2

while 1
yield
endwhile

endproc
 
Hello,

Took Knob's example and played with it. Came up with this.

proc main
string sNumLines = "1"
integer sNumber
integer c
clear
dialogbox 0 8 20 213 110 2 "Caption"
text 1 51 26 72 11 "Number of Lines:" left
text 2 128 26 34 11 sNumLines left
enddialog
pause 1
for c = 1 upto 25
pause 1
strtonum sNumlines sNumber
sNumber++
numtostr sNumber sNumlines
dlgupdate 0 2
endfor
termwrites sNumlines
termwrites "`n`r"
dlgdestroy 0 ok
endproc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top