home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 26
/
CD_ASCQ_26_1295.iso
/
vrac
/
dlghelp.zip
/
DLGDEMO.ZIP
/
DLGDEMO.SC
< prev
next >
Wrap
Text File
|
1995-09-26
|
21KB
|
654 lines
PROC dlgdemo()
WHILE true
SHOWPULLDOWN
"Tools" : "Dialog Box Generation Tools" : "Tools"
SUBMENU
"Push Button" : "Push Buttons and Text Only" : "Push",
"Accept" : "Type-in Boxes and Push Buttons" : "Accept",
"Check Box" : "Check Boxes" : "Check",
"Radio Button" : "Radio Buttons" : "Radio",
"Pic~k~list" : "Picklist, Type-in Box, Push Buttons" : "Pick",
"Message Window" : "Non-modal, 18 Lines of Text" : "MsgWin"
ENDSUBMENU,
"Utilities" : "Dialog Box Utilities" : "Utilities"
SUBMENU
"C~l~ock" : "Running Clock" : "Clock",
"Color" : "Color Selection" : "Color",
"Export" : "Export Table" : "Export",
"Find Record" : "Search" : "Find",
"Search & ~R~eplace" : "Search and Replace" : "SR",
"System Info" : "System Information" : "SysInfo"
ENDSUBMENU,
"Register" : "Enter Registration Password to Unprotect Scripts" : "Register",
"About" : "About dlgHELP 1.0 and dlgHELP Demo" : "About",
"Help" : "How to use dlgHELP Demo" : "Help",
"Exit" : "Quit Demo" : "Exit"
ENDMENU
ECHO NORMAL
ECHO OFF
Splash()
GETMENUSELECTION KEYTO KeyVar TO MenuItem
WINDOW SELECT splashhandle
WINDOW CLOSE
SWITCH
CASE MenuItem="Push" : Tool(1)
CASE MenuItem="Accept" : Tool(2)
CASE MenuItem="Check" : Tool(3)
CASE MenuItem="Radio" : Tool(4)
CASE MenuItem="Pick" : Tool(5)
CASE MenuItem="MsgWin" : Tool(6)
CASE MenuItem="Clock" : Clock()
CASE MenuItem="Color" : Color()
CASE MenuItem="Export" : Export()
CASE MenuItem="Find" : Srch()
CASE MenuItem="SR" : SrchAndRep()
CASE MenuItem="SysInfo" : SysInf()
CASE MenuItem="Register":
if isfile("Register.sc") then
PLAY "Register"
else
pushdlg("File Not Found","Registration script not in current directory","OK","H",0,0,"")
endif
CASE MenuItem="About" : About()
CASE MenuItem="Help" : HelpMe()
CASE MenuItem="Exit" : QUIT
ENDSWITCH
ENDWHILE
endproc
Proc Splash()
PRIVATE splashwinatt
DYNARRAY splashwinatt[]
splashwinatt["CANVASHEIGHT"]=15
splashwinatt["CANVASWIDTH"]=63
splashwinatt["FLOATING"]=True
splashwinatt["HEIGHT"]=17
splashwinatt["WIDTH"]=65
splashwinatt["ORIGINROW"]=5
splashwinatt["ORIGINCOL"]=7
splashwinatt["HASFRAME"]=False
splashwinatt["CANMOVE"]=False
splashwinatt["CANCLOSE"]=False
splashwinatt["ECHO"]=True
splashwinatt["HASSHADOW"]=True
blackOnLightGray=112
blueOnLightGray=113
redOnLightGray=116
lightRedOnLightGray=124
yellowOnLightGray=126
whiteOnLightGray=127
yellowOnLightGrayBlinking=254
WINDOW CREATE ATTRIBUTES splashwinatt TO splashhandle
PAINTCANVAS ATTRIBUTE blackOnLightGray ALL
STYLE ATTRIBUTE blackOnLightGray
@ 3 , 6 ?? " █ "
@ 4 , 6 ?? " ▐▐█ "
@ 5 , 6 ?? " ▐▐ ██ "
@ 6 , 6 ?? " ▐▐ ██ "
@ 7 , 6 ?? " ▐▐ ██ "
@ 8 , 6 ?? " ▐▐ ██ "
@ 9 , 6 ?? " ▐▐▐▐ ████ "
@ 10, 6 ?? " ▐▐▐▐▐▐ ██████ "
@ 11, 6 ?? "▐▐▐▐▐▐▐▐ ████████ "
Style Attribute yellowOnLightGrayBlinking
@ 5,14 ?? "░"
@ 6,13 ?? "░▒░"
@ 7,12 ?? "░▒▓▒░"
@ 8,11 ?? "░▒▓█▓▒░"
@ 9,12 ?? "░▒▓▒░"
@ 10,13?? "░▒░"
@ 11,14?? "░"
Style Attribute lightRedOnLightGray
@ 6,14 ?? "▒"
@ 7,13 ?? "▒▒▒"
@ 8,12 ?? "▒▒█▒▒"
@ 9,13 ?? "▒▓▒"
@10,14 ?? "▒"
Style Attribute redOnLightGray
@ 7,14 ?? "▒"
@ 8,13 ?? "▒█▒"
Style Attribute blueOnLightGray
@ 8,14 ?? "█"
@ 9,14 ?? "▒"
@10,14 ?? "▒"
Style Attribute redOnLightGray
@ 4, 31 ?? Format("AC,W23","Demo For dlgHELP 1.0a")
Style Attribute yellowOnLightGray
@ 5, 31 ?? Format("AC,W23","A Library of Dialog Box")
@ 6, 31 ?? Format("AC,W23","Tools and Utilities")
Style Attribute blueOnLightGray
@ 8, 31 ?? Format("AC,W22","Developed By")
@ 9, 31 ?? Format("AC,W22","William A. Bailey, Jr.")
@ 10, 31 ?? Format("AC,W22","Copyright 1995")
STYLE ATTRIBUTE blackOnLightGray
FRAME DOUBLE FROM 0,0 TO 14, 62
PAINTCANVAS BORDER ATTRIBUTE whiteOnLightGray 0,0,14,62
FRAME SINGLE FROM 2,4 TO 12,24
PAINTCANVAS ATTRIBUTE whiteOnLightGray 2,4,2,23
PAINTCANVAS ATTRIBUTE whiteOnLightGray 2,4,12,4
FRAME SINGLE FROM 2,26 TO 12,58
PAINTCANVAS ATTRIBUTE whiteOnLightGray 2,26,2,57
PAINTCANVAS ATTRIBUTE whiteOnLightGray 2,26,12,26
FRAME SINGLE FROM 7,29 TO 11,54
PAINTCANVAS ATTRIBUTE whiteOnLightGray 11,30,11,54
PAINTCANVAS ATTRIBUTE whiteOnLightGray 7,54,11,54
Endproc
Proc Tool(toolNumber)
DYNARRAY wa_bag[]
wa_bag["HASFRAME"]=FALSE
wa_bag["MAXIMIZED"]=TRUE
wa_bag["CANVASHEIGHT"]=25
wa_bag["CANVASWIDTH"]=80
SHOWPULLDOWN ENDMENU
PROMPT "Press [F2] to generate dialog box, [Esc] to cancel..."
EDIT "demobox"
pickform toolnumber
WINDOW HANDLE FORM TO MasterFileHandle
WINDOW SETATTRIBUTES MasterFileHandle FROM wa_bag
while true
if sysmode()<>"Edit" then EDITKEY endif
IF TABLE()="Demobox" then
WAIT RECORD
UNTIL "Esc", "F2", "F3", "F4", "Tab"
ELSE
WAIT TABLE
UNTIL "Esc", "F2", "F3", "F4", "Tab"
ENDIF
switch
case retval="F2" :
DO_IT!
switch
case toolnumber=1:
moveto "demobox"
if isempty(table()) then
pushdlg("Missing Data","No data has been entered","~O~K","H",0,0,"Black")
loop
endif
boxtitle=[Box Title]
align=[Align]
r=[r]
c=[c]
textcolor=[textcolor]
moveto "msgline"
if isempty(table()) then
msg=""
else
array msg[nimagerecords()]
i=0
scan
i=i+1
msg[i]=[msgline->Text Line]
endscan
endif
moveto "label"
if isempty(table()) then
pushdlg("Missing Data","Must enter button label(s)","~O~K","H",0,0,"Black")
loop
endif
array bl[nimagerecords()]
i=0
scan
i=i+1
bl[i]=[Label]
endscan
CLEARALL
PROMPT ""
echo normal
echo off
pushdlg(boxtitle,msg,bl,align,r,c,textcolor)
pushdlg("Global Variable Settings","buttonvalue= "+buttonvalue,"OK","H",0,0,"Black")
case toolnumber=2:
moveto "demobox"
if isempty(table()) then
pushdlg("Missing Data","No data has been entered","~O~K","H",0,0,"Black")
loop
endif
boxtitle=[Box Title]
r=[r]
c=[c]
textcolor=[textcolor]
moveto "accept"
if isempty(table()) then
pushdlg("Missing Data","Must enter type-in box label(s)","~O~K","H",0,0,"Black")
loop
endif
array al[nimagerecords()]
array aw[nimagerecords()]
array gv[nimagerecords()+1]
i=0
x=false
scan
i=i+1
if isblank([accept->Label]) or isblank([accept->Width]) then
pushdlg("Missing Data","Type-in box label or width cannot be blank","~O~K","H",0,0,"Black")
x=true
quitloop
endif
al[i]=[accept->Label]
aw[i]=[accept->Width]
endscan
if x then loop endif
moveto "label"
if isempty(table()) then
pushdlg("Missing Data","Must enter button label(s)","~O~K","H",0,0,"Black")
loop
endif
array bl[nimagerecords()]
i=0
scan
i=i+1
bl[i]=[Label]
endscan
CLEARALL
PROMPT ""
echo normal
echo off
acceptdlg(boxtitle,al,aw,bl,r,c,textcolor)
for i from 1 to arraysize(al)
gv[i]="acceptvalue["+strval(i)+"]= "+strval(acceptvalue[i])
endfor
gv[arraysize(gv)]="buttonvalue= "+buttonvalue
pushdlg("Global Variable Settings",gv,"OK","H",0,0,"Black")
case toolnumber=3:
moveto "demobox"
if isempty(table()) then
pushdlg("Missing Data","No data has been entered","~O~K","H",0,0,"Black")
loop
endif
boxtitle=[Box Title]
r=[r]
c=[c]
textcolor=[textcolor]
frametitle=[Frame Title]
checkrows=[rows]
moveto "check"
if isempty(table()) then
pushdlg("Missing Data","Must enter check box label(s)","~O~K","H",0,0,"Black")
loop
endif
array bl[nimagerecords()]
array gv[nimagerecords()+1]
i=0
scan
i=i+1
bl[i]=[Label]
endscan
CLEARALL
PROMPT ""
echo normal
echo off
checkdlg(boxtitle,frametitle,bl,checkrows,r,c,textcolor)
for i from 1 to arraysize(bl)
gv[i]="checkvalue["+strval(i)+"]= "+strval(checkvalue[i])
endfor
gv[arraysize(gv)]="buttonvalue= "+buttonvalue
pushdlg("Global Variable Settings",gv,"OK","H",0,0,"Black")
case toolnumber=4:
moveto "demobox"
if isempty(table()) then
pushdlg("Missing Data","No data has been entered")
loop
endif
boxtitle=[Box Title]
r=[r]
c=[c]
textcolor=[textcolor]
frametitle=[Frame Title]
radiorows=[rows]
moveto "check"
if isempty(table()) then
pushdlg("Missing Data","Must enter radio button label(s)","~O~K","H",0,0,"Black")
loop
endif
array bl[nimagerecords()]
i=0
scan
i=i+1
bl[i]=[Label]
endscan
CLEARALL
PROMPT ""
echo normal
echo off
radiodlg(boxtitle,frametitle,bl,radiorows,r,c,textcolor)
array gv[2]
gv[1]="radiovalue = "+strval(radiovalue)
gv[2]="buttonvalue= "+buttonvalue
pushdlg("Global Variable Settings",gv,"OK","H",0,0,"Black")
case toolnumber=5:
moveto "demobox"
if isempty(table()) then
pushdlg("Missing Data","No data has been entered","~O~K","H",0,0,"Black")
loop
endif
boxtitle=[Box Title]
align=[align]
r=[r]
c=[c]
textcolor=[textcolor]
frametitle=[Frame Title]
acceptlabel=[Accept Label]
pickrows=[rows]
pickcolumns=[columns]
moveto "label"
if isempty(table()) then
pushdlg("Missing Data","Must enter button label(s)","~O~K","H",0,0,"Black")
loop
endif
array bl[nimagerecords()]
i=0
scan
i=i+1
bl[i]=[Label]
endscan
moveto "picklist"
if isempty(table()) then
pushdlg("Missing Data","Must enter picklist value(s)","~O~K","H",0,0,"Black")
loop
endif
array pl[nimagerecords()]
i=0
scan
i=i+1
pl[i]=[List Selection]
endscan
CLEARALL
PROMPT ""
echo normal
echo off
pickdlg(boxtitle,frametitle,acceptlabel,pl,bl,pickrows,pickcolumns,align,r,c,textcolor)
array gv[3]
gv[1]="acceptvalue= "+strval(acceptvalue)
gv[2]="pickvalue = "+strval(pickvalue)
gv[3]="buttonvalue= "+buttonvalue
pushdlg("Global Variable Settings",gv,"OK","H",0,0,"Black")
case toolnumber=6:
moveto "demobox"
if isempty(table()) then
pushdlg("Missing Data","No data has been entered","~O~K","H",0,0,"Black")
loop
endif
boxtitle=[Box Title]
moveto "msgline"
if isempty(table()) then
pushdlg("Missing Data","Must enter message line(s)","~O~K","H",0,0,"Black")
loop
endif
array msg[nimagerecords()]
i=0
scan
i=i+1
msg[i]=[msgline->Text Line]
endscan
CLEARALL
PROMPT ""
echo normal
echo off
msgWin(boxtitle,msg)
for i from 1 to 1000
message "Record "+strval(i)
endfor
window select msgwinhandle
window close
message ""
endswitch
quitloop
case retval="F3" or retval="Tab" : UPIMAGE
case retval="F4" : DOWNIMAGE
case retval="Esc" :
DO_IT!
CLEARALL
quitloop
endswitch
endwhile
endproc
Proc clock()
if not isassigned(clockRow) then;
dlgRow=5
dlgCol=26
else
dlgRow=ClockRow
dlgCol=ClockCol
endif
message "Click and Drag on Title Bar to Move Around"
ClockDlg()
message "dlgRow="+strval(dlgRow)+" dlgCol="+strval(dlgCol)
ClockRow=dlgRow
ClockCol=dlgCol
endproc
Proc color()
message "Press Enter to see picklist. Click on Display button to see color sample."
ColorDlg()
message "AcceptValue="+acceptvalue+" PickValue="+strval(pickvalue)+" ButtonValue="+strval(buttonvalue)
endproc
Proc export()
if not isassigned(expRow) then
dlgRow=4
dlgCol=20
else
dlgRow=expRow
dlgCol=expCol
endif
message "Click and Drag on Title Bar to Move. Note: Directory name must end with a \\."
ExportDlg()
expRow=dlgRow
expCol=dlgCol
message "ExportFileName="+exportfilename+
" ExportDirectory="+exportdirectory+
" ExportType="+strval(exporttype)+
" ButtonValue="+buttonvalue+
" dlgRow="+strval(dlgrow)+" dlgCol="+strval(dlgcol)
endproc
Proc srch()
VIEW "Customer"
WHILE true
WINMAX
WAIT TABLE
PROMPT "Press Esc to End. Move to field, then press Ctrl-Z to search."
UNTIL "Esc","Zoom"
switch
case retval="Esc":
DO_IT!
CLEARALL
QUITLOOP
case retval="Zoom":
if not isassigned(srchRow) then
dlgRow=3
dlgCol=15
else
dlgRow=srchRow
dlgCol=srchCol
endif
message "Click and Drag on Title Bar to Move. Note: You can use Paradox search operators, such as .. and @."
FindRecord()
srchRow=dlgRow
srchCol=dlgCol
message "SearchValue="+searchvalue+" ButtonValue="+buttonvalue+
" dlgRow="+strval(dlgRow)+" dlgCol"+strval(dlgCol)
endswitch
ENDWHILE
endproc
Proc SrchAndRep()
COEDIT "Customer"
WINMAX
WHILE true
WAIT TABLE
PROMPT "Press Esc to End. Move to field, then press Ctrl-A to search/replace."
UNTIL "Esc","Replace"
switch
case retval="Esc":
DO_IT!
CLEARALL
QUITLOOP
case retval="Replace":
if not isassigned(srRow) then
dlgRow=4
dlgCol=20
else
dlgRow=srRow
dlgCol=srCol
endif
message "Click and Drag on Title Bar to Move. Note: You can use Paradox search operators, such as .. and @."
SearchAndReplace()
srRow=dlgRow
srCol=dlgCol
message "SearchValue="+searchvalue+" ButtonValue="+buttonvalue+
" dlgRow="+strval(dlgRow)+" dlgCol"+strval(dlgCol)
endswitch
ENDWHILE
endproc
Proc sysinf()
if not isassigned(sysRow) then;
dlgRow=4
dlgCol=21
else
dlgRow=sysRow
dlgCol=sysCol
endif
message "Click and Drag on Title Bar to Move Around"
SysInfoDlg()
message "dlgRow="+strval(dlgRow)+" dlgCol="+strval(dlgCol)
sysRow=dlgRow
sysCol=dlgCol
endproc
proc about()
array msg[16]
msg[1]="dlgHELP 1.0a is a library of 12 Paradox for DOS "
msg[2]="(4.x) procedures that are divided into two types: "
msg[3]=" 1) general purpose dialog box generation tools "
msg[4]=" 2) special purpose dialog box utilities. "
msg[5]=""
msg[6]="This demo illustrates each of the procedures and, "
msg[7]="in fact, this dialog box was created using dlgHELP."
msg[8]="The manual contains more detailed descriptions of "
msg[9]="how to use each one. "
msg[10]=""
msg[11]="dlgHELP is shareware. If you like it and intend to"
msg[12]="use it, the registration fee is $15. Registered "
msg[13]="users will be provided with a password that will "
msg[14]="allow read/write access to the scripts that make up"
msg[15]="the library. Note: the demo script (dlgdemo.sc) "
msg[16]="is not protected. "
array msg1[17]
msg1[1]="The easiest way to register is via CompuServes Shareware "
msg1[2]="Registration (GO SWREG). My registration ID is 7456. "
msg1[3]=""
msg1[4]="Otherwise, you can send money to: "
msg1[5]=""
msg1[6]=" William A. Bailey, Jr. "
msg1[7]=" 9017 Gamesford Drive "
msg1[8]=" Charlotte, NC 28277 "
msg1[9]=""
msg1[10]="Don't forget to include an e-mail address so I can return"
msg1[11]="the decryption password. If the money is in the mail and"
msg1[12]="you don't want to wait for the password, just send me a "
msg1[13]="note at one of the following and I'll give it to you: "
msg1[14]=""
msg1[15]="CompuServe: 102011,707 "
msg1[16]="AOL: bbaileyjr "
msg1[17]="Internet: bailey@vnet.net "
array pb[2]
pb[1]="How to Register"
pb[2]="OK"
bv="How to Register"
while bv="How to Register"
PushDlg("About dlgHELP",msg,pb,"V",0,0,"Yellow")
bv=buttonvalue
if bv="How to Register" then
PushDlg("How to Register",msg1,"OK","H",0,0,"Blue")
endif
endwhile
endproc
proc helpme()
array msg[17]
msg[1]="dlgHELP Demo illustrates each of the 12 dialog "
msg[2]="box generation tools and utilities that make up the"
msg[3]="dlgHELP library. The demo menu reflects the two "
msg[4]="basic types of procedures: tools and utilities. "
msg[5]="With respect to implementation, there is one basic "
msg[6]="difference: the dialog box generation tools "
msg[7]="require you to pass parameters that define the "
msg[8]="dialog box controls and features whereas the "
msg[9]="utility procedures just need to be called. You can"
msg[10]="also register from this demo if the demo is "
msg[11]="installed in your dlgHELP directory. "
msg[12]=""
msg[13]="This demo is provided to assist your evaluation of"
msg[14]="dlgHELP. It is *not* intended to be an example of"
msg[15]="an 'airtight' or polished Paradox application. It"
msg[16]="is very functional if you use it right, but it is "
msg[17]="not user-proof. "
array msg1[15]
msg1[1]="Select the tool which you wish to demo from the "
msg1[2]="drop-down menu under 'Tools'. A form will appear"
msg1[3]="to let you fill in the values for the parameters "
msg1[4]="required by the dialog box procedure. Default "
msg1[5]="values may alreay be in some of the fields. The "
msg1[6]="multi-record embedded tables are for labels and "
msg1[7]="message text lines. **Make sure you enter the # "
msg1[8]="of the label or line, otherwise your buttons and/"
msg1[9]="or lines may be in a different order than you "
msg1[10]="expect or you may get a key violation error.** "
msg1[11]="Press [F2] to generate the dialog box. When you "
msg1[12]="select a pushbutton, the values of the global "
msg1[13]="variables assigned by the procedure will be dis- "
msg1[14]="played on the screen. Please reference the "
msg1[15]="manual for further details about each procedure. "
array msg2[8]
msg2[1]="Select the utility which you wish to demo from "
msg2[2]="the drop-down menu under 'Tools'. The dialog box"
msg2[3]="should appear on the screen. That's it! When "
msg2[4]="you exit the dialog box (by pressing one of the "
msg2[5]="pushbuttons), the values of the global variables "
msg2[6]="assigned by the procedure will be displayed on "
msg2[7]="the screen. Please reference the manual for "
msg2[8]="further details about each procedure. "
array msg3[5]
msg3[1]="If the dlgDemo files are in the same directory as your "
msg3[2]="dlgHELP scripts, then you can register (i.e. enter your "
msg3[3]="password to decrypt the scripts) via the 'Register' "
msg3[4]="option on the dlgDemo main menu. Instructions on how to "
msg3[5]="register and receive your password are also included. "
array pb[4]
pb[1]="Tools Help"
pb[2]="Utilities Help"
pb[3]="Registration Help"
pb[4]="OK"
while true
PushDlg("dlgDemo Help",msg,pb,"V",0,0,"Yellow")
bv=buttonvalue
switch
case bv="Tools Help": PushDlg("Tools Help",msg1,"OK","H",0,0,"Blue")
case bv="Utilities Help": PushDlg("Utilities Help",msg2,"OK","H",0,0,"Blue")
case bv="Registration Help": PushDlg("Registration Help",msg3,"OK","H",0,0,"Blue")
case isblank(bv): quitloop
endswitch
endwhile
endproc
setuimode standard
autolib="dlghelp"
dlgdemo()