home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wacky Windows Stuff...
/
WACKY.iso
/
toolbook
/
dlgtrick.tbk
(
.txt
)
< prev
next >
Wrap
Asymetrix ToolBook File
|
1992-02-12
|
40KB
|
1,129 lines
winCLI
false
-5,0,643,99
enterBook
enterBook
cel Examples
Dialog Tricks
"&Move"
"Si&ze"
"&Activate"
"Build &Chart"
"&Protect"
&Document"
"&Unprotect"
buildChart
protectDocument
unprotect
unprotectDocument
enterBook
activate
buildChart
start
protect
protectDocument
initMenu
unprotect
unprotectDocument
enterBook
tinitMenu
initMenu
E&xcel
&Start
Excel
&Move
Excel
Si&ze
Excel
&Activate
Excel
Build &Chart
Excel
&Protect
Excel
Protect &Document
Excel
&Unprotect
Excel
Unprotect D&ocument
Excel
start
activate
buildChart
protect
protectDocument
unprotect
unprotectDocument
~&"!i&U
"*$*$*$
sqlCommand
select * from ps_vm.v0000015
--Move linkDLL statement
handler
"tbkdlg.dll"
dialog(
setValue(
getValue(
init
dlgInit
-- Here
where we modify the
control's style, which we've
-- calculated
dlgBox
-- We will
,"","")
function
retValue
, "")
buttonUp
buttonUp
tbkdlg.dll
dialog
setValue
getValue
dlgInit
dlgBox
dialog
retValue
dlgInit
,e6,Edit
button OK,b7,TRUE
button Cancel,b8,FALSE
,b9,TRUE
,b10,FALSE
,b11,FALSE
dlgBox
524480,6,30,20,142,128,,,Dialog,8,Helv,,39.05,24.78,84.00,13.17,6,1350631424,129,Edit,0,OK,14.78,93.13,50.86,12.31,7,1342242817,128,OK,0,Cancel,74.51,93.13,50.86,12.31,8,1342242816,128,Cancel,0,,12.91,8.70,50.86,12.31,9,1342177289,128,Pushbutton,0,,12.91,50.91,50.86,12.31,10,1342177289,128,Pushbutton,0,,12.91,69.01,50.86,12.31,11,1342177289,128,Pushbutton,0
ctrlID
Password Edit Control
--Move linkDLL statement
handler
"tbkdlg.dll"
dialog(
setValue(
getValue(
init
dlgInit
-- Here
where we modify the
control's style, which we've
-- calculated
dlgBox
-- We will
,"","")
function
retValue
, "")
buttonUp
buttonUp
tbkdlg.dll
dialog
setValue
getValue
dlgInit
dlgBox
dialog
retValue
dlgInit
,e6,Edit
button OK,b7,TRUE
button Cancel,b8,FALSE
,b9,TRUE
,b10,FALSE
,b11,FALSE
dlgBox
524480,6,30,20,142,128,,,Dialog,8,Helv,,39.05,24.78,84.00,13.17,6,1350631424,129,Edit,0,OK,14.78,93.13,50.86,12.31,7,1342242817,128,OK,0,Cancel,74.51,93.13,50.86,12.31,8,1342242816,128,Cancel,0,,12.91,8.70,50.86,12.31,9,1342177289,128,Pushbutton,0,,12.91,50.91,50.86,12.31,10,1342177289,128,Pushbutton,0,,12.91,69.01,50.86,12.31,11,1342177289,128,Pushbutton,0
ctrlID
Uppercase Edit Control
--Move linkDLL statement
handler
"tbkdlg.dll"
dialog(
setValue(
getValue(
init
dlgInit
-- Here
where we modify the
control's style, which we've
-- calculated
dlgBox
-- We will
,"","")
function
retValue
, "")
buttonUp
buttonUp
tbkdlg.dll
dialog
setValue
getValue
dlgInit
dlgBox
dialog
retValue
ctrlID
dlgBox
524480,6,30,20,142,128,,,Dialog,8,Helv,,39.05,24.78,84.00,13.17,6,1350631424,129,Edit,0,OK,14.78,93.13,50.86,12.31,7,1342242817,128,OK,0,Cancel,74.51,93.13,50.86,12.31,8,1342242816,128,Cancel,0,,12.91,8.70,50.86,12.31,9,1342177289,128,Pushbutton,0,,12.91,50.91,50.86,12.31,10,1342177289,128,Pushbutton,0,,12.91,69.01,50.86,12.31,11,1342177289,128,Pushbutton,0
dlgInit
,e6,Edit
button OK,b7,TRUE
button Cancel,b8,FALSE
,b9,TRUE
,b10,FALSE
,b11,FALSE
Lowercase Edit Control
Dialog
--Move linkDLL statement
handler
"tbkdlg.dll"
dialog(
setValue(
getValue(
init
dlgInit
-- Fill the listbox
lines containing spaces
separate
textLineString
"1st Col
3rd
"First
Second
Third" &
3rd" &
\ 3" &
Two Three"
retValue
dlgBox
%, "")
function
buttonUp
buttonUp
tbkdlg.dll
dialog
setValue
getValue
dlgInit
1st Col 2nd Col 3rd Col
First Second Third
1st 2nd 3rd
Col 1 Col 2 Col 3
One Two Three
listbox list
setValue
dlgBox
dialog
retValue
textLineString
dlgInit
listbox list,l5,one
three
,b6,TRUE
,b7,FALSE
dlgBox
524480,3,30,20,142,128,,,Dialog,8,Helv,list,11.05,8.70,117.60,72.37,5,1352728577,131,ctrlText,0,,11.05,91.12,50.86,12.31,6,1342242817,128,OK,0,,77.90,91.12,50.86,12.31,7,1342242816,128,Cancel,0
ctrlID
Normal Listbox
Dialog
--Move linkDLL statement
handler
"tbkdlg.dll"
dialog(
setValue(
getValue(
init
dlgInit
dlgBox
-- The listbox style
the 18th
-- We will
#LBS_USETABSTOPS value
-- Fill
lines containing tabs
separate
textLineString
"1st Col" &
9& "2nd
9& "3rd
"First" &
9& "Second" &
9& "Third" &
"1st" &
9& "2nd" &
9& "3rd" &
v 1" &
2" &
3" &
"One" &
9& "Two" &
9& "Three"
retValue
box,
, "")
function
buttonUp
buttonUp
tbkdlg.dll
dialog
setValue
getValue
dlgInit
dlgBox
1st Col
2nd Col
3rd Col
First
Second
Third
Col 1
Col 2
Col 3
Three
listbox list
setValue
dialog
retValue
textLineString
ctrlID
dlgBox
524480,3,30,20,142,128,,,Dialog,8,Helv,list,11.05,8.70,117.60,72.37,5,1352728577,131,ctrlText,0,,11.05,91.12,50.86,12.31,6,1342242817,128,OK,0,,77.90,91.12,50.86,12.31,7,1342242816,128,Cancel,0
dlgInit
listbox list,l5,one
three
,b6,TRUE
,b7,FALSE
Tab Stop Listbox
Dialog
--Move linkDLL statement
handler
"tbkdlg.dll"
dialog(
setValue(
getValue(
init
dlgInit
dlgBox
-- The
style
the 1st
-- We will
!WS_SYSMENU value
H524288
,"","")
function
retValue
, "")
buttonUp
buttonUp
tbkdlg.dll
dialog
setValue
getValue
dlgInit
dlgBox
dialog
retValue
ctrlID
dlgBox
524480,3,30,20,142,128,,,Dialog,8,Helv,list,11.05,8.70,117.60,72.37,5,1352728577,131,ctrlText,0,,11.05,91.12,50.86,12.31,6,1342242817,128,OK,0,,77.90,91.12,50.86,12.31,7,1342242816,128,Cancel,0
dlgInit
listbox list,l5,one
three
,b6,TRUE
,b7,FALSE
No System Menu
Dialog
--Move linkDLL statement
handler
"tbkdlg.dll"
dialog(
setValue(
getValue(
init
dlgInit
dlgBox
-- The
the 9th
("Please Title
*Dialog
f"New Caption"
,"","")
function
retValue
, "")
buttonUp
buttonUp
tbkdlg.dll
dialog
setValue
getValue
dlgInit
dlgBox
Please Title the Dialog Box.
New Caption
dialog
retValue
!J!dlgInit
listbox list,l5,one
three
,b6,TRUE
,b7,FALSE
!dlgBox
524480,3,30,20,142,128,,,Dialog,8,Helv,list,11.05,8.70,117.60,72.37,5,1352728577,131,ctrlText,0,,11.05,91.12,50.86,12.31,6,1342242817,128,OK,0,,77.90,91.12,50.86,12.31,7,1342242816,128,Cancel,0
|"ctrlID
Settable Caption
Dialog
--Move linkDLL statement
handler
"tbkdlg.dll"
dialog(
setValue(
getValue(
init
dlgInit
dlgBox
-- The
style
the 1st
-- We will
!DS_SYSMODAL value
,"","")
function
retValue
, "")
buttonUp
buttonUp
tbkdlg.dll
dialog
setValue
getValue
dlgInit
dlgBox
dialog
retValue
:%2%ctrlID
&J%dlgBox
524480,3,30,20,142,128,,,Dialog,8,Helv,list,11.05,8.70,117.60,72.37,5,1352728577,131,ctrlText,0,,11.05,91.12,50.86,12.31,6,1342242817,128,OK,0,,77.90,91.12,50.86,12.31,7,1342242816,128,Cancel,0
"&dlgInit
listbox list,l5,one
three
,b6,TRUE
,b7,FALSE
System Modal / Unmovable
-- This presents a list
saved queries
the user,
loads
-- selected one
#appropriate
loadQuery
4svQueryName, svQueryDesc
pickAQuery("Load")
"queryChoice
:" &&
--&
parseQuery
deletes
deleteQuery
Delete")
"ok" = tbMessageBox("
:" &&
& "?", \
","okCancel",1,"question")
--&
deleteIniLine("Queries",
"Deleting
:" &&
utility function
-- returns
action
linkDLL "kernel"
GetPrivateProfileString\
GetProfileList=
gGlobalAlloc(
gGlobalFree(
GlobalLock(
gglobalUnlock(
.ini
fileName
getIniFile()
-- Use a 10K buffer
bufferSize
10240
hMem
There
xenough memory
perform
", "ok", 1, "exclam")
"Failed: Not
-- Get a
0,"",
-- Work thru <
>, a series
queryNames, forming queryList.
-- Each
terminated
Ha 0, so we can use
) + 1)
>, a
g choiceList,
-- a
descriptions.
will choose
tempList
--
queryDesc
1(0,
&& "-" &&
GlobalUnlock(
-- Build
title
listbox,
"<AppName> &
listboxTitle
stripExt(
8) && "&
listQueriesDialog(100, 50,
f, "&"&
-- Split
" - """
~(" - """,
- 1)
+ 3)
& CRLF &
reads
parses a given
"<bookname>.ini"
's windows directory.
values
queryLine
getIniLine("
queryPage
fieldList
valueList
-- Put
proper fields
fieldName
fieldValue
sqlCommand
queryCmnd
-- Take
default
asks
current
stores
, along
-- "<
saveQuery
Please
that
_", \
"Save
d", "ok", 1, "
init
setValue(
retValue
dialog(
getValue(
Description"
printMsg "Saving
""" &
sqlFieldList
, tmpList
& """,""" &
& """,""" & \
& """,""" &
& """,""" &
WritePrivateProfileString(
writeIniLine("
Error: Couldn't
"ok", 1, "
-- Strip
extension
stringStart
stringEnd
stringPeriod
-- Create
+ x, y, dbCaption, lbTitle, lbTextLines, buttonCaption1, buttonCaption2
tbkdlg.dll"
-- Test parameters
lines
(no more than 11)
numLines
j(11,
call
following two statements
q needed
display a
box.
They define
fa static control, a
OK &
-- buttons.
dlgBox
dlgInit
are documented on
-- 82-83
ToolBook 1.5 release notes.
"524480,4," & x & "," & y & ",156," & 56+
*8 & \
",,," &
",8,Helv,,12,8,132,9,6,1342177280,130,,0,LB,12,18,132," & \
*8 & ",7,1352728579,131,ctrlText,0,OK,17," & \
*8 & ",51,13,8,1342242817,128," & \
& ",0,
,88," & 26+
*8 & \
",51,13,9,1342242816,128," &
& ",0"
",s6," &
LB,l7," &
BOK,b8,TRUE
,b9,FALSE"
LB")
unlinkDLL "
loadQueryX
Loading
""" &
64, 1024)
", "ok", 1, "
length
,1024,
our way
>, a
Ha 0.
parseQueryX
-- "<
saveQueryX
_", \
S", "ok", 1, "
--& Replace
("What
f"First"
f"My
"field1,field2,field3"
" &&
& "?" \
" & i
""" &
& """,""" &
& """,""" & \
& """,""" &
&":" &&
& "=" &
f"OK"
"ok", 1, "
getIniFileX
loadQuery
parseQuery
saveQuery
deleteQuery
loadQueryX
saveQueryX
pickAQuery
getIniFile
listQueriesDialog
stripExt
parseQueryX
getIniFileX
loadQuery
pickAQuery
queryChoice is:
svQueryName
svQueryDesc
deleteQuery
Delete
pickAQuery
Delete Query:
Delete Query
okCancel
question
tbMessageBox
Deleting Query:
pickAQuery
kernel
GetPrivateProfileString
GetProfileList
GetPrivateProfileString
GlobalAlloc
GlobalFree
GlobalLock
globalUnlock
getIniFile
GlobalAlloc
There is not enough memory to perform this function
Query
exclam
tbMessageBox
Failed: Not enough memory
GlobalLock
Queries
GetProfileList
Queries
GetPrivateProfileString
GlobalUnlock
GlobalFree
stripExt
&Queries
Query
Cancel
listQueriesDialog
listboxTitle
queryDesc
tempList
choiceList
queryName
queryList
buffer
bufferSize
fileName
svQueryName
svQueryDesc
action
parseQuery
sqlCommand
default
queryCmnd
fieldValue
fieldName
valueList
fieldList
queryLine
queryPage
buffer
queryName
saveQuery
sqlCommand
Please choose this action from a page that contains an SQL command
Save Query
exclam
tbMessageBox
getIniFile
kernel
GetPrivateProfileString
GetProfileList
GetPrivateProfileString
GlobalAlloc
GlobalFree
GlobalLock
globalUnlock
edit queryName
setValue
edit queryDesc
setValue
dialog
edit queryName
getValue
edit queryDesc
getValue
Query Name 2
Query Description
,~printMsg
Saving Query "
sqlFieldList
kernel
WritePrivateProfileString
3
Queries
WritePrivateProfileString
Error: Couldn't Save This Query
Save Query
exclam
tbMessageBox
,~printMsg
default
queryLine
valueList
tmpList
fieldList
queryPage
retValue
fileName
queryCmnd
svQueryName
svQueryDesc
stripExt
stringPeriod
stringEnd
stringStart
fileName
getIniFile
fileName
stringPeriod
stringEnd
stringStart
listQueriesDialog
tbkdlg.dll
dialog
setValue
getValue
Cancel
524480,4,
,156,
,8,Helv,,12,8,132,9,6,1342177280,130,,0,LB,12,18,132,
,7,1352728579,131,ctrlText,0,OK,17,
,51,13,8,1342242817,128,
,0,Cancel,88,
,51,13,9,1342242816,128,
listbox LB,l7,
button OK,b8,TRUE
button Cancel,b9,FALSE
dialog
listbox LB
getValue
tbkdlg.dll
retValue
dlgInit
dlgBox
numLines
buttonCaption2
buttonCaption1
lbTextLines
lbTitle
dbCaption
loadQueryX
,~printMsg
Loading Query "
kernel
GetProfileList
GetPrivateProfileString
GetPrivateProfileString
GlobalAlloc
GlobalFree
GlobalLock
globalUnlock
getIniFile
GlobalAlloc
There is not enough memory to perform this function
Load Query
exclam
tbMessageBox
Failed: Not enough memory
GlobalLock
Queries
GetProfileList
length
buffer
fileName
queryName
parseQueryX
sqlCommand
,~printMsg
default
queryCmnd
fieldValue
fieldName
valueList
fieldList
queryPage
queryLine
buffer
queryName
saveQueryX
sqlCommand
Please choose this action from a page that contains an SQL command
Save Query
exclam
tbMessageBox
getIniFile
What is the name of this query?
First
What is the desc of this query?
My First Query
field1,field2,field3
What is the value of field
value
,~printMsg
Saving Query "
kernel
WritePrivateProfileString
c
Cancel
Cancel
Queries
WritePrivateProfileString
Error: Couldn't Save This Query
Save Query
exclam
tbMessageBox
,~printMsg
default
queryLine
valueList
fieldList
queryDesc
queryPage
queryName
fileName
queryCmnd
getIniFileX
fileName
stringPeriod
stringEnd
stringStart
initMenu
c"&DBC"
"&Logon"
logon
("Where?"
"loc"
linkDLL "tbkwin.dll"
screenFromPage(
9user"
\GetDialogBaseUnits()
, sysMagnification,
xPixels
yPixels
$:" &&
,& CRLF & "
%:" &&
listboxDialog(
F,"1"&
k&"2","DIALOG")
xDialogBaseUnits
k65536
yDialogBaseUnits
y65536
::" &&
*:" &&
xDialogUnits
* 4) /
yDialogUnits
* 8) /
9:" &&
*:" &&
A,"1"&
k&"2","
x, y, dbTextlines, dbCaption, buttonCaption1, buttonCaption2
dialog(
setValue(
getValue(
-- Test parameters
"Cancel"
(no more than 15)
numLines
j(15,
(dbTextLines))
-- Use
call
dlgBox
"524480,3," & x & "," & y & ",146," & 52+
u*8 & \
"524481,3," & x & "," & y & ",146," & 52+
*8 & \
",,," &
& ",8,Helv,LB,12,8,122," & \
*8 & ",7,1352728577,131,ctrlText,0,OK,12," & \
*8 & ",51,13,8,1342242817,128," & \
& ",0,
,83," & 22+
*8 & \
",51,13,9,1342242816,128," &
& ",0"
dlgInit
LB,l7,
BOK,b8,TRUE
,b9,FALSE"
--&
l7 above, so no need
LB",
retValue
, "nlistbox LB")
unlinkDLL "tbkdlg.
terBook
initMenu
enterBook
logon
listboxDialog
enterBook
tinitMenu
initMenu
&Logon
logon
Where?
cancel
tbkwin.dll
screenFromPage
GetDialogBaseUnits
screenFromPage
xPixels:
yPixels:
DIALOG
listboxDialog
GetDialogBaseUnits
xDialogBaseUnits:
yDialogBaseUnits:
xDialogUnits:
yDialogUnits:
DIALOG
listboxDialog
yDialogUnits
xDialogUnits
yDialogBaseUnits
xDialogBaseUnits
yPixels
xPixels
listboxDialog
tbkdlg.dll
dialog
setValue
getValue
Cancel
dbTextLines
524481,3,
,146,
,8,Helv,LB,12,8,122,
,7,1352728577,131,ctrlText,0,OK,12,
,51,13,8,1342242817,128,
,0,Cancel,83,
,51,13,9,1342242816,128,
listbox LB,l7,
button OK,b8,TRUE
button Cancel,b9,FALSE
listbox LB
setValue
dialog
nlistbox LB
getValue
tbkdlg.dll
retValue
dlgInit
dlgBox
numLines
buttonCaption2
buttonCaption1
dbCaption
dbTextlines
hWnd
xlGetWindow()
"Excel
xrunning"
translateWindowMessage
setSize
setMinMax
"setsize"
setminmax
dlgPrintDocument xPos, yPos, mode
4svCopies, svOrientation, svFileList
linkDLL "tbkdlg.dll"
dialog(
setValue(
getValue(
-- Initialize
R box
init values
"524480,7,30,20,127,98,,,
,8,Helv,OK,78.25,15.75,39.20,12.31,19,1342373889,128,OK,0,Cancel,78.25,34.17,39.20,12.31,20,1342242816,128,
.0,,9.30,17.44,32.34,10.79,10,1342177282,130,&
45.71,16.21,20.53,11.28,11,1350631424,129,1,0,,11.09,29.83,56.00,42.95,16,1342177287,128,
0,Portrait,16.69,43.24,48.53,10.46,17,1342308361,128,P&
10,Landscape,16.69,59.32,48.53,10.46,18,1342177289,128,L&
BOK,b19,TRUE
b20,FALSE
,s10,&
iedit
i11,1
,g16,
"524480,9,30,20,191,98,,,
142.82,15.75,39.50,12.31,19,1342373889,128,OK,0,
143.12,34.71,39.20,12.31,20,1342242816,128,
0,,10.06,15.75,59.70,8.82,23,1342177280,130,&Documents:,0,Docs,10.06,27.12,60.69,48.25,22,1352728587,131,,0,,76.50,17.97,32.34,10.79,10,1342177282,130,&
112.88,16.74,20.53,11.28,11,1350631424,129,1,0,,78.29,30.36,56.00,42.95,16,1342177287,128,
83.89,43.77,48.53,10.46,17,1342308361,128,P&
83.89,59.86,48.53,10.46,18,1342177289,128,L&
listbox
l22,(None Open)
copies",
-- User chose "
Bportrait",
Blandscape",
tbMessageBox("Error: Dialog Initialization Failed.","
"ok",1,"exclam")
default
<> 0
<> 0
-- bring up
retValue
--
control)
-- orientation (radio buttons)
-- sheet setup
,1,1,1,1,
&",1,100)]"
xlExecute
C--&, "silent"
-- chart
,1,1,1,1,2,
&",1,100)]"
--&, "
(1,,,"&
,1)]"
--&, "
setSize
setminmax
dlgPrintDocument
xlGetWindow
Excel not running
setSize
setMinMax
setSize
setsize
setminmax
setMinMax
dlgPrintDocument
tbkdlg.dll
dialog
setValue
getValue
active
524480,7,30,20,127,98,,,Print,8,Helv,OK,78.25,15.75,39.20,12.31,19,1342373889,128,OK,0,Cancel,78.25,34.17,39.20,12.31,20,1342242816,128,Cancel,0,,9.30,17.44,32.34,10.79,10,1342177282,130,&Copies:,0,Copies,45.71,16.21,20.53,11.28,11,1350631424,129,1,0,,11.09,29.83,56.00,42.95,16,1342177287,128,Orientation,0,Portrait,16.69,43.24,48.53,10.46,17,1342308361,128,P&ortrait,0,Landscape,16.69,59.32,48.53,10.46,18,1342177289,128,L&andscape,0
button OK,b19,TRUE
button Cancel,b20,FALSE
,s10,&Copies:
iedit Copies,i11,1
,g16,Orientation
button Portrait,b17,TRUE
button Landscape,b18,FALSE
524480,9,30,20,191,98,,,Print,8,Helv,OK,142.82,15.75,39.50,12.31,19,1342373889,128,OK,0,Cancel,143.12,34.71,39.20,12.31,20,1342242816,128,Cancel,0,,10.06,15.75,59.70,8.82,23,1342177280,130,&Documents:,0,Docs,10.06,27.12,60.69,48.25,22,1352728587,131,,0,,76.50,17.97,32.34,10.79,10,1342177282,130,&Copies:,0,Copies,112.88,16.74,20.53,11.28,11,1350631424,129,1,0,,78.29,30.36,56.00,42.95,16,1342177287,128,Orientation,0,Portrait,83.89,43.77,48.53,10.46,17,1342308361,128,P&ortrait,0,Landscape,83.89,59.86,48.53,10.46,18,1342177289,128,L&andscape,0
button OK,b19,TRUE
button Cancel,b20,FALSE
,s23,&Documents:
listbox Docs,l22,(None Open)
,s10,&Copies:
iedit Copies,i11,1
,g16,Orientation
button Portrait,b17,TRUE
button Landscape,b18,FALSE
iedit copies
setValue
button portrait
setValue
button landscape
setValue
Error: Dialog Initialization Failed.
Print
exclam
tbMessageBox
dialog
iedit copies
getValue
button portrait
getValue
[page.setup("","",1,1,1,1,false,false,true,true,
,1,100)]
xlExecute
[page.setup("","",1,1,1,1,2,true,true,
,1,100)]
xlExecute
[print(1,,,
,false,false,1,false,1)]
xlExecute
retValue
default
svCopies
svOrientation
svFileList