The controls on this page let you select a clip from a CD and create a wave file from that clip.
Use this page as you would the CD Audio Event editor page. When you've seleced a clip, choose your sample rate (11-44 kHz) and the number of channels (stereo or mono), then click the Make A Wave Audio File button. The clip will play and a wave file will be created from it. You will be asked if you want to hear the wave file after it's made.
Make sure a signal is going from the CD player to your audio card. Sometimes a cable is needed for this. Try different sample rates or number of channels for best results.
The Driver On/Off widget opens and
closes the device and initializes the disc.
The Track and Position fields, as well as the slider position are updated by an
idle handler which queries the status of the CD audio driver. You must copy the handler into the page or background where you paste these elements if you want them to update correctly. correctly. e correctly. ate correctly. ctly.
editScript "
tbkMCIchk(""
cdAudio shareable""",
"Driver switch"
buttonDown
buttonDown
editScript
get tbkMCIchk("open cdAudio shareable"
Driver switch
editScript "
tbkmci(""close cdAudio""",
"Driver switch"
buttonDown
buttonDown
editScript
get tbkmci("close cdAudio"
Driver switch
editScript "
buttondown
buttondown
editScript
to handle idle
s_device : a system variable used in the idle handler to bypass status queries if the device isn't open.
s_idle : a system variable use to count idle messages.
s_start : a system variable used in the Scan Reverse button, Stop button and slider thumb containing the starting position of track 1.
s_end : a system variable used in the Scan Forward button containing the end position of the disc.
s_kHz : a system variable containing the sample rate used in the recording.
s_channels : a system variable containing the number of channels used in the recording.
Please choose a start and end position for the clip first.
open new type waveaudio alias waveFile buffer 9
tbkMCI
set waveFile channels
tbkMCI
set waveFile samplespersec
tbkMCI
set waveFile bitspersample 8
tbkMCI
cue waveFile input
tbkMCI
record waveFile
tbkMCI
play cdaudio from
Start Position
End Position
tbkMCI
stop waveFile
tbkMCI
Enter a file name for this wave file.
cancel
filename
already exists. Try a different name?
&Cancel
cancel
Try a different name?
&Cancel
save waveFile
tbkMCIchk
Would you like to hear
Cancel
play waveFile from 0 wait
tbkMCIchk
close waveFile
tbkMCI
startPos
endPos
fileName
s_kHz
s_channels
4s_bmpHandle
ofileName
rightButtonup
B's bitmap
fa popup
tbkBitmapchk("
" &&
d && "alias dibFile style overlapped
" &&
, 1, 1)
" &&
ox & "," &
oy,1)
cate
translating
emessages
("status
translatewindowmessage
bmpWindowClose
bmpButtonup
--dismiss
they click
BMPbuttonUp
--we use a
here since a timer
--notification handler might
doesn't have access
container
untranslateAllWindowMessages
("close
edirectly (Alt-f4)
lets
efinish closing
4sending a
--which
turn sends a bmpButtonDown
windows
tbkTimerStart("single",500,100,
tbkMMTimer
bmpButtonUp
OpenDlg(".", "*.*", "Choose a
(.dib
extensions)", "
ox & "," &
"0,0"
("Would you like
specify
e? If so, please enter 2 numeric coordinates."
) <> 2
"Invalid
x"0"
xisNumber(
"Coordinate
z" && i && "
tonUp
buttonUp
bmpWindowClose
tbkMMTimer
BMPbuttonUp
rightButtonUp
buttonUp
fileName
prightButtonup
fileName
alias dibFile style overlapped parent
tbkBitmapchk
window dibFile position
tbkBitmapchk
window dibFile state show
tbkBitmapchk
status dibFile window
tbkBitmap
bmpWindowClose
bmpButtonup
s_bmpHandle
BMPbuttonUp
close dibFile
tbkBitmap
s_bmpHandle
bmpWindowClose
single
tbkTimerStart
tbkMMTimer
bmpButtonUp
rightButtonUp
Choose a bitmap file for this button. (.dib or .bmp extensions)
Choose Bitmap File
OpenDlg
fileName
fileName
Would you like to specify the position of the window? If so, please enter 2 numeric coordinates.
cancel
Invalid number of coordinates.
isNumber
Coordinate number
is not a number.
4s_bmpHandle
FALSE
--close other bitmap that might be
tbkBitmap("
/dibFile")
fa popup
tbkBitmapchk("
dib1.
; alias
D style
0", 1, 1)
_ state
translating
emessages
status
translatewindowmessage
bmpWindowClose
bmpButtonup
--dismiss the
they click
BMPbuttonUp
unTranslateAllWindowMessages
a timer
edirectly (Alt-f4)
lets
efinish closing
4sending a
--which
turn sends a bmpButtonDown
untranslate
windows
tbkTimerStart("single",500,100,
tbkMMTimer
bmpButtonUp
ttonUp
buttonDown
BMPbuttonUp
bmpWindowClose
buttonUp
tbkMMTimer
buttonDown
buttonUp
close dibFile
tbkBitmap
open dib1.dib alias dibFile style popup
tbkBitmapchk
window dibFile state show
tbkBitmapchk
status dibFile window
tbkBitmap
bmpWindowClose
bmpButtonup
close
s_bmpHandle
BMPbuttonUp
close dibFile
tbkBitmap
close
s_bmpHandle
bmpWindowClose
single
tbkTimerStart
tbkMMTimer
bmpButtonUp
Animation: More Buttons
4s_aniHandle
tbkMCI("status aniFile ready","")
< <>
untranslateAllWindowMessages
fclose
_","")
leavePage
leavePage
status aniFile ready
tbkMCI
close aniFile
tbkMCI
s_aniHandle
MCI lets you display animation files in their own windows. See the Window Styles reference page to learn about different types of windows.
To display an animation file in your own application, copy a Generic button to your book and right click it in Reader mode. You'll be prompted for a file name. That file name will be stored as a user property of the button.
These buttons require you to click the animation window to close their files. Or in the case of the overlapped window, close its window by pressing Alt+F4. These buttons use the
translateWindowMessage control structure to trap mouse clicks in the animation window, which sends a ToolBook message to close the animation file. The Overlapped button also traps a windows Close Window message. If you use the translateWindowMessage structure, you must first show the animation window when using Popup or Overlapped window styles.
ou must first show the animation window when using Popup or Overlapped window styles.
eStyles"
buttonDown
buttonDown
window Styles
editScript "
B"Popup, Manual Close"
buttonDown
buttonDown
editScript
to handle rightButtonUp
Popup, Manual Close
editScript "translatewindowmessage
s_aniHandle",
B"Popup, Manual Close"
buttonDown
buttonDown
editScript
translatewindowmessage for s_aniHandle
Popup, Manual Close
editScript "
animateWindowClose
B"Overlapped, Manual
buttonDown
buttonDown
editScript
before 16 send animateWindowClose to self
Overlapped, Manual Close
aniFile : an alias for the current animation file.
s_aniHandle : a system variable containing the handle to the animation window..imation windows.e manually closed animation windows.
editScript "alias aniFile",
B"Popup, Manual close"
buttonDown
buttonDown
editScript
alias aniFile
Popup, Manual close
editScript "
s_aniHandle",
B"Overlapped, Manual Close"
buttonDown
buttonDown
editScript
set s_aniHandle
Overlapped, Manual Close
Animation
More Generic Animation Buttonss
Popup, Manual Close
Popup, Manual Close
Child, Manual Close
Child, Manual Close
Overlapped, Manual Close
Overlapped, Manual Close
4s_aniHandle
ofileName
tbkMCI("status aniFile ready","")
` <>
untranslateAllWindowMessages
fclose
_","")
tbkMCIchk("
" &&
&& \
" &&
&& "style overlapped alias
,1,1)
state
","",1)
the animation
translating
emessages
","",1)
translateWindowMessage
aniClose
animateWindowClose
play
","",1)
--we use a
here since a timer
--notification handler might
doesn't have access
container
unTranslateAllWindowMessages
","")
--This handles
closes
edirectly (Alt-f4)
--Start
efinish its
Fclean
finished
tbkTimerStart("single",500,100,
tbkMMTimer
OpenDlg(".", "*.fl?", "Choose
B.", "
Animation
buttonUp
animateWindowClose
tbkMMTimer
aniClose
rightButtonUp
buttonUp
fileName
prightButtonUp
status aniFile ready
tbkMCI
close aniFile
tbkMCI
fileName
parent
style overlapped alias aniFile
tbkMCIchk
window aniFile state show
tbkMCIchk
status aniFile window handle
tbkMCIchk
aniClose
animateWindowClose
play aniFile
tbkMCIchk
s_aniHandle
aniClose
close aniFile
tbkMCI
s_aniHandle
animateWindowClose
single
tbkTimerStart
tbkMMTimer
^aniClose
rightButtonUp
*.fl?
Choose an animation file for this button.
Choose Animation File
OpenDlg
fileName
fileName
4s_aniHandle
ofileName
tbkMCI("status aniFile ready","")
` <>
untranslateAllWindowMessages
fclose
_","")
tbkMCIchk("
" &&
&& "alias
style child
" && sysClientHandle, "",1,1)
the animation
translating
emessages
","",1)
translatewindowmessage
aniButtonup
play
","",1)
--dismiss
they click
aniButtonUp
untranslateAllwindowMessages
","")
OpenDlg(".", "*.fl?", "Choose
B.", "
Animation
tonUp
aniButtonUp
buttonUp
rightButtonUp
buttonUp
fileName
prightButtonUp
status aniFile ready
tbkMCI
close aniFile
tbkMCI
fileName
alias aniFile style child parent
tbkMCIchk
status aniFile window handle
tbkMCIchk
aniButtonup
play aniFile
tbkMCIchk
s_aniHandle
aniButtonUp
close aniFile
tbkMCI
s_aniHandle
rightButtonUp
*.fl?
Choose an animation file for this button.
Choose Animation File
OpenDlg
fileName
fileName
-- MMWIDGET.TBK
-- Book Script
-- Contains routines specific
also
-- support
,level modification
pasting
the widgets
other instances
4s_Path
FALSE
Xuser
WORD GetWindowWord(
LoadMenu(
$,DWORD)
INT GetMenuItemCount(
KMenuItemID(
aMenuString(
q,POINTER,
QDestroyMenu(
X"KERNEL"
, GlobalLock (
lobalUnlock (
lobalFree (
lobalAlloc (
cmenuName("Text")
"Save"
"SaveAs"
"Import"
"Export"
"PrintReport"
"Tutorial"
"Keyboard"
"Commands"
"UsingHelp"
"Glossary"
"Index"
"&Multimedia"
help")
"About This &
..." alias "aboutWidgets"
linkDLL "tbkwin.dll"
INT popMenu(
,STRING,
:dlg.
dialog(
Xkernel
GlobalLockPointer_ =
SetTimer(
KillTimer(
bringwindowtotop(
getFocus()
getParent(
getClassName(
LONG sendMessage(
postmessage(
setwindowtext(
PeekMsg_ = PeekMessage(
"tbkdlg.
index
Zchoice
charlist
"229,231,230,231,229"
menuList
"{Wave Audio," & \
"Generic
Buttons," & \
"Simple Controls," & \
"Recording
"Capability
Status," & \
"Sound
Animation," & \
"Event Editor," & "}," & \
"{Bitmap Graphics," & \
"A
," & "}," & \
"{CD
"Small
"Large
"Track Selector," & \
"CD
Converter," & "}," & \
"{MIDI Sequencer," & \
] & \
"More
Panel," & \
," & \
"{Videodisc," & \
"A
," & \
"{Timers," & \
Timing
," & "}," & \
"3D Objects," & \
"Horizontal Sliders," & \
"Vertical
"Fancy
"Dog
Mixer," & "}," & \
"{Reference," & \
," & \
Font Quick
," & \
Dependencies," & \
Cover Routines," & \
) Styles," & "}"
"2000,750"
,sysMagnification,
< 12
< 20
< 27
< 34
< 40
< 44
< 52
File
CD To
Midi
wave,,,
Panels,
,,,3D
The
tbkmmsbk
sysBookPath
OpenDlg(".", "*.
o", "Please find
.", "
path.")
4s_oldSearch
ZoldPage, prompt
"Cancel"
selectedTextState <>
"Cannot
""" &
& """.
beginning
f"&Yes"
"&No"
""" &
& """."
editScript txt, obj
4scriptText, phase, bk
settimer(sysclienthandle,1,100,0)
"Unable
killtimer(
Zhwnd, class
getfocus()
+ <> 0
className(
"BufEdit"
getparent(
~), 273, 6512, 0)
), 273, 2, 0)
)), 273, 6514, 0)
classname
getclassname(
Zinit, retValue
aboutDlgInit
aboutDlgBox
setDefaultButtonStyle
sysButtonStyle
"pushButton"
sysfontFace
"Helv"
sysfontSize
sysfontStyle
sysTransParent
"0,75.3125,0"
isPosInt num
sysDecimal
= < 1
-- Function:
Eatclicks
-- Purpose:
pending keyboard
mouse messages
-- Parameters:
-- Returns:
positive
successful
eatclicks onOrOff
ZwFlags, dwBytes, cnt, hMsg, lpMsg
-- Link
Windows functions
allocate a block
memory only
xdone already
-- GlobalAlloc flags
32 --
MSG data structure,
froom
spare
= 0
GlobalFree(
-- We now have a buffer
we can call
-- windows
we don't want
-- Mouse
, 512, 521, 1) <> 0
, 256, 264, 1) <> 0
Accelerators
, 111, 112, 1) <> 0
GlobalUnlock(
-- EatClicks
USName
ZhMenu, hBuffer, lpBuffer, result, hInstance, p
, -6)
%800) --MIR_READERMENU
MenuCount
(2,2)
GetMenuString(
63, 1024)
1(0,
-- Remove DAM
S, wherever
may be
~("&",
p > 0
author
index
enterBook
search
enterpage
editScript
leavePage
aboutWidgets
first
leaveBook
setDefaultButtonStyle
tbkmmsbk
isPosInt
eatclicks
classname
menuName
enterBook
GetWindowWord
LoadMenu
GetMenuItemCount
GetMenuItemID
GetMenuString
DestroyMenu
KERNEL
GlobalLock
GlobalUnlock
GlobalFree
GlobalAlloc
menuName
SaveAs
Import
Export
PrintReport
newPage
Tutorial
Keyboard
Commands
UsingHelp
Glossary
Index
&Multimedia
menuName
About This &Book...
aboutWidgets
menuName
sizeToPage
tbkwin.dll
popMenu
tbkdlg.dll
dialog
GlobalAlloc
GlobalLockPointer_
GlobalLock
GlobalUnlock
GlobalFree
SetTimer
KillTimer
bringwindowtotop
getFocus
getParent
getClassName
sendMessage
postmessage
setwindowtext
PeekMsg_
PeekMessage
kernel
s_Path
leaveBook
tbkdlg.dll
tbkwin.dll
kernel
enterpage
leavePage
author
index
author
229,231,230,231,229
{Wave Audio,
Generic Wave Buttons,
Simple Controls,
Recording Controls,
Capability and Status,
Sound and Animation,
Event Editor,
{Bitmap Graphics,
Generic Bitmap Buttons,
A Bitmap Index,
{CD Audio,
Small Controls,
Large Controls,
Track Selector,
Capability and Status,
Event Editor,
CD to Wave Converter,
{MIDI Sequencer,
Generic MIDI Buttons,
Simple Controls,
Capability and Status,
Event Editor,
MIDI to Wave Converter,
{Animation,
Generic Animation Buttons,
More Generic Animation Buttons,
Control Panel,
Capability and Status,
Event Editor,
{Videodisc,
Simple Controls,
A Control Panel,
Capability and Status,
Event Editor,
{Timers,
Simple Timing Controls,
Capability,
{Generic Controls,
3D Objects,
Horizontal Sliders,
Vertical Sliders,
Fancy Sliders,
Dog Sliders,
Audio Mixer,
{Reference,
About this Widget Book,
Widget Font Quick Reference,
Using the Widget Font,
Widget Dependencies,
Using the Cover Routines,
Window Styles,
2000,750
popMenu
Wave Audio:
Bitmap Graphics:
cd Audio:
MIDI Sequencer:
Animation:
Videodisc:
Timers:
Generic:
,Wave File Buttons,Simple Controls,Recording Controls,Status,Sound And Animation,Event Editor,,,Bitmap Buttons,A Bitmap Index,,,Small Simple Controls,Large Simple Controls,Track Selector,Status,Event Editor,CD To Wave Converter,,,Buttons,Simple Controls,Status,Event Editor,Midi to wave,,,Buttons,More Buttons,Control Panel,Status,Event Editor,,,Simple Controls,Control Panels,Status,Event Editor,,,Simple Timing Controls,Capability,,,3D Objects,Horizontal Sliders,Vertical Sliders,Fancy Sliders,Dog Sliders,Audio Mixer,,,About This Widget Book,Widget Font Quick Reference,Using The Widget Font,Widget Dependencies,Using The Cover Routines,Window Styles
menuList
charlist
choice
tbkmmsbk
sysBookPath
*.sbk
Please find the sysBook tbkmm.sbk.
Save the tbkmm.sbk sysBook path.
OpenDlg
tbkmm.sbk
This is not tbkmm.sbk
sysBookPath
search
author
Search for:
Cancel
Cannot find "
". Search from beginning of book?
Cannot find "
oldPage
prompt
s_oldSearch
editScript
settimer
Unable to select text in the script window.
killtimer
scriptText
phase
getfocus
className
BufEdit
getparent
postmessage
setwindowtext
getparent
postmessage
getparent
getparent
postmessage
killtimer
class
phase
scriptText
classname
getclassname
class
aboutWidgets
aboutDlgInit
aboutDlgBox
dialog
retValue
first
reader
setDefaultButtonStyle
pushButton
0,75.3125,0
sysButtonStyle
isPosInt
eatclicks
GlobalAlloc
GlobalLockPointer_
GlobalFree
PeekMsg_
PeekMsg_
PeekMsg_
GlobalUnlock
GlobalFree
wFlags
dwBytes
lpMsg
onOrOff
menuName
GetWindowWord
LoadMenu
GetMenuItemCount
GlobalAlloc
GlobalLock
GetMenuString
GlobalUnlock
GlobalFree
DestroyMenu
MenuCount
hMenu
hBuffer
lpBuffer
result
hInstance
USName
4s_bmpHandle
FALSE
--close other bitmap that might be
tbkBitmap("
/dibFile")
overlapped
tbkBitmapchk("
dib3.
@ alias
I style
" &&
,1,1)
j state
translating
emessages
status
translatewindowmessage
bmpWindowClose
bmpButtonDown
untranslate
they
unTranslateAllWindowMessages
Graphics:
Buttons"
a timer
edirectly (Alt-f4)
lets
efinish closing
4sending a
--which
turn sends a
file
windows
tbkTimerStart("single",500,100,
tbkMMTimer
ttonUp
buttonDown
bmpButtonDown
bmpWindowClose
buttonUp
tbkMMTimer
buttonDown
buttonUp
close dibFile
tbkBitmap
open dib3.dib alias dibFile style overlapped parent
tbkBitmapchk
window dibFile state show
tbkBitmap
status dibFile window
tbkBitmap
bmpWindowClose
bmpButtonDown
close
s_bmpHandle
bmpButtonDown
close dibFile
tbkBitmap
close
Bitmap Graphics: Bitmap Buttons
s_bmpHandle
bmpWindowClose
single
tbkTimerStart
tbkMMTimer
5fbmpButtonDown
4s_device
Zswitch, x
-(y1,
"off"
tbkMCI("stop cdAudio wait","")
--use
asure
worked
:close
5","")
0,50.1875,0
tbkMCIchk("
shareable","",1,1)
ms","",1)
audio
on","")
--beginning
atus
track 1","")
H1000
" &&
msf","",1)
buttonUp
buttonUp
false
stop cdAudio wait
tbkMCI
close cdAudio
tbkMCI
open cdAudio shareable
tbkMCIchk
set cdAudio time format ms
tbkMCIchk
set cdAudio audio all on
tbkMCI
status cdAudio position track 1
tbkMCI
seek cdAudio to
tbkMCI
set cdAudio time format msf
tbkMCIchk
cdAudio
120,50,100
switch
s_device
Ztrack, len
asure the driver switch
turned on
"Driver Switch"
onumberOfTracks
FALSE
tbkMCIchk("status cdAudio length
" &&
"",1,1)
MSFfromMillisec(millisecFromMSF(
;) - 14)
bplay
" &&
& ":00:00:00
&&
& ":" &
,1,1)
tbkmmNotify
mode","")
"playing"
current
","")
"stopped"
"paused"
--initialize
selector
tracks
numTracks
! < 30
/ + 1
uttondown
buttonUp
buttondown
tbkmmNotify
tracks
buttondown
buttonUp
Driver Switch
Driver Switch
numberOfTracks
numberOfTracks
status cdAudio length track
tbkMCIchk
millisecFromMSF
MSFfromMillisec
play cdAudio from
:00:00:00 to
tbkMCIchk
track
tbkmmNotify
status cdAudio mode
tbkMCI
playing
status cdAudio current track
tbkMCI
stopped
paused
tracks
numberOfTracks
numTracks
"Driver Switch"
asure the CD Device
turned on
checkDevice trueOrFalse
--update
`Position, Track
Tracks
4s_device, s_idle
--bypass status queries
- isn't
xtbkMCI("
-cdAudio media present","")
sliderPosition
"Slider"
","")
E" <>
ms","")
","")
SliderPosition
length","")
msf","")
-- wait
messages
4updating following stuff
tracks
","")
current
b","")
avePage
checkDevice
leavePage
leavePage
Driver Switch
checkDevice
Driver Switch
Driver Switch
trueOrFalse
status cdAudio media present
tbkMCI
Position
Position
Track
Tracks
Slider
sliderPosition
status cdAudio position
tbkMCI
Position
Position
set cdAudio time format ms
tbkMCI
status cdAudio position
tbkMCI
Slider
SliderPosition
status cdAudio length
tbkMCI
set cdAudio time format msf
tbkMCI
status cdAudio number of tracks
tbkMCI
Tracks
Tracks
status cdAudio current track
tbkMCI
Track
Track
s_device
s_idle
Timers: Capability
g Controls
"capabilityResults"
leavePage
leavePage
capabilityResults
Only two capability items are available in the timer functions. The minimum resolution represents how often the tbkmmTimer message can be sent. The maximum period represents the longest delay possible for the timer.
Timers
Capability and Statuss
capability
Minimum Resolution:
Maximum Period:::
Capabilityes
Capabilityes
capabilityResults
Update capability
Zcapability
"capabilityResults"
tbkTimerCapability()
& CRLF &
buttonDown
buttonDown
capabilityResults
tbkTimerCapability
capabilityResults
capability
Update Capability
65535
Widget Dependencies
Widget Dependencies
For the widgets in this book to work correctly, several conditions must be met both in the ToolBook environment, and in the relationship between the widget objects and the page or background on which they reside.
TBKMM.SBK must be in startUpSysBooks. This causes the enterSystem
handler in the sysBook to initialize the multimedia environment.
bkdlg DLL
status fields and idle handler
sliders and idle handler
simple device controls and
the driver switchhhhhhh
editScript "
", tbkmmsbk()
buttonDown
buttonDown
editScript
to handle enterSystem
tbkmmsbk
The widget font TBKMMWID.FON must be present or many button captions will be incorrect.
TBKWIN.DLL, ToolBook's Windows DLL, is linked by the sysBook to allow use of the
yieldApp( ) function. This allows you to synchronize sound and animation.
TBKDLG.DLL is also linked by the sysBook to allow use of the opendlg( ) function. Many buttons prompt for a file name with this function.
Compound devices such as Wave Audio and MIDI use aliases.. driver switche handler
simple device controls and
the driver switch
editScript "
yieldApp()",
B"Roll The Wheel"
"Wave Audio:
Sound
Animation"
buttonDown
buttonDown
editScript
get yieldApp()
Roll The Wheel
Wave Audio: Sound and Animation
editScript "
OpenDlg",
B"Play And Wait"
"Wave Audio:
File Buttons"
buttonDown
buttonDown
editScript
get OpenDlg
Play And Wait
Wave Audio: Wave File Buttons
Aliases, system variables and user properties of note are listed in the Script Notes field at the bottom left corner of each widget page. Click their names to see where they're initialized.
Widget pages containing status fields such as Position, Track or Length fields usually require an idle handler in the page script. These handlers may also update the positions of sliders.
Simple controls for devices like CD Audio usually have a
Driver Switch . Other controls may reference this switch...r properties to see where they're set.
editScript "
"CD Audio:
Small Simple Controls"
buttonDown
buttonDown
editScript
to handle idle
CD Audio: Small Simple Controls
064/4
editScript "
""Driver Switch""",
"Track Selector"
"CD Audio:
buttonDown
buttonDown
editScript
if not on of group "Driver Switch"
Track Selector
CD Audio: Track Selector
Widget Font Quick Reference
4s_oldScroll
"widgetFont"
"bigfontlist"
enterpage
leavepage
enterpage
widgetFont
s_oldScroll
leavepage
bigfontlist
widgetFont
s_oldScroll
The Widget Font
Quick Reference
The font TBKMMWID.FON supplied with Multimedia ToolBook is installed dynamically into your system when ToolBook is started with TBKMM.SBK as a system book. The file TBKMMWID.FON itself must be in the DOS path.
This font contains symbols for many multimedia controls and operations. This table shows the ANSI values with the corresponding characters.rs.
You can type any character by holding the Alt key down and typing the ANSI value of the character on the numeric keypad, with enough leading zeros for a total of 4 digits. Release the Alt key when you have finished typing the ANSI value.
Some characters in this font are designed to be used in pairs, for instance
The next page explains some of the advantages and disadvantages of using this special font...
ANSI Widgettttt
widgetFont
buttonDown
buttonDown
textFromPoint
32
33 !
34 "
35 #
36 $
37 %
38 &
39 '
40 (
41 )
42 *
43 +
44 ,
45 -
46 .
47 /
48 0
49 1
50 2
51 3
52 4
53 5
54 6
55 7
56 8
57 9
58 :
59 ;
60 <
61 =
62 >
63 ?
64 @
65 A
66 B
67 C
68 D
69 E
70 F
71 G
72 H
73 I
74 J
75 K
76 L
77 M
78 N
79 O
80 P
81 Q
82 R
83 S
84 T
85 U
86 V
87 W
88 X
89 Y
90 Z
91 [
92 \
93 ]
94 ^
95 _
96 `
97 a
98 b
99 c
100 d
101 e
102 f
103 g
104 h
105 i
106 j
107 k
108 l
109 m
110 n
111 o
112 p
113 q
114 r
115 s
116 t
117 u
118 v
119 w
120 x
121 y
122 z
123 {
124 |
125 }
126 ~
"bigFontList"
printerPageBitmap
FALSE
buttonUp
buttonUp
bigFontList
bigFontList
bigFontList
Print Font Reference Sheet
"bigFontList"
B"bigfontList"
buttonUp
buttonUp
bigFontList
bigfontList
Show Font Reference Sheet
Click a character to copy it to the clipboard.
bigfontlist
bigfontlist
032 033 ! 034 " 035 # 036 $ 037 % 038 & 039 ' 040 ( 041 ) 042 * 043 + 044 , 045 - 046 . 047 / 048 0 049 1 050 2 051 3 052 4 053 5 054 6 055 7 056 8 057 9 058 : 059 ; 060 < 061 = 062 > 063 ? 064 @ 065 A 066 B 067 C 068 D 069 E 070 F 071 G 072 H 073 I 074 J 075 K 076 L 077 M 078 N 079 O 080 P 081 Q 082 R 083 S 084 T 085 U 086 V 087 W 088 X 089 Y 090 Z 091 [ 092 \ 093 ] 094 ^ 095 _ 096 ` 097 a 098 b 099 c 100 d 101 e 102 f 103 g 104 h 105 i 106 j 107 k 108 l 109 m 110 n 111 o 112 p 113 q 114 r 115 s 116 t 117 u 118 v 119 w 120 x 121 y 122 z 123 { 124 | 125 } 126 ~ 127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
[OK]
bigFontList
&4S^/
buttonUp
buttonUp
ZstartPos, endPos, timeFormat
"Start Position"
"Please
a clip
"End
tbkMCI("status videodisc
","")
setDefaultButtonStyle
2000,750
"Videodisc Clip"
}" & CRLF & TAB & \
ZoldTimeFormat" &
shareable"",
)" &
" && \
)" &
" &&
& """,
)" &
"play
" &&
&& \
" &&
&& "wait"",
)" &
"" &&
)" &
"close
)" &
Bthat plays
" &&
&& \
" &&
&& "has been copied
the clipboard."
buttonDown
buttonDown
Start Position
Please select a clip first.
Start Position
End Position
status videodisc time format
tbkMCI
setDefaultButtonStyle
Videodisc Clip
to handle buttonUp
local oldTimeFormat
get tbkMCI("open videodisc shareable","")
set oldTimeFormat to
tbkMCI("status videodisc time format","")
get tbkMCI("set videodisc time format
","")
get tbkMCI("play videodisc from
wait","")
get tbkMCI("set videodisc time format to" && oldTimeFormat,"")
get tbkMCI("close videodisc","")
A button that plays from
has been copied to the clipboard.
startPos
endPos
timeFormat
4s_aniHandle
ofileName
tbkMCI("status aniFile ready","")
` <>
untranslateAllWindowMessages
fclose
_","")
tbkMCIchk("
" &&
&& "alias
style popup", "",1,1)
state
","",1)
the animation
translating
emessages
","",1)
translateWindowMessage
aniClose
animateWindowClose
play
","",1)
--we use a
here since a timer
--notification handler might
doesn't have access
container
unTranslateAllWindowMessages
","")
--This handles
closes
edirectly (Alt-f4)
--Start
efinish its
Fclean
finished
tbkTimerStart("single",500,100,
tbkMMTimer
OpenDlg(".", "*.fl?", "Choose
B.", "
Animation
buttonUp
animateWindowClose
tbkMMTimer
aniClose
rightButtonUp
buttonUp
fileName
prightButtonUp
status aniFile ready
tbkMCI
close aniFile
tbkMCI
fileName
alias aniFile style popup
tbkMCIchk
window aniFile state show
tbkMCIchk
status aniFile window handle
tbkMCIchk
aniClose
animateWindowClose
play aniFile
tbkMCIchk
s_aniHandle
aniClose
close aniFile
tbkMCI
s_aniHandle
animateWindowClose
single
tbkTimerStart
tbkMMTimer
^aniClose
rightButtonUp
*.fl?
Choose an animation file for this button.
Choose Animation File
OpenDlg
fileName
fileName
Using the Widget font
in apps
Using the Widget Font in Your Applicationss
The widget font is installed dynamically in your ToolBook application by the ToolBook multimedia extensions. The advantage of this is that the font does not have to be formally installed in Windows, but becomes available automatically as long as the file TBKMMWID.FON which you got as part of the multimedia extensions for ToolBook is in the DOS path.
Advantages of the Widget font
* Make graphic button captions and indicators.
* Button captions and indicators are easy to change, because you simply change characters, not graphics.
* Reduces the object count, which makes your applications work faster and keeps their file size smaller.
* Change the color of an icon simply by changing the stroke color of the button or field that contains it.ins it.ontains it.t contains it. that contains it...
Disadvantages of the Widget font
* You can't make multicolored icons, since each ToolBook button or field is limited to one stroke color at a time.
* If TBKMMWID.FON is not in the path, Windows substitutes a standard font that won't look anything like what you designed. However, this is the least of your problems if the required DLLs and system books cannot be found. Simply make sure that the setup program or instructions handle this carefully.y.y..arefully.carefully.
buttonDown
buttonDown
k:to2
i:to1
changeCaption "
7capt
buttonDown
changeCaption
buttonDown
0changeCaption
0changeCaption
0changeCaption
0changeCaption
changeCaption
buttonDown
buttonDown
o(41)
o(40)
o(39)
o(36)
o(33)
o(34)
o(35)
o(38)
buttonDown
buttonDown
buttonDown
buttonDown
k:to2
j:to1
buttonDown
buttonDown
k:to2
j:to1
buttonDown
buttonDown
k:to2
j:to1
buttonDown
buttonDown
buttonDown
buttonDown
"Driver switch"
FALSE
checkDevice trueOrFalse
JSwitch"
4s_device, s_idle
--bypass queries
"Length"
"Track"
"Position"
-- wait
messages
4updating stuff
xtbkMCI("status videodisc media present","")
--update
fields
","")
oldF
","")
ms","")
" &&
<,"")
current track","")
length","")
avePage
checkDevice
leavePage
leavePage
Driver switch
Driver switch
checkDevice
Driver Switch
Driver Switch
trueOrFalse
Length
Length
Track
Position
status videodisc media present
tbkMCI
status videodisc position
tbkMCI
Position
Position
status videodisc time format
tbkMCI
set videodisc time format ms
tbkMCI
set videodisc time format
tbkMCI
status videodisc current track
tbkMCI
Track
Track
status videodisc length
tbkMCI
Length
Length
s_device
s_idle
4s_scroll
"icons"
clearExplanation
FALSE
"explain"
4s_target
offSetNumber
(selectedTextLines
keyEnter
selectedTextlines
clearExplanation
leavePage
buttonDown
keyChar
enterPage
leaveField
enterPage
icons
s_scroll
leavePage
clearExplanation
clearExplanation
explain
icons
s_scroll
buttonDown
offSetNumber
s_target
keyChar
buttonDown
s_target
leaveField
P"6#
%f'2(
.V/81
explain
Point to the buttons at the top of the page to see an explanation of what they do.
Click a Topic button to go to the first page of that topic. Click a Topic name to go to that page.
Topicss
icons
the most recently visited
"explain"
clearExplanation
ouseEnter
mouseLeave
mouseEnter
buttonUp
mouseEnter
Go to the most recently visited page.
explain
mouseLeave
clearExplanation
buttonUp
txClassName
button
defStroke
0,0,0
Previous
"explain"
clearExplanation
ouseEnter
mouseLeave
mouseEnter
buttonUp
mouseEnter
Go to the previous page.
explain
mouseLeave
clearExplanation
buttonUp
txClassName
button
defStroke
0,0,0
"explain"
clearExplanation
tonUp
mouseEnter
buttonUp
mouseLeave
buttonUp
mouseEnter
Go to the next page.
explain
mouseLeave
clearExplanation
txClassName
button
defStroke
0,0,0
"Return here."
"explain"
clearExplanation
mouseEnter
mouseLeave
mouseEnter
Return here.
explain
mouseLeave
clearExplanation
defStroke
0,0,0
txClassName
button
Index
"Pop up the Index
"explain"
clearExplanation
index
ouseEnter
mouseLeave
mouseEnter
buttonUp
mouseEnter
Pop up the Index menu.
explain
mouseLeave
clearExplanation
buttonUp
index
txClassName
button
CLASSname
txButton
Widgets
widgets."
"explain"
clearExplanation
ouseEnter
mouseLeave
mouseEnter
buttonUp
mouseEnter
Go to the first page of widgets.
explain
mouseLeave
clearExplanation
buttonUp
txClassName
button
defStroke
0,0,0
Widgets
reference section."
"explain"
clearExplanation
ouseEnter
mouseLeave
mouseEnter
buttonUp
mouseEnter
Go to the first page of the reference section.
explain
mouseLeave
clearExplanation
buttonUp
reference
defStroke
0,0,0
txClassName
button
Reference
Search
"Search
"explain"
clearExplanation
ouseEnter
mouseLeave
mouseEnter
buttonUp
mouseEnter
Search for text.
explain
mouseLeave
clearExplanation
buttonUp
search
defStroke
0,0,0
txClassName
button
Search...
"Wave Audio:
File Buttons"
buttonDown
buttonDown
Wave Audio: Wave File Buttons
Wave Audio
offsetNumber
Generic Wave Buttons
Simple Controls
Recording Controls
Capability and Status
Sound and Animation
Event Editor
& "}," & \
," & \
," & \
," & \
"Bitmap Graphics:
Buttons"
buttonDown
buttonDown
Bitmap Graphics: Bitmap Buttons
Bitmap Graphics
x!offsetNumber
Generic Bitmap Buttons
A Bitmap Index
"CD Audio:
Small Simple Controls"
buttonDown
buttonDown
CD Audio: Small Simple Controls
CD Audio
#offsetNumber
Small Controls
Large Controls
Track Selector
Capability and Status
Event Editor
CD to Wave Converter
"MIDI Sequencer:
Buttons"
buttonDown
buttonDown
MIDI Sequencer: Buttons
Q &'"
L&offsetNumber
Generic MIDI Buttons
Simple Controls
Capability and Status
Event Editor
MIDI to Wave Converter
"Animation:
Buttons"
buttonDown
buttonDown
Animation: Buttons
Animation
(offsetNumber
Generic Animation Buttons
More Buttons
Control Panel
Capability and Status
Event Editor
"Videodisc:
Simple Controls"
buttonDown
buttonDown
Videodisc: Simple Controls
Videodisc
4+offsetNumber
Simple Controls
A Control Panel
Capability and Status
Event Editorr
"Timers:
Simple Timing Controls"
buttonDown
buttonDown
Timers: Simple Timing Controls
Timers
-offsetNumber
Simple Timing Controls
Capabilityndex
"Generic:
3D Objects"
buttonDown
buttonDown
Generic: 3D Objects
Generic Controls
/offsetNumber
3D Objects
Horizontal Sliders
Vertical Sliders
Fancy Sliders
Dog Sliders
Audio Mixer
Animation
Event Editor
& "}," & \
," & \
," & \
," & \
"About This Widget Book"
buttonDown
buttonDown
About This Widget Book
Reference
2offsetNumber
About this Widget Book
Font Quick Reference
Using the Widget Font
Widget Dependencies
Using Check Functions
Window Styles of Window tl
Go to the most recently visited page.
4s_device
Zswitch, x
-(y1,
"off"
tbkMCI("stop cdAudio wait","")
--use
asure
worked
:close
5","")
0,50.1875,0
tbkMCIchk("
shareable","",1,1)
ms","",1)
audio
on","")
--beginning
atus
track 1","")
H1000
" &&
msf","",1)
buttonUp
buttonUp
false
stop cdAudio wait
tbkMCI
close cdAudio
tbkMCI
open cdAudio shareable
tbkMCIchk
set cdAudio time format ms
tbkMCIchk
set cdAudio audio all on
tbkMCI
status cdAudio position track 1
tbkMCI
seek cdAudio to
tbkMCI
set cdAudio time format msf
tbkMCIchk
cdAudio
120,50,100
switch
s_device
MIDI Sequencer: Buttons
Page Index
Generic: Horizontal Sliders
4s_vLength, oldF, sMode
checkDevice TRUE
tbkMCI("status videodisc mode","")
","")
ms","")
tbkMCIchk("
Slength","",1,1)
"milliseconds"
* sliderPosition
"HMS"
HMSFromMillisec(
"frames"
("capability
wplay rate","")/1000)
" &&
* SliderPosition
),"")
" &&
"playing"
","")
updateSlider "
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
checkDevice
status videodisc mode
tbkMCI
status videodisc time format
tbkMCI
set videodisc time format ms
tbkMCI
status videodisc length
tbkMCIchk
s_vLength
sMode
buttonStillDown
milliseconds
position
sliderPosition
position
sliderPosition
HMSFromMillisec
frames
position
sliderPosition
capability videodisc normal play rate
tbkMCI
s_vLength
buttonUp
seek videodisc to
SliderPosition
tbkMCI
set videodisc time format
tbkMCI
playing
play videodisc
tbkMCI
updateSlider
forward
s_vLength
sMode
cd Audio: Track Selector
"Driver Switch"
leavePage
leavePage
Driver Switch
CD Audio
Track Selector
lector
This track selector group can be copied to your application. It is not dependent on a page script.tch.
uttons".
This track selector object is made from a group of 30 buttons. When the Driver On/Off switch is turned on, it
initializes the driver, disc and the track selector by showing as many buttons as there are tracks on your CD.......CD.You can also initialize the track selector by right clicking it...by right clicking it..
editScript "
tbkMCIchk(""
cdAudio shareable""",
"Driver switch"
buttonDown
buttonDown
editScript
get tbkMCIchk("open cdAudio shareable"
Driver switch
editScript "
tracks
numTracks",
Selector"
buttonDown
buttonDown
editScript
to set tracks to numTracks
Track Selector
txclassname
3DFrame Recessed
txclassname
3DFrame Recessed
Driver
On/Off
Driver switch
Zswitch, x
-(y1,
"off"
tbkMCI("stop cdAudio wait","")
--use
asure
worked
:close
5","")
0,50.1875,0
tracks
"Track Selector"
tbkMCIchk("
shareable","",1,1)
tmsf","",1)
audio
on","")
zstatus
","",1)
buttonUp
buttonUp
false
stop cdAudio wait
tbkMCI
close cdAudio
tbkMCI
Track Selector
tracks
open cdAudio shareable
tbkMCIchk
120,50,100
set cdAudio time format tmsf
tbkMCIchk
set cdAudio audio all on
tbkMCI
status cdAudio number of tracks
tbkMCIchk
Track Selector
tracks
switch
txclassname
vSwitchHandle
Track Selector
numberOfTracks
4s_device
Zswitch, x
-(y1,
"off"
tbkMCI("stop cdAudio wait","")
--use
asure
worked
:close
5","")
0,50.1875,0
tbkMCIchk("
shareable","",1,1)
ms","",1)
audio
on","")
--beginning
atus
track 1","")
H1000
" &&
msf","",1,1)
buttonUp
buttonUp
false
stop cdAudio wait
tbkMCI
close cdAudio
tbkMCI
open cdAudio shareable
tbkMCIchk
set cdAudio time format ms
tbkMCIchk
set cdAudio audio all on
tbkMCI
status cdAudio position track 1
tbkMCI
seek cdAudio to
tbkMCI
set cdAudio time format msf
tbkMCIchk
cdAudio
120,50,100
switch
s_device
"Driver switch"
FALSE
checkDevice trueOrFalse
JSwitch"
4s_device, s_idle
--bypass queries
xtbkMCI("status videodisc media present","")
"Length"
"Track"
"Position"
-- wait
messages
4updating stuff
--update Slider
fields
","")
oldF
","")
ms","")
sliderPosition
","")\
length","")
" &&
current track","")
updateSlider dir
type","") = "CAV"
capability
wplay rate","") / \
) / 2) + .5
"reverse"
.5 - ((
f) / 2)
"still"
speed control"
checkDevice
leavePage
updateSlider
leavePage
Driver switch
Driver switch
checkDevice
Driver Switch
Driver Switch
trueOrFalse
status videodisc media present
tbkMCI
Length
Length
Track
Position
status videodisc position
tbkMCI
Position
Position
status videodisc time format
tbkMCI
set videodisc time format ms
tbkMCI
position slider
sliderPosition
status videodisc position
tbkMCI
status videodisc length
tbkMCI
set videodisc time format
tbkMCI
status videodisc current track
tbkMCI
Track
Track
status videodisc length
tbkMCI
Length
Length
s_device
s_idle
updateSlider
status videodisc media type
tbkMCI
forward
capability videodisc normal play rate
tbkMCI
capability videodisc fast play rate
tbkMCI
reverse
capability videodisc normal play rate
tbkMCI
capability videodisc fast play rate
tbkMCI
still
still
videodisc speed control
sliderPosition
4s_MediaType
checkDevice TRUE
s_mediaType
tbkMCIchk("status videodisc
$ type","",1,1)
"CAV"
:("play
1scan","")
4s_pos,s_vLength
ms","")
","")
length","")
H1000
HMSFromMillisec(
","")
updateSlider "
" &&
"",1)
","")
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
checkDevice
s_mediaType
status videodisc media type
tbkMCIchk
play videodisc scan
tbkMCI
set videodisc time format ms
tbkMCI
status videodisc position
tbkMCI
status videodisc length
tbkMCI
s_pos
s_vLength
s_MediaType
buttonStillDown
position
HMSFromMillisec
s_pos
s_vLength
s_MediaType
buttonUp
play videodisc
tbkMCI
updateSlider
forward
play videodisc from
tbkMCIchk
set videodisc time format HMS
tbkMCI
updateSlider
forward
s_pos
s_vLength
s_MediaType
Videodisc: Control Panels
This panel was made from objects on the previous page.
Note that you must open the videodisc device before using these controls, and close it when you no longer need it. Use the Driver switch to do this.
This control panel requires no page script.require this page's idle handler. You must copy the handler into the page or background where you paste these elements if you want them to update correctly. This version of the handler is for CAV discs only.... CAV discs only.cs only.
Videodisc
A Control Panelss
checkDevice trueOrFalse
"Driver Switch"
checkDevice
checkDevice
Driver Switch
Driver Switch
trueOrFalse
Driver switch
4s_device
Zswitch, x
-(y1,
"off"
tbkMCI("stop videodisc wait","")
--use
asure
worked
<close
7","")
0,50.1875,0
tbkMCIchk("
shareable","",1,1)
buttonUp
buttonUp
false
stop videodisc wait
tbkMCI
close videodisc
tbkMCI
open videodisc shareable
tbkMCIchk
videodisc
120,50,100
switch
s_device
txclassname
vSwitchHandle
txclassname
3DFrame Recessed
checkDevice TRUE
tbkMCI("status videodisc mode","")
tbkMCIchk("
'door closed","",1)
","",1)
buttonUp
buttonUp
checkDevice
status videodisc mode
tbkMCI
set videodisc door closed
tbkMCIchk
set videodisc door open
tbkMCIchk
checkDevice TRUE
tbkMCIchk("stop videodisc","",1,1)
buttonUp
buttonUp
checkDevice
stop videodisc
tbkMCIchk
checkDevice TRUE
tbkMCIchk("seek videodisc
0","",1,1)
buttonUp
buttonUp
checkDevice
seek videodisc to 0
tbkMCIchk
4s_MediaType
checkDevice TRUE
s_mediaType
tbkMCIchk("status videodisc
$ type","",1,1)
"CAV"
:("play
1reverse scan","")
4s_pos
ms","")
","")
U > 0
H1000
","")
" &&
,"",1)
HMS","")
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
checkDevice
s_mediaType
status videodisc media type
tbkMCIchk
play videodisc reverse scan
tbkMCI
set videodisc time format ms
tbkMCI
status videodisc position
tbkMCI
s_pos
s_MediaType
buttonStillDown
s_MediaType
s_pos
buttonUp
play videodisc reverse
tbkMCI
play videodisc from
tbkMCIchk
set videodisc time format HMS
tbkMCI
s_pos
s_MediaType
checkDevice TRUE
tbkMCIchk("play videodisc reverse","",1,1)
buttonUp
buttonUp
checkDevice
play videodisc reverse
tbkMCIchk
checkDevice TRUE
tbkMCIchk("
videodisc reverse","",1,1)
buttonDown
buttonStillDown
buttonDown
checkDevice
buttonStillDown
step videodisc reverse
tbkMCIchk
checkDevice TRUE
tbkMCIchk("
videodisc","",1,1)
buttonUp
buttonUp
checkDevice
pause videodisc
tbkMCIchk
checkDevice TRUE
tbkMCIchk("
videodisc","",1,1)
buttonDown
buttonStillDown
buttonDown
checkDevice
buttonStillDown
step videodisc
tbkMCIchk
checkDevice TRUE
tbkMCI("play videodisc","")
buttonUp
buttonUp
checkDevice
play videodisc
tbkMCI
4s_MediaType
checkDevice TRUE
s_mediaType
tbkMCIchk("status videodisc
$ type","",1,1)
"CAV"
:("play
1scan","")
4s_pos,s_vLength
ms","")
","")
length","")
H1000
","")
" &&
"",1)
HMS","")
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
checkDevice
s_mediaType
status videodisc media type
tbkMCIchk
play videodisc scan
tbkMCI
set videodisc time format ms
tbkMCI
status videodisc position
tbkMCI
status videodisc length
tbkMCI
s_pos
s_vLength
s_MediaType
buttonStillDown
s_MediaType
s_pos
s_vLength
buttonUp
play videodisc
tbkMCI
play videodisc from
tbkMCIchk
set videodisc time format HMS
tbkMCI
s_pos
s_vLength
s_MediaType
cd Audio: Large Simple Controls
#$&F)
,^0N4z5
CD Audio
Large Simple Controls
ntrols
These are large versions of the controls on the preceding page. For a description of these controls, see that page.
s_device : a system variable used in the idle handler to bypass status queries if the device isn't open.
s_idle : a system variable use to count idle messages.
s_prompt : a system variable containing the last value entered when prompting for the play from/to positions.
s_start : a system variable used in the Scan Reverse button, Stop button and slider thumb containing the starting position of track 1.
s_end : a system variable used in the Scan Forward button containing the end position of the disc.
Play from (Examples: "3:45 to 4:17", "track 4 to 9"):
cancel
track
set cdAudio time format tmsf
tbkMCIchk
play cdAudio from
:00:00:00 to
:00:00:00
tbkMCIchk
set cdAudio time format msf
tbkMCI
set cdAudio time format msf
tbkMCIchk
play cdAudio from
:00 to
tbkMCIchk
s_prompt
4txclassname
3DFrame Recessed
Tracks
Track
Position
Position:
Current Track:
Tracks on Disc:
Slider
:txClassName
Slider
^=,@2
thumb
--thumb
play cd audio
slider
Zlen, startDisc
checkDevice TRUE
tbkMCIchk("
cdaudio
ms","",1,1)
'status
$length","",1,1)
(SliderPosition
<cdAudio
track 1","",1) + 1000
" &&
,"",1)
msf","",1)
buttonUp
buttonUp
checkDevice
set cdaudio time format ms
tbkMCIchk
status cdaudio length
tbkMCIchk
SliderPosition
status cdAudio position track 1
tbkMCIchk
play cdaudio from
tbkMCIchk
set cdAudio time format msf
tbkMCIchk
startDisc
P@D@defStrokeColor
0,0,0
h@^@width
@v@glide
line id 193 of page id 2
@defFillColor
0,100,0
@txClassName
HSliderThumb
fAtxclassname
3DFrame Recessed
Eject
checkDevice TRUE
tbkMCIchk("status cdAudio mode","",1,1)
"door closed","",1)
","",1)
buttondown
buttondown
checkDevice
status cdAudio mode
tbkMCIchk
set cdAudio door closed
tbkMCIchk
set cdAudio door open
tbkMCIchk
Videodisc: Simple Controls
>"l#
The Driver On/Off switch opens and
closes the device and initializes the disc. The slider position, as well as the track and position fields, are updated by an idle handler which queries the status of the videodisc driver. You could also use timer services provided by the tbkTimer functions to update those at a rate over which you will have much more control.
The slider's main script is in the system book TBKMM.SBK. If you change any of the local scripts in the slider, be sure to forward the button event messages for which you write or modify the handlers.
Most of the widgets on this page require this page's script. Each button control sends a checkDevice message. The checkDevice handler in the page script makes sure the driver switch has been turned on. Status fields are update by the page script's idle handler.
e correctly. r background where you paste these elements if you want them to update correctly.
editScript "
tbkMCIchk(""
videodisc shareable""",
"Driver switch"
buttonDown
buttonDown
editScript
get tbkMCIchk("open videodisc shareable"
Driver switch
editScript "
tbkmci(""close videodisc""",
"Driver switch"
buttonDown
buttonDown
editScript
get tbkmci("close videodisc"
Driver switch
editScript "
buttondown
buttondown
editScript
to handle idle
editScript "
|", tbkmmsbk()
buttonDown
buttonDown
editScript
to handle buttonStillDown
tbkmmsbk
editScript "
tbkmci(""play videodisc",
B"Videodisc Position Thumb"
buttonDown
buttonDown
editScript
get tbkmci("play videodisc
Videodisc Position Thumb
s_device : a system variable used in the idle handler to bypass status queries.
s_idle : a system variable use to count idle messages.
s_prompt : a system variable containing the last value entered when prompting for the play from/to positions.
s_MediaType : a system variable inidicating that the videodisc is CAV or CLV format.
s_pos : a system variable containing the current position of the disc in milliseconds while scanning forward.
s_vLength : a system variable containing the length of the disc in milliseconds while scanning forward.
editScript "
s_device",
"driver switch"
buttonDown
buttonDown
editScript
set s_device
driver switch
editScript "
us_idle",
buttonDown
buttonDown
editScript
decrement s_idle
editScript "
tbkMCIchk(""play videodisc
"" && s_prompt",
buttonUp
buttonUp
editScript
get tbkMCIchk("play videodisc from" && s_prompt
play from
editScript "
s_mediaType
tbkMCIchk(""status videodisc
% type",
B"Reverse Scan"
buttonDown
buttonDown
editScript
set s_mediaType to tbkMCIchk("status videodisc media type
Reverse Scan
editScript "
s_pos
tbkMCI(""status videodisc
B"Forward Scan"
buttonDown
buttonDown
editScript
set s_pos to tbkMCI("status videodisc position
Forward Scan
editScript "
s_vLength
tbkMCI(""status videodisc length",
B"Forward Scan"
buttonDown
buttonDown
editScript
set s_vLength to tbkMCI("status videodisc length
Forward Scan
Videodisc
Simple Controlse controls
Position:
Track: : rack:
txclassname
3DFrame Recessed
Change Speed
Length:
Driver On/Off
Driver switch
4s_device
Zswitch, x
-(y1,
"off"
tbkMCI("stop videodisc wait","")
--use
asure
worked
<close
7","")
0,50.1875,0
tbkMCIchk("
shareable","",1,1)
buttonUp
buttonUp
false
stop videodisc wait
tbkMCI
close videodisc
tbkMCI
open videodisc shareable
tbkMCIchk
videodisc
120,50,100
switch
s_device
txclassname
vSwitchHandle
Scan rt
Play
Step rt
Pause t
Step rt
Play rt
Scan rt
checkDevice TRUE
tbkMCIchk("play videodisc reverse","",1,1)
updateSlider "
buttonUp
buttonUp
checkDevice
play videodisc reverse
tbkMCIchk
updateSlider
reverse
checkDevice TRUE
tbkMCIchk("
videodisc reverse","",1,1)
updateSlider "still"
buttonDown
buttonStillDown
buttonDown
checkDevice
buttonStillDown
step videodisc reverse
tbkMCIchk
updateSlider
still
checkDevice TRUE
tbkMCIchk("
videodisc","",1,1)
updateSlider "still"
buttonUp
buttonUp
checkDevice
pause videodisc
tbkMCIchk
updateSlider
still
checkDevice TRUE
tbkMCIchk("
videodisc","",1,1)
updateSlider "still"
buttonDown
buttonStillDown
buttonDown
checkDevice
buttonStillDown
step videodisc
tbkMCIchk
updateSlider
still
checkDevice TRUE
tbkMCI("play videodisc","")
updateSlider "
buttonUp
buttonUp
checkDevice
play videodisc
tbkMCI
updateSlider
forward
Forward Scan
Reverse Scan
4s_MediaType
checkDevice TRUE
s_mediaType
tbkMCIchk("status videodisc
$ type","",1,1)
"CAV"
:("play
1reverse scan","")
4s_pos
ms","")
","")
` > 0
H1000
HMSFromMillisec(
","")
updateSlider "
" &&
,"",1)
","")
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
checkDevice
s_mediaType
status videodisc media type
tbkMCIchk
play videodisc reverse scan
tbkMCI
set videodisc time format ms
tbkMCI
status videodisc position
tbkMCI
s_pos
s_MediaType
buttonStillDown
position
HMSFromMillisec
s_pos
s_MediaType
buttonUp
play videodisc reverse
tbkMCI
updateSlider
reverse
play videodisc from
tbkMCIchk
set videodisc time format HMS
tbkMCI
updateSlider
forward
s_pos
s_MediaType
checkDevice TRUE
tbkMCIchk("seek videodisc
0","",1,1)
buttonUp
buttonUp
checkDevice
seek videodisc to 0
tbkMCIchk
checkDevice TRUE
tbkMCIchk("stop videodisc","",1,1)
buttonUp
buttonUp
checkDevice
stop videodisc
tbkMCIchk
Restart
Stop rt
Play From
4s_prompt
checkDevice TRUE
("Play
where?" &
& "(Examples:" &&
& 1234 &
& ")"
tbkMCIchk("play videodisc
" &&
,"",1,1)
updateSlider "
buttonUp
buttonUp
checkDevice
Play from where?
(Examples:
play videodisc from
tbkMCIchk
updateSlider
forward
s_prompt
Play To
4s_prompt
checkDevice TRUE
("Play
where?" &
& "(Example:" &&
& 1234 &
&")"
tbkMCIchk("play videodisc
" &&
,"",1,1)
0("status
","")
updateSlider "reverse"
buttonUp
buttonUp
checkDevice
Play to where?
(Example:
cancel
play videodisc to
tbkMCIchk
status videodisc position
tbkMCI
updateSlider
reverse
updateSlider
forward
s_prompt
Play From To
4s_prompt
checkDevice TRUE
("Play
where
?" &
& "(Example:" &&
& "1234
1345" &
& ")"
xisNumber(ep)
tbkMCIchk("play videodisc
" && sp && "
" && ep,"",1,1)
ep < sp
updateSlider "reverse"
buttonUp
buttonUp
checkDevice
Play from where to where?
(Example:
1234 to 1345
isNumber
play videodisc from
tbkMCIchk
updateSlider
reverse
updateSlider
forward
s_prompt
Play From....
Play To...
Play FromTo...
Videodisc Speed Control
9txClassName
Slider
checkDevice TRUE
tbkMCI("capability videodisc
play rate","")
SliderPosition
- .5
p < -.02
p > .02
s","")
status
media type","") <> "CLV"
(p * 2 *
p < 0
reverse speed" &&
<,"")
Y,"")
p < 0
U","")
","")
buttonUp
buttonUp
checkDevice
capability videodisc fast play rate
tbkMCI
SliderPosition
SliderPosition
pause videodisc
tbkMCI
status videodisc media type
tbkMCI
play videodisc reverse speed
tbkMCI
play videodisc speed
tbkMCI
play videodisc reverse
tbkMCI
play videodisc
tbkMCI
>width
>glide
group id 80 of page id 0
.?txClassName
hSliderThumb
Button
position slider
0.7447222222222222
Videodisc Position Thumb
T@H@defStrokeColor
0,0,0
l@b@width
@z@glide
line id 69 of page id 0
@defFillColor
0,100,0
@txClassName
HSliderThumb
checkDevice TRUE
tbkMCI("status videodisc mode","")
tbkMCIchk("
'door closed","",1)
","",1)
buttonUp
buttonUp
checkDevice
status videodisc mode
tbkMCI
set videodisc door closed
tbkMCIchk
set videodisc door open
tbkMCIchk
Eject t
Track
Position
Length
editScript "
checkDevice",
buttonDown
buttonDown
editScript
to handle checkDevice
Using The Cover Routines
Videodisc: Status
"CapabilityResults"
"StatusResults"
leavePage
leavePage
CapabilityResults
StatusResults
To use these status panels in your application, copy all the objects on this page and examine the script of the Update buttons.
How it works: The button script simply walks through the textlines of the Capability and Status fields and queries the driver for the term on each textline. The query results are stored in a variable and then displayed in the Capability and Status results fields.
editScript "
B"update capability"
buttonDown
buttonDown
editScript
step i from 1 to textLineCount(it)
update capability
Videodisc
Capability and Statususnd Status
txclassname
3DFrame Recessed
capability
Device type
Can record
Has audio
Has video
Compound device
Uses files
Can Reverse
Normal play rate
Fast play rate
Slow play rate
Can reverse CLV
Fast play rate CLV
Slow play rate CLV
capabilityResults
Capabilityes
Capabilityes
txclassname
3DFrame Recessed
status
Media Type
Number of tracks
Current track
Length
Media present
Position
Ready
Time format
Status
Status
statusResults
Update capability
Zcapability
"capabilityResults"
tbkMCI("
videodisc shareable","")
9" &&
,"") & \
CRLF
mclose
k","")
buttonDown
buttonDown
capabilityResults
open videodisc shareable
tbkMCI
capability
capability videodisc
tbkMCI
close videodisc
tbkMCI
capabilityResults
capability
Update Capability
Update Status
Zstatus
tbkMCI("
videodisc shareable","")
9" &&
,"") & \
CRLF
mclose
k","")
statusResults
buttonDown
buttonDown
open videodisc shareable
tbkMCI
status
status videodisc
tbkMCI
close videodisc
tbkMCI
statusResults
status
Update Status
Videodisc: Status
Videodisc: Status
Wave Audio: Simple Controls
B"Unload"
--update the
tbkMCI("status waveFile
","")
"Name"
"Length"
"Position"
sliderPosition
"Slider"
"length"
yieldApp()
leavepage
leavepage
buttonDown
Unload
status waveFile position
tbkMCI
Length
Position
Slider
sliderPosition
position
position
slider
sliderPosition
length
yieldApp
These widgets open a wave file and play all or parts of it. These controls work only if a wave file has been opened. To start, click the Load button to load a file from the disc and open the wave audio driver. The Load button
opens the device and a wave file, and the Unload button closes them. An
idle handler updates the Position field by querying the status of the wave audio driver.
The main slider control's script is in the system book TBKMM.SBK. The thumb button's script seeks to a new position in the wave file. If you change the script of the thumb button, be sure to forward the button event messages.
The Position field and the slider require this page's idle handler. You must copy the handler into the page or background where you paste these elements if you want them to update correctly. ctly. f you copy these fields, you need to use this page's idle handler.
editScript "
tbkmcichk(""
B"Load"
buttonDown
buttonDown
editScript
get tbkmcichk("open
editScript "
tbkmci(""close",
B"Unload"
buttonDown
buttonDown
editScript
get tbkmci("close
Unload
editscript "
buttonDown
buttonDown
editscript
to handle idle
editScript "
|", tbkmmsbk()
buttonDown
buttonDown
editScript
to handle buttonStillDown
tbkmmsbk
editScript "
tbkMCIchk(""seek",
B"thumb"
buttonDown
buttonDown
editScript
get tbkMCIchk("seek
thumb
waveFile : an alias for the wave file..
editScript "alias waveFile",
B"Load"
buttonDown
buttonDown
editScript
alias waveFile
Wave Audio
Simple Controls controlsmpound controlstrols
Restart
rack
Rewind
Pause t
Play rt
FF n rt
Unload
Play From....
Play To...
Play FromToo.
Length
Position
Position: ition:
Length: onds: e:
txclassname
3DFrame Recessed
Wave File: s: e:
slider
txClassName
Slider
thumb
--thumb
seek animation file
slider's
tbkMCIchk("status waveFile length","",1,1)
sliderPosition
" &&
,"",1)
buttonUp
buttonUp
status waveFile length
tbkMCIchk
sliderPosition
seek waveFile to
tbkMCIchk
txClassName
HSliderThumb
defFillColor
0,100,0
glide
line id 105 of page id 9
width
defStrokeColor
0,0,0
Stop t
ZfileName
a wave
OpenDlg(".", "*.
", "Please choose a
D.", "Choose Wave File")
--close old
B"Unload"
tbkMCIchk("
" &&
&& "alias waveFile","",1,1)
ms","",1)
"length"
astatus
,"",1)
buttonDown
buttonDown
*.wav
Please choose a wave file.
Choose Wave File
OpenDlg
buttonDown
Unload
alias waveFile
tbkMCIchk
set waveFile time format ms
tbkMCIchk
length
status waveFile length
tbkMCIchk
fileName
Restart
tbkMCIchk("seek waveFile
0","",1)
buttonDown
buttonDown
seek waveFile to 0
tbkMCIchk
Rewind
tbkMCIchk("status waveFile
","",1,1)
b(0, p - 100)
:eek
" && p,"",1)
buttonStillDown
buttonStillDown
status waveFile position
tbkMCIchk
seek waveFile to
tbkMCIchk
Pause
tbkMCIchk("
waveFile","",1)
buttonDown
buttonDown
pause waveFile
tbkMCIchk
tbkMCIchk("stop waveFile","",1)
0","",1)
buttonDown
buttonDown
stop waveFile
tbkMCIchk
seek waveFile to 0
tbkMCIchk
tbkMCIchk("play waveFile","",1)
yieldApp()
buttonDown
buttonDown
play waveFile
tbkMCIchk
yieldApp
tbkMCIchk("status waveFile" && "
","",1,1)
"Length", p + 100)
Jeek
" && p,"",1)
buttonStillDown
buttonStillDown
status waveFile
position
tbkMCIchk
Length
seek waveFile to
tbkMCIchk
Unload
--close the wave file
tbkMCI("
waveFile","")
buttonDown
buttonDown
close waveFile
tbkMCI
Play From
("Play
tbkMCIchk("play waveFile
" &&
,"",1)
yieldApp()
buttonDown
buttonDown
Play from
play waveFile from
tbkMCIchk
yieldApp
Play To
"Length"
("Play
tbkMCIchk("play waveFile
" &&
,"",1)
yieldApp()
buttonDown
buttonDown
Length
Play to
play waveFile from 0 to
tbkMCIchk
yieldApp
Play From To
"Length"
("Play
f"0," &
tbkMCIchk("play waveFile
" &&
&&
,"",1)
yieldApp()
buttonDown
buttonDown
Length
Play from, to
play waveFile from
tbkMCIchk
yieldApp
Bitmap Graphics: A Bitmap Index
You can copy and paste the Generic Bitmap Index Widget into your own application. Right click its scroll bar to assign it a series of bitmaps to display. You'll be prompted for a file name. The file names must end in a number. Choose the highest numbered one in a series of similarly-named bitmaps. For example choose IX16.DIB when the bitmap names start with IX1.DIB and end with IX16.DIB.
How it works: These widgets are actually text fields containing CRLFs. They work by hiding and showing bitmaps when they receive a textScrolled message.
ToolBook's dialog DLL, TBKDLG.DLL , needs to be linked for the generic widget's rightButtonUp handler to workkkttonUp handler to work "fileName".me".named ix1.dib through ix20.dib. It can be copied and pasted into any page.
nto any page.
y page.
with bitmaps named ix1.dib through ix20.dib. It can be copied and pasted into any page.
ose bitmaps as they're shown and hidden.maps as they're shown and hidden.tmaps as they're shown and hidden. and hidden..tmaps as they're shown and hidden..
editScript "
"bitmapIndex"
buttonDown
buttonDown
editScript
to handle rightButtonUp
bitmapIndex
editScript "
textScrolled",
"bitmapIndex"
buttonDown
buttonDown
editScript
to handle textScrolled
bitmapIndex
s_fileName : a system variable used to cache the non-numeric portion of the bitmaps' file names.
s_ext : a system variable used to cache the extension portion of the bitmaps' file names.
s_x : a system variable containing the x coordinate of the bitmap window.
s_y : a system variable containing the y coordinate of the bitmap window.
s_last : a system variable containing the alias of the most recently opened bitmap.
s_path : a system variable used by the custom index containing this book's path.
editScript "
s_fileName",
"bitmapIndex"
buttonDown
buttonDown
editScript
set s_fileName
bitmapIndex
editScript "
s_ext",
"bitmapIndex"
buttonDown
buttonDown
editScript
set s_ext
bitmapIndex
editScript "
ox",
"bitmapIndex"
buttonDown
buttonDown
editScript
set s_x to my x
bitmapIndex
editScript "
oy",
"bitmapIndex"
buttonDown
buttonDown
editScript
set s_y to my y
bitmapIndex
editScript "
s_last
""ix"" & num",
"bitmapIndex"
buttonDown
buttonDown
editScript
set s_last to "ix" & num
bitmapIndex
editScript "
tbkBitmapchk(""
"" && s_path",
"toolbookIndex"
buttonDown
buttonDown
editScript
get tbkBitmapchk("open" && s_path
toolbookIndex
Bitmap Graphics
A Bitmap Indexess(ToolBook extension)
$ A custom bitmap index widget.
Scroll this field to see how a bitmap index works......a bitmap to close it...
toolBookIndex
frames
extension
bitmapIndex
extension
frames
A generic bitmap index widget. &
Assign your own series of thumbnail bitmaps to this field by right clicking it..s field.
txclassname
3DFrame Recessed
MIDI Sequencer: MIDI To Wave
cd Audio: Track Selector
Wave Audio: Wave File Buttons
tbkMCI("close waveFile","")
enterPage
leavePage
enterPage
leavePage
close waveFile
tbkMCI
The Play and Wait, and Play and Notify buttons open, play and close a wave file determined by their fileName user property. To play a wave file in your own application, copy either of these buttons to your book and right click
them in Reader mode. You'll be prompted to enter the name of a wave file. That name will be stored in the button's fileName user property and played when you click it.
The Play and Wait button's buttonDown handler opens, plays and closes its wave file using the wait parameter. This delays subsequent OpenScript statements from executing until the wave file finishes playing and closes.
The Play and Notify button specifies itself as the notification object . Its buttonDown handler plays a wave file, but its tbkmmNotify handler closes the wave file.
The start up time for a wave file can be greatly reduced by opening it in an enterPage handler instead of in the button script where it's actually played.d of in the button script where it's actually played.
editScript "
B"Play
Wait"
buttonDown
buttonDown
editScript
to handle rightButtonUp
Play and Wait
editScript "wait",
B"Play
Wait"
buttonDown
buttonDown
editScript
Play and Wait
editScript "
B"Play And Notify"
buttonDown
buttonDown
editScript
Play And Notify
waveFile : an alias for wave files used in these buttons.Wait, and Play And Notify buttons.. wave files.
editScript "alias waveFile",
B"Play And Wait"
buttonDown
buttonDown
editScript
alias waveFile
Play And Wait
Wave Audio
Generic Wave Buttonss
Play and Wait
ofileName
tbkMCI("status wavefile mode","")
c"play"
,close waveFile","")
tbkMCIchk("
" &&
{ && "alias
5,1,1)
E wait","",1)
--prompt
OpenDlg(".", "*.
", "Choose a
B.", "
Wave
buttonDown
rightButtonUp
buttonDown
fileName
prightButtonUp
status wavefile mode
tbkMCI
close waveFile
tbkMCI
fileName
alias waveFile
tbkMCIchk
play waveFile wait
tbkMCIchk
close waveFile
tbkMCIchk
rightButtonUp
*.wav
Choose a wave file for this button.
Choose Wave File
OpenDlg
fileName
fileName
Play and Wait
Play and Notify
ofileName
tbkMCI("close waveFile","")
tbkMCIchk("
" &&
M && "alias
/,1,1)
)play
tbkmmNotify
lstatus
g mode","")
c"stop"
OpenDlg(".", "*.
", "Choose a
B.", "
Wave
uttonDown
tbkmmNotify
buttonDown
rightButtonUp
buttonDown
fileName
prightButtonUp
close waveFile
tbkMCI
fileName
alias waveFile
tbkMCIchk
play waveFile
tbkMCIchk
tbkmmNotify
status waveFile mode
tbkMCI
pause
close waveFile
tbkMCI
rightButtonUp
*.wav
Choose a wave file for this button.
Choose Wave File
OpenDlg
fileName
fileName
Play and Notify
Using The Cover Routines
Using tbkMCIchk() and tbkBitmapChk().................
The Multimedia Resource Kit sysbook, tbkmm.sbk, contains two OpenScript functions that serve as cover routines for calls to tbkMCI( ) and tbkBitmap( ). They are
tbkMCIchk( ) and
tbkBitmapChk( ) . The widgets in this book use these cover routines extensively to do the following things.
* Automatically initialize sysErrorNumber to zero before function calls.
call.
editScript "
tbkMCIchk", tbkmmsbk()
buttonUp
buttonUp
editScript
to get tbkMCIchk
tbkmmsbk
editScript "
tbkBitmapchk", tbkmmsbk()
buttonUp
buttonUp
editScript
to get tbkBitmapchk
tbkmmsbk
* Optionally display the error string from the tbkmmErrorString( ) function
in a request dialog box when sysErrorNumber is not equal to zero after function calls.
* Optionally break to system and set the cursor to its default when sysErrorNumber is not equal to zero after function calls.
These functions regularize error checking and reduce
the need to write your own error checking code. They take the same parameters as tbkMCI( ) and tbkBitmap( ), but also two additional ones..es.ional ones...
The third parameter causes a request dialog box to display error messages. The fourth parameter sets sysCursor to 1 and breaks to system if an error occurs. These parameters may take any non-null value.
A normal call to MCI that plays the CD audio device looks like this:
The same call using the tbkMCIchk( ) cover routine might look like this:
er.r.er.er.....atter...
` 8 ]
get tbkMCI("play cdaudio","")
get tbkMCIchk("play cdaudio","",1,1)
"When a widget makes several consecutive calls
TBKBMP.DLL, the
uses
4 parameters
Xcover routine.
Subsequent
3 only 3
l produces
error, such
ndevice
xbeing
handler will display
9 message
buttonUp
buttonUp
When a widget makes several consecutive calls to MCI or to TBKBMP.DLL, the first call uses all 4 parameters with the check cover routine. Subsequent calls use only 3 parameters. So if the first call produces an error, such as the device not being open, the handler will display an error message and break to system.
A Rule Of Thumb...
Window Styles
An Explanation of Window Styles
You can display bitmaps and animation files in overlapped, popup, or child windows.
The position of overlapped and popup windows is relative to the screen, and the position of a child window is relative to the ToolBook page. Position and size are defined in pixels. You can set the postion of a bitmap's window, and the bounds of an animation window.
ds of an animation window
ox or by pressing Alt+F4 when the window has the focus.
Overlapped windows are drawn on top of the ToolBook window. They're not clipped to the bounds of the ToolBook window that owns them, and they have their own window controls.
Popup windows are drawn on top of the ToolBook window like overlapped windows, but they don't have window controls.
Child windows are drawn inside the ToolBook window, but on top of the page, and are clipped to the bounds of the ToolBook window.
The position of overlapped and popup windows is relative to the screen; the position of a child window is relative to the ToolBook page. Position and size are defined in pixels.
You can use OpenScript's
translateWindowMessage control structure to receive Window messages in the bitmap window. This is useful for such things as dismissing a bitmap window by clicking the window.n the bitmap window. This is useful for such things as dismissing a bitmap window by clicking the window.
You can use OpenScript's translateWindowMessage control structure to receive Window messages in a bitmap or animation window. This is useful for such things as dismissing a window by clicking it. See the Simple Bitmap Buttons page for an example of how to do this.
Overlapped windows require that you trap a Close message for animation windows and a Destroy message for bitmap windows. This allows you to close the media file when the overlapped window is closed by pressing Alt+F4.4.
"Bitmap Graphics:
Buttons"
buttonDown
buttonDown
Bitmap Graphics: Bitmap Buttons
Wave Audio: Status
es & Status
"capabilityResults"
"statusResults"
leavePage
leavePage
capabilityResults
statusResults
The Update buttons' scripts walk through the textlines of the Capability and Status fields and query the driver for the term on each textline. The query results are stored in a variable and then displayed in the Capability and Status results fields.
The Capability button queries the wave audio device; the Status button queries a wave audio file...........ility and Status Results fields.
The Capability button queries the wave audio device; the Status button queries a wave audio file.m, and finally uses the text again as the name of the field in which to put the item value...
editScript "
B"update capability"
buttonDown
buttonDown
editScript
step i from 1 to textLineCount(it)
update capability
editscript "tbkMCI(""capability",
B"Update Capability"
buttonDown
buttonDown
editscript
tbkMCI("capability
Update Capability
editscript "tbkMCIchk(""status",
B"Update Status"
buttonDown
buttonDown
editscript
tbkMCIchk("status
Update Status
waveFile : an alias for the wave file when displaying status items.
editscript "alias waveFile",
B"Update Status"
buttonDown
buttonDown
editscript
alias waveFile
Update Status
Wave Audio
Capability and Statusus
txclassname
3DFrame Recessed
Status
Status
status
Ready
Channels
Length
Position
Format tag
Alignment
BitsPerSample
SamplesPerSec
Number of tracks
Current trackt track
Current track
statusResults
capability
Can record
Device type
Has audio
Has video
Compound device
Uses files
Outputs
Inputs
Capabilityes
Capabilityes
capabilityResults
Update capability
Zcapability
"capabilityResults"
tbkMCI("
waveaudio shareable","")
--loop through the
R" &&
,"") & \
CRLF
close
","")
buttonDown
buttonDown
capabilityResults
open waveaudio shareable
tbkMCI
capability
capability waveaudio
tbkMCI
close waveaudio
tbkMCI
capabilityResults
capability
Update Capability
Update Status
Zstatus
"statusResults"
OpenDlg(".", "*.wav", "Choose a wave file.", "
Wave File")
tbkMCIchk("
" &&
&& "alias waveFile","",1,1)
2 &&
,"",1) & \
CRLF
{("close
buttonDown
buttonDown
statusResults
*.wav
Choose a wave file.
Choose Wave File
OpenDlg
statusResults
alias waveFile
tbkMCIchk
status
status waveFile
tbkMCIchk
close waveFile
tbkMCI
statusResults
status
fileName
D:\MM\WIDGET\bells.wav
Update Status
Wave Audio: Status
Widget Dependencies
About This Widget Book
noAutoName
About this Widget Book(Please read this))))
Widget: A small contrivance.
This book contains a collection of widgets and scripts that you can use in your own applications. These widgets use the multimedia extensions to ToolBook and the underlying Microsoft multimedia extensions to Windows.
When the devices and drivers are available, the widgets in this book are fully functional. Some require data files.
e pasted a widget, you can..............................................
You can use the widgets in several ways:
* Copy the generic buttons from the Simple Button pages, then paste them into your applications. After right-clicking them to assign them a wave, MIDI, bitmap or animation file, they'll play that file when you click them.
* Copy widgets and control panels, then paste them into your applications. You can modify them to suit your particular requirements.
* Use widget scripts as examples for your own scripts.
dia extensions to ToolBook. Most widgets are directly MCI-compatible.
-compatible.
ompatible.
irectly MCI-compatible.
* You can use the widget book to exercise the system.
* Use the widget book to exercise the system.
* Use the event editors to create buttons that play clips of wave, MIDI and animation files, or clips from CDs and laserdiscs. You can use these scripts for hotwords too.
On many pages, you can click hotwords to see the relevant scripts. Those scripts will appear in the script editor window with the relevant section highlighted. You can copy these scripts to the clipboard without going to author level.u can copy these scripts to the clipboard without going to author level.clipboard without going to author level.
About this Widget Book
raphics: Dynamic Bitmap
Window Styles
Bitmap Graphics: Bitmap Buttons
--close bitmap that might be
tbkBitmap("
)dibFile")
leavePage
leavePage
close dibFile
tbkBitmap
close
The Multimedia Resource Kit's bitmap DLL, TBKBMP.DLL lets you display bitmaps in their own windows. See the
Window Styles reference page to learn about different types of windows.
Click the Hard Coded Example buttons to see examples of 256 color device independent bitmaps in 3 window styles. To display a bitmap in your own application, copy a Generic button to your book and right click it in Reader mode. You'll be prompted for a file name. That file name will be stored as a user property of the button. You can also assign the position of the bitmap's window.
To close the bitmap after it's displayed, click it, or in the case of the overlapped window, close its window by pressing Alt+F4. These buttons use the
translateWindowMessage control structure to trap mouse clicks in the bitmap window, which sends a ToolBook message to close the bitmap file. The Ovelapped button also traps a windows destroy message..smissing a bitmap window by clicking the window..e bitmap window. This is useful for such things as dismissing a bitmap window by clicking the window..
eStyles"
buttonDown
buttonDown
window Styles
editScript "
B"generic popup bitmap"
buttonDown
buttonDown
editScript
to handle rightButtonUp
generic popup bitmap
editScript "translatewindowmessage
s_bmpHandle",
B"generic popup bitmap"
buttonDown
buttonDown
editScript
translatewindowmessage for s_bmpHandle
generic popup bitmap
editScript "
bmpWindowClose
B"generic overlapped bitmap"
buttonDown
buttonDown
editScript
before 2 send bmpWindowClose to self
generic overlapped bitmap
dibFile : alias for every button's bitmap file.
s_Path : a system variable used in the hard coded example buttons that contains the path to this book.
s_bmpHandle : a system variable used in the Overlapped button's script containing the handle to the bitmap's window. Overlapped button's bitmap..
editScript "alias dibFile",
"popup"
buttonDown
buttonDown
editScript
alias dibFile
popup
editScript "
s_path",
buttonDown
buttonDown
editScript
set s_path
editScript "
s_bmpHandle",
B"Generic Overlapped Bitmap"
buttonDown
buttonDown
editScript
set s_bmpHandle
Generic Overlapped Bitmap
Bitmap Graphics (ToolBook extension)
Generic Bitmap Buttonsstension)
close
Click the bitmap's window to close it.
popup
:PHYSSIZE
Popup
FALSE
--close other bitmaps that might be
tbkBitmap("
0dibFile")
fa child
tbkBitmapchk("
dib2.
; alias dibfile style
" && sysClientHandle,1,1)
0ate
translating
emessages
bmpHandle
status
translatewindowmessage
bmpButtonup
BMPbuttonUp
uttonDown
buttonUp
buttonDown
BMPbuttonUp
buttonDown
buttonUp
close dibFile
tbkBitmap
open dib2.dib alias dibfile style child parent
tbkBitmapchk
window dibfile state show
tbkBitmapchk
status dibfile window
tbkBitmap
bmpButtonup
close
bmpHandle
BMPbuttonUp
close dibFile
tbkBitmap
close
:PHYSSIZE
Child
v#:PHYSSIZE
Overlapped
&$V$b
j$txclassname
3DFrame Recessed
Hard Coded
Examples
Generic Popup Bitmap
Popup
Generic Child Bitmap
Child
Generic Overlapped Bitmap
Overlapped
r&fileName
J:\ARIZONA\drt.bmp
4s_bmpHandle
ofileName
rightButtonup
B's bitmap
fa popup
tbkBitmapchk("
" &&
d && "alias dibFile style
B", 1, 1)
" &&
ox & "," &
oy,1)
Rate
translating
emessages
("status
translatewindowmessage
bmpWindowClose
bmpButtonup
--dismiss
they click
BMPbuttonUp
untranslateAllWindowMessages
("close
a timer
edirectly (Alt-f4)
lets
efinish closing
4sending a
--which
turn sends a bmpButtonDown
windows
tbkTimerStart("single",500,100,
tbkMMTimer
bmpButtonUp
OpenDlg(".", "*.*", "Choose a
(.dib
extensions)", "
ox & "," &
"0,0"
("Would you like
specify
e? If so, please enter 2 numeric coordinates."
) <> 2
"Invalid
x"0"
xisNumber(
"Coordinate
z" && i && "
tonUp
buttonUp
bmpWindowClose
tbkMMTimer
BMPbuttonUp
rightButtonUp
buttonUp
fileName
prightButtonup
fileName
alias dibFile style popup
tbkBitmapchk
window dibFile position
tbkBitmapchk
window dibFile state show
tbkBitmapchk
status dibFile window
tbkBitmap
bmpWindowClose
bmpButtonup
s_bmpHandle
BMPbuttonUp
close dibFile
tbkBitmap
s_bmpHandle
bmpWindowClose
single
tbkTimerStart
tbkMMTimer
bmpButtonUp
rightButtonUp
Choose a bitmap file for this button. (.dib or .bmp extensions)
Choose Bitmap File
OpenDlg
fileName
fileName
Would you like to specify the position of the window? If so, please enter 2 numeric coordinates.
cancel
Invalid number of coordinates.
isNumber
Coordinate number
is not a number.
CD Audio: Small Simple Controls
Animation: Control Panel
Generic: Dog Sliders
MIDI sequencer: Simple Controls
B"Unload"
--update the
tbkMCI("status MIDIFile
","")
"Name"
"Length"
"Position"
"Tempo"
"Max
sliderPosition
"Slider"
"tempoSlider"
"length"
file
d","")
temposlider
leavepage
leavepage
buttonDown
Unload
status MIDIFile position
tbkMCI
Length
Position
Tempo
Max Tempo
Slider
sliderPosition
tempoSlider
sliderPosition
Position
Position
Slider
sliderPosition
length
status MIDIfile tempo
tbkMCI
tempo
tempo
sliderPosition
tempo
Max Tempo
temposlider
*n+j,40
fName
A:\GYPSCAMP.MID
These widgets allow you to open a MIDI file and play all or parts of it. They work only if a MIDI file has been opened . The Load button opens the device and a MIDI file, and the Unload button closes them. An idle handler updates the position and tempo fields by querying the status of the MIDI device. To start, click the Load button to open the MIDI driver and load a MIDI file.
The position slider's main script is in the system book TBKMM.SBK. The thumb button's script seeks to a new position in the MIDI file. If you change the script of the thumb button, be sure to forward the button event messages.
The local script of the Tempo slider allows it to control the tempo .
The Position and Tempo fields, and the sliders require this page's idle handler. You must copy the handler into the page or background where you paste these elements if you want them to update correctly.
editScript "
tbkmcichk(""
B"load"
buttonDown
buttonDown
editScript
get tbkmcichk("open
editScript "
tbkmci(""close",
B"unload"
buttonDown
buttonDown
editScript
get tbkmci("close
unload
editscript "
buttonDown
buttonDown
editscript
to handle idle
editScript "
|", tbkmmsbk()
buttonDown
buttonDown
editScript
to handle buttonStillDown
tbkmmsbk
editScript "
tbkMCIchk(""seek",
B"thumb"
buttonDown
buttonDown
editScript
get tbkMCIchk("seek
thumb
editScript "
tbkMCI(""
midiFile tempo",
B"tempoThumb"
buttonDown
buttonDown
editScript
get tbkMCI("set midiFile tempo
tempoThumb
MIDIfile : an alias used for the current MIDI file..Play and Notify buttons' MIDI files.
s_tempoMax : a system variable used by the tempo slider containing the maximum tempo value for the current MIDI file...
editScript "alias midiFile",
B"Load"
buttonUp
buttonUp
editScript
alias midiFile
MIDI Sequencer
Simple Controlscontrols::::
Tempo t
tempoSlider
0.4333333333333333
txClassName
Slider
tempoThumb
--update the tempo based on
slider thumb
"Max Tempo"
tbkMCI("
midiFile
* sliderPosition
),"")
yieldApp()
buttonStillDown
buttonStillDown
Max Tempo
set midiFile tempo
sliderPosition
tbkMCI
yieldApp
height
hilight
false
width
glide
button id 278 of page id 8
txClassName
vSliderThumb
Restart
rack
Rewind
Pause t
Play rt
FF n rt
Unload
Play From....
Play To...
Play FromToo.
Length
167563/
Position
08086
Position:
Length: onds: e:
txclassname
3DFrame Recessed
D:\MMDATA\allegro.mid
MIDI File: s: e:
Tempo
Tempo: Position:
4s_tempoMax
ZfileName
a MIDI
OpenDlg(".", "*.
g", "Please choose a
D.", "Choose
@File")
--close old
B"Unload"
tbkMCIchk("
" &&
&& "alias MIDIFile","",1,1)
ms","",1)
"length"
Sstatus
,"",1)
%midiFile division type","",1,1)
c"25"
c"24"
c"30"
c"30 drop"
c"PPQN"
"Max Tempo"
sliderPosition
"tempoSlider"
midifile
","",1)/
buttonDown
buttonDown
*.mid
Please choose a MIDI file.
Choose MIDI File
OpenDlg
buttonDown
Unload
alias MIDIFile
tbkMCIchk
set MIDIFile time format ms
tbkMCIchk
length
status MIDIFile length
tbkMCIchk
status midiFile division type
tbkMCIchk
30 drop
Max Tempo
tempoSlider
sliderPosition
status midifile tempo
tbkMCIchk
fileName
s_tempoMax
Restart
tbkMCIchk("seek MIDIFile
0","",1)
buttonDown
buttonDown
seek MIDIFile to 0
tbkMCIchk
Rewind
4MIDIctr
FALSE
tbkMCI("stop MIDIfile","")
tbkMCIchk("status MIDIFile
","",1)
s <>
< 100
" &&
,"",1)
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
stop MIDIfile
tbkMCI
status MIDIFile position
tbkMCIchk
MIDIctr
buttonStillDown
position
MIDIctr
buttonUp
seek MIDIFile to
tbkMCIchk
MIDIctr
Pause
tbkMCIchk("
MIDIFile","",1)
buttonDown
buttonDown
pause MIDIFile
tbkMCIchk
tbkMCIchk("play MIDIFile","",1)
yieldApp()
buttonDown
buttonDown
play MIDIFile
tbkMCIchk
yieldApp
4MIDIctr, MIDImax
FALSE
tbkMCI("stop MIDIfile","")
tbkMCIchk("status MIDIFile
","",1)
" && "length","",1)
- 100
" &&
"",1)
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
stop MIDIfile
tbkMCI
status MIDIFile position
tbkMCIchk
status MIDIFile
length
tbkMCIchk
MIDIctr
MIDImax
buttonStillDown
position
MIDIctr
MIDImax
buttonUp
seek MIDIFile to
tbkMCIchk
MIDIctr
MIDImax
Unload
tbkMCI("close MIDIFile","")
buttonDown
buttonDown
close MIDIFile
tbkMCI
Play From
("Play
tbkMCIchk("play MIDIFile
" &&
,"",1)
yieldApp()
buttonDown
buttonDown
Play from
play MIDIFile from
tbkMCIchk
yieldApp
Play To
"Length"
("Play
tbkMCIchk("play MIDIFile
" &&
,"",1)
yieldApp()
buttonDown
buttonDown
Length
Play to
play MIDIFile from 0 to
tbkMCIchk
yieldApp
Play From To
"Length"
("Play
f"0," &
tbkMCIchk("play MIDIFile
" &&
&&
,"",1)
yieldApp()
buttonDown
buttonDown
Length
Play from, to
play MIDIFile from
tbkMCIchk
yieldApp
J8! ;
Slider
7txClassName
Slider
thumb
--thumb
seek midi file
slider's
tbkMCIchk("status MIDIfile length","",1,1)
sliderPosition
" &&
,"",1)
buttonUp
buttonUp
status MIDIfile length
tbkMCIchk
sliderPosition
seek MIDIfile to
tbkMCIchk
;txClassName
HSliderThumb
;defFillColor
0,100,0
;glide
line id 105 of page id 9
<width
0<defStrokeColor
0,0,0
Max Tempo
Max Tempo: tion:
Stop rt
tbkMCIchk("Stop midiFile","",1,1)
"seek
0","",1)
buttonDown
buttonDown
Stop midiFile
tbkMCIchk
seek midiFile to 0
tbkMCIchk
cd Audio: Large Simple Controls
Wave Audio: Simple Controls
MIDI sequencer: Event Editor
Videodisc: Event Editor
b"`#
%(+:0B1B2
noCopy
The controls on this page let you select a clip from a videodisc and create a button that plays that clip.
After turning the videodisc driver on, select a clip from the disc by playing the disc, and then clicking the buttons next to the Start and End Position fields. This will set the Start and End Position Field text to current position of the videodisc. You can also edit the text in the Start and End Position fields. The End Position field text should be greater than the Start Position field text. Click the Play Clip button to test your clip. When you're done, click the Make A Videodisc Clip Button button. A button that plays your clip will be copied to the clipboard.
The position slider and the Track, Frame and Total Frames fields are updated by an idle
handler in the script of this page. You could also use timer services provided by the tbkTimer functions to update those at a rate over which you will have much more control.]
s_device : a system variable used in the idle handler to bypass status queries.
s_idle : a system variable use to count idle messages.
s_MediaType : a system variable inidicating that the videodisc is CAV or CLV format.
s_pos : a system variable containing the current position of the disc in milliseconds while scanning forward.
s_vLength : a system variable containing the length of the disc in milliseconds while scanning forward.ward.
s_vLength : a system variable containing the length of the disc in milliseconds while scanning forward.
editScript "
s_device",
"driver switch"
buttonDown
buttonDown
editScript
set s_device
driver switch
editScript "
us_idle",
buttonDown
buttonDown
editScript
decrement s_idle
editScript "
s_mediaType
tbkMCIchk(""status videodisc
% type",
B"Reverse Scan"
buttonDown
buttonDown
editScript
set s_mediaType to tbkMCIchk("status videodisc media type
Reverse Scan
editScript "
s_pos
tbkMCI(""status videodisc
B"Forward Scan"
buttonDown
buttonDown
editScript
set s_pos to tbkMCI("status videodisc position
Forward Scan
editScript "
s_vLength
tbkMCI(""status videodisc length",
B"Forward Scan"
buttonDown
buttonDown
editScript
set s_vLength to tbkMCI("status videodisc length
Forward Scan
Videodisc
Event Editor
Start Position
Start Position: n
End Position
End Position: tion
Play Clip
Restart Clipck
"Start Position"
"Please
a clip
tbkMCIchk("seek videodisc
" &&
\,"",1)
buttonDown
buttonDown
Start Position
Please select a clip first.
seek videodisc to
Start Position
tbkMCIchk
"Start Position"
"Please
a clip
tbkMCIchk("play videodisc
" &&
]&& \
" &&
"End
p,"",1)
yieldApp()
buttonDown
buttonDown
Start Position
Please select a clip first.
play videodisc from
Start Position
End Position
tbkMCIchk
yieldApp
Start Clip
tbkMCIchk("status videodisc
","",1,1)
"Start Position"
buttonDown
buttonDown
status videodisc position
tbkMCIchk
Start Position
Start Clip
End Clip
tbkMCIchk("status videodisc
","",1,1)
"End Position"
buttonDown
buttonDown
status videodisc position
tbkMCIchk
End Position
End Clip
Make A Videodisc Clip Button
Driver On/Off
Driver switch
4s_device
Zswitch, x
-(y1,
"off"
tbkMCI("stop videodisc wait","")
--use
asure
worked
<close
7","")
0,50.1875,0
tbkMCIchk("
shareable","",1,1)
buttonUp
buttonUp
false
stop videodisc wait
tbkMCI
close videodisc
tbkMCI
open videodisc shareable
tbkMCIchk
videodisc
120,50,100
switch
s_device
txclassname
vSwitchHandle
Scan rt
Play
Step rt
Pause t
Step rt
Play rt
Scan rt
checkDevice TRUE
tbkMCIchk("play videodisc reverse","",1,1)
buttonUp
buttonUp
checkDevice
play videodisc reverse
tbkMCIchk
checkDevice TRUE
tbkMCIchk("
videodisc reverse","",1,1)
buttonDown
buttonStillDown
buttonDown
checkDevice
buttonStillDown
step videodisc reverse
tbkMCIchk
checkDevice TRUE
tbkMCIchk("
videodisc","",1,1)
buttonUp
buttonUp
checkDevice
pause videodisc
tbkMCIchk
&2L/:
checkDevice TRUE
tbkMCIchk("
videodisc","",1,1)
buttonDown
buttonStillDown
buttonDown
checkDevice
buttonStillDown
step videodisc
tbkMCIchk
checkDevice TRUE
tbkMCI("play videodisc","")
buttonUp
buttonUp
checkDevice
play videodisc
tbkMCI
Forward Scan
4s_MediaType
checkDevice TRUE
s_mediaType
tbkMCIchk("status videodisc
$ type","",1,1)
"CAV"
:("play
1scan","")
4s_pos,s_vLength
ms","")
","")
length","")
H1000
HMSFromMillisec(
","")
" &&
"",1)
","")
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
checkDevice
s_mediaType
status videodisc media type
tbkMCIchk
play videodisc scan
tbkMCI
set videodisc time format ms
tbkMCI
status videodisc position
tbkMCI
status videodisc length
tbkMCI
s_pos
s_vLength
s_MediaType
buttonStillDown
position
HMSFromMillisec
s_pos
s_vLength
s_MediaType
buttonUp
play videodisc
tbkMCI
play videodisc from
tbkMCIchk
set videodisc time format HMS
tbkMCI
s_pos
s_vLength
s_MediaType
Reverse Scan
4s_MediaType
checkDevice TRUE
s_mediaType
tbkMCIchk("status videodisc
$ type","",1,1)
"CAV"
:("play
1reverse scan","")
4s_pos
ms","")
","")
` > 0
H1000
HMSFromMillisec(
","")
" &&
,"",1)
","")
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
checkDevice
s_mediaType
status videodisc media type
tbkMCIchk
play videodisc reverse scan
tbkMCI
set videodisc time format ms
tbkMCI
status videodisc position
tbkMCI
s_pos
s_MediaType
buttonStillDown
position
HMSFromMillisec
s_pos
s_MediaType
buttonUp
play videodisc reverse
tbkMCI
play videodisc from
tbkMCIchk
set videodisc time format HMS
tbkMCI
s_pos
s_MediaType
checkDevice TRUE
tbkMCIchk("seek videodisc
0","",1,1)
buttonUp
buttonUp
checkDevice
seek videodisc to 0
tbkMCIchk
checkDevice TRUE
tbkMCIchk("stop videodisc","",1,1)
buttonUp
buttonUp
checkDevice
stop videodisc
tbkMCIchk
Restart
Stop rt
checkDevice TRUE
tbkMCI("status videodisc mode","")
tbkMCIchk("
'door closed","",1)
","",1)
buttonUp
buttonUp
checkDevice
status videodisc mode
tbkMCI
set videodisc door closed
tbkMCIchk
set videodisc door open
tbkMCIchk
Eject t
Position:
Track: : rack:
n6txclassname
3DFrame Recessed
Length:
Track
Position
Length
MIDI sequencer: Controls
Bitmap Graphics: A Bitmap Index
CD Audio: Event Editor
More Buttons
Animation: Event Editor
B"Unload"
tbkMCI("status aniFile
","")
"Name"
"Length"
"Position"
"Start
"End
leavepage
leavepage
buttonDown
Unload
status aniFile position
tbkMCI
Length
Position
Start Position
End Position
Position
Position
noCopy
The controls on this page let you select a clip from an animation file and create a button that plays that clip.
After loading an animation file, select a clip from it by clicking the Start and End Clip buttons while the animation file is playing. This will set the Start and End Position Field text to the animation file's current position. You can also edit the text of the Start and End Position fields. The End Position field text should be greater than the Start Position field text. Click the Play Clip button to test your clip. When you're done, click the Make An Animation Clip Button button. A button that plays the clip will be copied to the clipboard.
The animation file is opened in the Load button script. This sets the file length system variable. The system variable is cleared, and the window, if open, is closed by the Unload button script when you click it , or if you leave this page.e.ou leave this page.
editScript "
tbkmcichk(""
B"load"
buttonUp
buttonUp
editScript
get tbkmcichk("open
editScript "
tbkmci(""close",
B"unload"
buttonUp
buttonUp
editScript
get tbkmci("close
unload
aniFile : an alias for the current animation file.
s_aniHandle : a system variable containg the handle to the animation window.
editScript "alias aniFile",
B"load"
buttonUp
buttonUp
editScript
alias aniFile
Animation
Event Editor
Start Position
Start Position: n
End Position
End Position: tion
Play Clip
Restart Clipck
Make An Animation Clip Button
Make An Animation Clip Button
Restart
Track
Rewind
Pause t
Play rt
FF n rt
Unload
Length
Position
Position: sition:
Frames: onds: e:
txclassname
3DFrame Recessed
Animation File:
ZfileName
a animation
OpenDlg(".", "*.fl?", "Please choose
J.", "Choose Animation File")
--close old
B"Unload"
tbkMCIchk("
" &&
&& "alias aniFile
" &&
8,"",1,1)
frames","",1)
"length"
ostatus
,"",1)
seek
1","",1)
state
","",1)
buttonDown
buttonDown
*.fl?
Please choose an animation file.
Choose Animation File
OpenDlg
buttonDown
Unload
alias aniFile parent
tbkMCIchk
set aniFile time format frames
tbkMCIchk
length
status aniFile length
tbkMCIchk
seek aniFile to 1
tbkMCIchk
window aniFile state show
tbkMCIchk
fileName
fileName
c:\tbkmm2\mmrk.mmm
Unload
4s_aniHandle
--close animation file
tbkMCI("status aniFile ready","")
P <>
untranslateAllWindowMessages
X","")
buttondown
buttondown
status aniFile ready
tbkMCI
close aniFile
tbkMCI
s_aniHandle
Restart
tbkMCI("seek aniFile
1","")
buttondown
buttondown
seek aniFile to 1
tbkMCI
Rewind
tbkMCIchk("status aniFile
","",1)
$("seek
" &&
b(0,
- 10),"")
buttonStillDown
buttonStillDown
status aniFile position
tbkMCIchk
seek aniFile to
tbkMCI
Step Reverse
tbkMCIchk("
aniFile","",1,1)
reverse
H1","",1)
buttonDown
buttonDown
pause aniFile
tbkMCIchk
step aniFile reverse by 1
tbkMCIchk
Pause
tbkMCIchk("
aniFile","")
buttondown
buttondown
pause aniFile
tbkMCIchk
Step Forward
tbkMCIchk("
aniFile","",1,1)
H1","",1)
buttonDown
buttonDown
pause aniFile
tbkMCIchk
step aniFile by 1
tbkMCIchk
tbkMCIchk("play aniFile","",1)
yieldApp()
buttonDown
buttonDown
play aniFile
tbkMCIchk
yieldApp
tbkMCIchk("status aniFile
","",1)
$("seek
" &&
"length",
+ 10),"")
buttonStillDown
buttonStillDown
status aniFile position
tbkMCIchk
seek aniFile to
length
tbkMCI
Restart Clip
"Start Position"
"Please
a clip
tbkMCIchk("seek aniFile
" &&
Z,"",1)
buttonDown
buttonDown
Start Position
Please select a clip first.
seek aniFile to
Start Position
tbkMCIchk
Play Clip
"Start Position"
"Please
a clip
tbkMCIchk("play aniFile
" &&
[&& \
" &&
"End
n,"",1)
yieldApp()
buttonDown
buttonDown
Start Position
Please select a clip first.
play aniFile from
Start Position
End Position
tbkMCIchk
yieldApp
Start Clip
tbkMCIchk("status aniFile
","",1,1)
"Start Position"
buttonDown
buttonDown
status aniFile position
tbkMCIchk
Start Position
Start Clip
End Clip
tbkMCIchk("status aniFile
","",1,1)
"End Position"
buttonDown
buttonDown
status aniFile position
tbkMCIchk
End Position
End Clip
Videodisc: Control Panels
Timers: Status
Timers: Status
MIDI Sequencer: Buttons
Button
tbkMCI("close MIDIfile","")
leavePage
leavePage
close MIDIfile
tbkMCI
The Play and Wait, and Play and Notify buttons open, play and close a MIDI file determined by their fileName user property. To play a wave file in your own application, copy either of these buttons to your book and right click them in Reader mode. You'll be prompted to enter the name of a MIDI file. That name will be stored in the button's fileName user property and played when you click it.
The Play and Wait button's buttonDown handler opens, plays and closes its MIDI file with the wait parameter. This delays subsequent openScript statements from executing until the MIDI file finishes playing and closes.
The Play and Notify button specifies itself as the notification object. Its buttonDown handler opens and plays its MIDI file without using the wait parameter. Its tbkmmNotify handler
closes the MIDI file....
editScript "
B"Play
Wait"
buttonDown
buttonDown
editScript
to handle rightButtonUp
Play and Wait
editScript "
tbkMCIchk(""play",
B"Play And Wait"
buttonDown
buttonDown
editScript
get tbkMCIchk("play
Play And Wait
editScript "
tbkMCIchk(""close",
B"Play And Wait"
buttonDown
buttonDown
editScript
get tbkMCIchk("close
Play And Wait
editScript "wait",
B"Play And Wait"
buttonDown
buttonDown
editScript
Play And Wait
editScript "
tbkmmnotify",
B"Play And Notify"
buttonDown
buttonDown
editScript
to handle tbkmmnotify
Play And Notify
MIDIfile : an alias used for the Play and Wait, and Play and Notify buttons' MIDI files..
editScript "alias midiFile",
B"Play And Wait"
buttonUp
buttonUp
editScript
alias midiFile
Play And Wait
MIDI Sequencer
Generic MIDI Buttonssonss
Play and Wait
ofileName
tbkMCI("status midifile mode","")
c"play"
,close midiFile","")
tbkMCIchk("
" &&
{ && "alias
5,1,1)
E wait","",1)
--prompt
OpenDlg(".", "*.
g", "Choose a MIDI
B.", "
buttonDown
rightButtonUp
buttonDown
fileName
prightButtonUp
status midifile mode
tbkMCI
close midiFile
tbkMCI
fileName
alias midiFile
tbkMCIchk
play midiFile wait
tbkMCIchk
close midiFile
tbkMCIchk
rightButtonUp
*.mid
Choose a MIDI file for this button.
Choose MIDI File
OpenDlg
fileName
fileName
Play and Wait
Play and Notify
ofileName
tbkMCI("close midiFile","")
tbkMCIchk("
" &&
M && "alias
/,1,1)
)play
tbkmmNotify
lstatus
g mode","")
c"stop"
OpenDlg(".", "*.
g", "Choose a MIDI
B.", "
tonUp
tbkmmNotify
buttonUp
rightButtonUp
buttonUp
fileName
prightButtonUp
close midiFile
tbkMCI
fileName
alias midiFile
tbkMCIchk
play midiFile
tbkMCIchk
tbkmmNotify
status midiFile mode
tbkMCI
pause
close midiFile
tbkMCI
rightButtonUp
*.mid
Choose a MIDI file for this button.
Choose MIDI File
OpenDlg
fileName
fileName
Play and Notify
ZstartPos, endPos
"Start Position"
"Please
a clip
"End
setDefaultButtonStyle
2000,750
"CD Audio Clip"
}" & CRLF & TAB & \
ZoldTimeFormat" &
tbkMCI(""
cdAudio shareable"",
)" &
" && \
9status
)" &
msf"",
)" &
zplay
" &&
&& \
" &&
&& "wait"",
)" &
"" &&
)" &
close
)" &
Bthat plays a CD
" &&
&& \
" &&
&& "has been copied
the clipboard."
buttonDown
buttonDown
Start Position
Please select a clip first.
Start Position
End Position
setDefaultButtonStyle
CD Audio Clip
to handle buttonUp
local oldTimeFormat
get tbkMCI("open cdAudio shareable","")
set oldTimeFormat to
tbkMCI("status cdAudio time format","")
get tbkMCI("set cdAudio time format msf","")
get tbkMCI("play cdAudio from
wait","")
get tbkMCI("set cdAudio time format to" && oldTimeFormat,"")
get tbkMCI("close cdAudio","")
A button that plays a CD from
has been copied to the clipboard.
startPos
endPos
bitmap
generic
index widget
4s_fileName, s_x, s_y, s_ext, s_last
--cache these user
faster referencing
oextension
cached
tbkBitmapchk("
" &&
& "1." &
&& "alias ix1 style child", 1, 1)
" && s_x & "," & s_y)
Cate
textScrolled
s_filename
" &&
I & \
"." &
&& "
h && "
eix" &
&& "
" &&
eix" &
&& "state
e" &&
&& "
("close" &&
"ix" & num
e" &&
&& "
files that
indexer controls
rightbuttonUp
4centerPoint, indexing, currIx
x, y, frames
--choose
highest numbered
openDlg(".", "", "Choose
a series.", "Set Index Bitmaps")
- 2)
- 3)
cTRUE
"Your
pdoesn't
("Where
zyou want
bitmaps
appear? (x,y)"
ox & "," &
CRLF
textScrolled
mouseEnter
mouseLeave
rightbuttonUp
mouseEnter
fileName
extension
alias ix1 style child
tbkBitmapchk
window ix1 position
tbkBitmap
window ix1 state show
tbkBitmap
s_fileName
s_ext
s_last
textScrolled
s_filename
alias ix
style child
tbkBitmapchk
window ix
position
tbkBitmap
window ix
state show
tbkBitmap
window
state hide
tbkBitmap
close
tbkBitmap
s_fileName
s_ext
s_last
mouseLeave
window
state hide
tbkBitmap
close
tbkBitmap
s_ext
s_filename
s_last
rightbuttonUp
mouseLeave
Choose the highest numbered bitmap in a series.
Set Index Bitmaps
openDlg
fileName
extension
extension
Your file name doesn't end in a number.
Where do you want the bitmaps to appear? (x,y)
cancel
fileName
fileName
frames
fileName
frames
centerPoint
indexing
currIx
MIDI sequencer: Event Editor
B"Unload"
--update the
tbkMCI("status MIDIFile
","")
"Length"
"Position"
"Name"
"Start
"End
leavepage
leavepage
buttonDown
Unload
status MIDIFile position
tbkMCI
Length
Position
Start Position
End Position
Position
Position
noCopy
The controls on this page let you select a clip from a MIDI file and create a button that plays that clip.
After loading a MIDI file, select a clip from it by clicking the Start and End Clip buttons while the MIDI file is playing. This will set the Start and End Position Field text to MIDI file's current position. You can also edit the text of the Start and End Position fields. The End Position field text should be greater than the Start Position field text. Click the Play Clip button to test your clip. When you're done, click the Make A MIDI Clip Button button. A button that plays the clip will be copied to the clipboard.
The Position field requires this page's idle handler. You must copy the handler into the page or background where you paste these elements if you want it to update correctly. y. update correctly. ates the Current Position field by querying the status of the wave audio driver. Some of these controls and the idle handler require the Wave File, Milliseconds and Current Position fields. If you copy these fields, you need to use this page's idle handler.
MIDIfile : an alias used for the current MIDI file.
editScript "alias midiFile",
B"Load"
buttonUp
buttonUp
editScript
alias midiFile
MIDI Sequencer
Event Editor
Start Position
Start Position: n
End Position
End Position: tion
Play Clip
Restart Clipck
Restart
rack
Rewind
Pause t
Play rt
FF n rt
Unload
Length
Position
Position: ition:
Length: onds: e:
txclassname
3DFrame Recessed
MIDI File: s: e:
Stop rt
ZfileName
a MIDI
OpenDlg(".", "*.
g", "Please choose a
D.", "Choose
@File")
--close old
B"unload"
tbkMCIchk("
" &&
&& "alias MIDIFile","",1,1)
ms","",1)
Tstatus
> length","",1)
buttonDown
buttonDown
*.mid
Please choose a MIDI file.
Choose MIDI File
OpenDlg
buttonDown
unload
alias MIDIFile
tbkMCIchk
set MIDIFile time format ms
tbkMCIchk
status MIDIFile length
tbkMCIchk
length
fileName
Unload
tbkMCI("close MIDIFile","")
buttonDown
buttonDown
close MIDIFile
tbkMCI
Restart
tbkMCIchk("seek MIDIFile
0","",1)
buttonDown
buttonDown
seek MIDIFile to 0
tbkMCIchk
Rewind
4MIDIctr
FALSE
tbkMCI("stop MIDIfile","")
tbkMCIchk("status MIDIFile
","",1)
s <>
< 100
" &&
,"",1)
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
stop MIDIfile
tbkMCI
status MIDIFile position
tbkMCIchk
MIDIctr
buttonStillDown
position
MIDIctr
buttonUp
seek MIDIFile to
tbkMCIchk
MIDIctr
B o ^
Pause
tbkMCIchk("
MIDIFile","",1)
buttonDown
buttonDown
pause MIDIFile
tbkMCIchk
tbkMCIchk("Stop midiFile","",1,1)
"seek
0","",1)
buttonDown
buttonDown
Stop midiFile
tbkMCIchk
seek midiFile to 0
tbkMCIchk
tbkMCIchk("play MIDIFile","",1)
yieldApp()
buttonDown
buttonDown
play MIDIFile
tbkMCIchk
yieldApp
4MIDIctr, MIDImax
FALSE
tbkMCI("stop MIDIfile","")
tbkMCIchk("status MIDIFile
","",1)
" && "length","",1)
- 100
" &&
"",1)
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
stop MIDIfile
tbkMCI
status MIDIFile position
tbkMCIchk
status MIDIFile
length
tbkMCIchk
MIDIctr
MIDImax
buttonStillDown
position
MIDIctr
MIDImax
buttonUp
seek MIDIFile to
tbkMCIchk
MIDIctr
MIDImax
Restart Clip
"Start Position"
"Please
a clip
tbkMCIchk("seek MIDIfile
" &&
[,"",1)
buttonDown
buttonDown
Start Position
Please select a clip first.
seek MIDIfile to
Start Position
tbkMCIchk
Play Clip
"Start Position"
"Please
a clip
tbkMCIchk("play MIDIfile
" &&
\&& \
" &&
"End
o,"",1)
yieldApp()
buttonDown
buttonDown
Start Position
Please select a clip first.
play MIDIfile from
Start Position
End Position
tbkMCIchk
yieldApp
Start Clip
tbkMCIchk("status MIDIfile
","",1,1)
"Start Position"
buttonDown
buttonDown
status MIDIfile position
tbkMCIchk
Start Position
Start Clip
End Clip
tbkMCIchk("status MIDIfile
","",1,1)
"End Position"
buttonDown
buttonDown
status MIDIfile position
tbkMCIchk
End Position
End Clip
Make A MIDI Clip Button
ZfileName, startPos, endPos
"Start Position"
"Please
a clip
"End
setDefaultButtonStyle
2000,750
"MIDI File Clip"
}" & CRLF & TAB & \
tbkMCI(""
" &&
&& "alias clipAlias"",
)" &
ms"",
)" &
Uplay
" &&
&& \
" &&
&& "wait"",
)" &
close
)" &
Bthat plays" &&
&& "
" &&
&& \
" &&
&& "has been copied
the clipboard."
buttonUp
buttonUp
Start Position
Please select a clip first.
Start Position
End Position
setDefaultButtonStyle
MIDI File Clip
to handle buttonUp
get tbkMCI("open
alias clipAlias","")
get tbkMCI("set clipAlias time format ms","")
get tbkMCI("play clipAlias from
wait","")
get tbkMCI("close clipAlias","")
A button that plays
has been copied to the clipboard.
fileName
startPos
endPos
Make A MIDI Clip Button
Generic: 3D Objects
MIDI sequencer: Status
"capabilityResults"
"statusResults"
leavePage
leavePage
capabilityResults
statusResults
The Update buttons scripts walk through the textlines of the Capability and Status fields and queries the driver for the term on each textline. The query results are stored in a variable and then displayed in the Capability and Status Results fields.
The Capability button queries the MIDI sequencer device; the Status button queries a MIDI file.e.
MIDIfile : an alias used for the Play and Wait, and Play and Notify buttons' MIDI files.
s__tempoMax : a system variable used by the tempo slider containing the maximum tempo value for the current MIDI file. the current MIDI file.
editScript "
B"update capability"
buttonDown
buttonDown
editScript
step i from 1 to textLineCount(it)
update capability
editscript "tbkMCI(""capability",
B"Update Capability"
buttonDown
buttonDown
editscript
tbkMCI("capability
Update Capability
editscript "tbkMCI(""status",
B"Update Status"
buttonDown
buttonDown
editscript
tbkMCI("status
Update Status
MIDIfile : an alias for the MIDI file opened in the Update Status button's script.
editScript "alias midiFile",
B"update status"
buttonDown
buttonDown
editScript
alias midiFile
update status
MIDI Sequencer
Capability and Statusus
txclassname
3DFrame Recessed
Status
Status
status
Ready
Length
Position
Number of tracks
Current track
Tempo
Division type
Offsetumber of tracks
Current trackrack
Current track
statusResults
txclassname
3DFrame Recessed
Capabilityes
Capabilityes
capability
Can record
Device type
Has audio
Has video
Compound device
Has files
Outputs
Inputs
capabilityResults
Update capability
Zcapability
"capabilityResults"
tbkMCI("
sequencer","")
/ &&
,"") & \
CRLF
bclose
buttonDown
buttonDown
capabilityResults
open sequencer
tbkMCI
capability
capability sequencer
tbkMCI
close sequencer
tbkMCI
capabilityResults
capability
Update Capability
Update Status
Zstatus
"statusResults"
OpenDlg(".", "*.
g", "Choose a MIDI file
B.", "
File")
tbkMCI("
" &&
&& "alias midiFile","")
. &&
,"") & \
CRLF
rclose
buttonDown
buttonDown
statusResults
*.mid
Choose a MIDI file for this button.
Choose MIDI File
OpenDlg
statusResults
alias midiFile
tbkMCI
status
status midiFile
tbkMCI
close midiFile
tbkMCI
statusResults
status
fileName
D:\MM\tb2.mid
Update Status
MIDI Sequencer: MIDI To Wave
4s_kHz, s_Channels, recording
FALSE
B"11025"
11025
"stereoMono"
B"1"
"0,75.3125,0"
B"stop
"0,75.3125,0"
B"Unload"
Wave"
--update the
tbkMCI("status MIDIFile
","")
"Length"
"Position"
"Name"
"waveFileLength"
tbkmci("
","")
terpage
leavepage
enterpage
enterpage
11025
stereoMono
start recording
0,75.3125,0
stop recording
0,75.3125,0
s_kHz
s_Channels
recording
leavepage
buttonDown
Unload
buttonDown
Unload Wave
status MIDIFile position
tbkMCI
Length
Position
Position
Position
waveFileLength
status waveFile position
tbkmci
recording
%^&H'T*2+V,R-
noCopy
The controls on this page let you create a wave file from a MIDI file. Recording MIDI to a wave file will probalby result in smoother beginning and ending points than possible from the MIDI event editor on the previous page.
To use this page, first choose your sample rate (11-44 kHz), choose the number of channels (stereo or mono), and load a MIDI file by clicking the Load button. Next open a new wave file. The Record button's text will change to white. Click the Play button to start playing the MIDI file. When you reach the right section of the MIDI file, click the Record button to start recording. Click the large Stop button to stop recording. Click the Save button to give the wave file a name and to save it. The Unload button will close it.
The Position and Wave File Length fields require this page's idle handler. You must copy the handler into the page or background where you paste these elements if you want it to update correctly. rrectly. y. ly. e correctly. ate correctly. ctly.
editScript "
buttonUp
buttonUp
editScript
to handle idle
s_kHz : a system variable containing the sample rate used in the recording.
s_channels : a system variable containing the number of channels used in the recording.
recording : a system variable used as a flag to determine whether recording is occuring. containing the starting position of track 1.
s_end : a system variable used in the Scan Forward button containing the end position of the disc.
s_kHz : a system variable containing the sample rate used in the recording.
s_channels : a system variable containing the number of channels used in the recording.
editScript "
s_kHz
buttonDown
buttonDown
editScript
set s_kHz to
editScript "
s_Channels
"stereoMono"
buttonDown
buttonDown
editScript
set s_Channels to
stereoMono
editScript "
recording
buttonDown
buttonDown
editScript
set recording to
MIDI to Wave Converterer
tbkMCI("play d:\mm\wave.
200 wait","")
buttonUp
buttonUp
play d:\mm\wave.wav from 100 to 200 wait
tbkMCI
fileName
d:\mm\wave.wav
Button
txclassname
3DFrame Recessed
txclassname
3DFrame Recessed
stereoMono
FALSE
4s_Channels
radio
Bthat was clicked
buttonDown
buttonUp
buttonDown
buttonUp
s_Channels
Stereo
FALSE
4s_kHz
radio
Bthat was clicked
buttonDown
buttonUp
buttonDown
buttonUp
s_kHz
11025
11 kHz
22050
22 kHz
44100
44 kHz
waveFileLength
Wave File Length:
Restart
rack
Rewind
Pause t
Play rt
FF n rt
Unload
Length
Position
Position: ition:
Length: onds: e:
txclassname
3DFrame Recessed
MIDI File: s: e:
Stop rt
ZfileName
a MIDI
OpenDlg(".", "*.
g", "Please choose a
D.", "Choose
@File")
--close old
B"unload"
tbkMCIchk("
" &&
&& "alias MIDIFile","",1,1)
ms","",1)
Tstatus
> length","",1)
buttonDown
buttonDown
*.mid
Please choose a MIDI file.
Choose MIDI File
OpenDlg
buttonDown
unload
alias MIDIFile
tbkMCIchk
set MIDIFile time format ms
tbkMCIchk
status MIDIFile length
tbkMCIchk
length
fileName
Unload
tbkMCI("close MIDIFile","")
buttonDown
buttonDown
close MIDIFile
tbkMCI
Restart
tbkMCIchk("seek MIDIFile
0","",1)
buttonDown
buttonDown
seek MIDIFile to 0
tbkMCIchk
Rewind
4MIDIctr
FALSE
tbkMCI("stop MIDIfile","")
tbkMCIchk("status MIDIFile
","",1)
s <>
< 100
" &&
,"",1)
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
stop MIDIfile
tbkMCI
status MIDIFile position
tbkMCIchk
MIDIctr
buttonStillDown
position
MIDIctr
buttonUp
seek MIDIFile to
tbkMCIchk
MIDIctr
Pause
tbkMCIchk("
MIDIFile","",1)
buttonDown
buttonDown
pause MIDIFile
tbkMCIchk
tbkMCIchk("Stop midiFile","",1,1)
"seek
0","",1)
buttonDown
buttonDown
Stop midiFile
tbkMCIchk
seek midiFile to 0
tbkMCIchk
tbkMCIchk("play MIDIFile","",1)
yieldApp()
buttonDown
buttonDown
play MIDIFile
tbkMCIchk
yieldApp
4MIDIctr, MIDImax
FALSE
tbkMCI("stop MIDIfile","")
tbkMCIchk("status MIDIFile
","",1)
" && "length","",1)
- 100
" &&
"",1)
uttonDown
buttonStillDown
buttonDown
buttonUp
buttonDown
stop MIDIfile
tbkMCI
status MIDIFile position
tbkMCIchk
status MIDIFile
length
tbkMCIchk
MIDIctr
MIDImax
buttonStillDown
position
MIDIctr
MIDImax
buttonUp
seek MIDIFile to
tbkMCIchk
MIDIctr
MIDImax
Start Recording
4recording
tbkMCIchk("
) waveFile","",1)
B"Stop Recording"
"0,75.3125,0"
buttonDown
buttonDown
0,100,0
record waveFile
tbkMCIchk
Stop Recording
0,100,0
0,75.3125,0
recording
Record
Stop Recording
4recording
tbkMCIchk("stop waveFile","",1)
"0,75.3125,0"
FALSE
buttonDown
buttonDown
0,100,0
stop waveFile
tbkMCIchk
0,75.3125,0
start recording
0,100,0
recording
Load MIDI
Unload Wave
4s_kHz, s_channels
tbkMCI("close waveFile","")
qtype waveaudio alias
) buffer 9","")
f" &&
o,"")
W level 2","")
m samplespersec" &&
bitspersample 8","")
input","")
B"Start Recording"
"waveFileLength"
buttonDown
buttonDown
close waveFile
tbkMCI
open new type waveaudio alias waveFile buffer 9
tbkMCI
set waveFile channels
tbkMCI
set waveFile level 2
tbkMCI
set waveFile samplespersec
tbkMCI
set waveFile bitspersample 8
tbkMCI
cue waveFile input
tbkMCI
Start Recording
0,100,0
waveFileLength
s_kHz
s_channels
Unload Wave
4recording
B"stop
tbkMCI("close waveFile","")
"0,75.3125,0"
"0,75.3125,0"
"waveFileLength"
buttonDown
buttonDown
buttonDown
stop recording
close waveFile
tbkMCI
start recording
0,75.3125,0
stop recording
0,75.3125,0
waveFileLength
recording
Open New Wave File
Save Wave File
4recording
"waveFileLength"
B"stop
("Enter a file
tbkMCIchk("
" &&
,"",1)
buttonDown
buttonDown
waveFileLength
buttonDown
stop recording
Enter a file name for this wave file.
cancel
save waveFile
tbkMCIchk
recording
Wave Audio: Recording Controls
B"Unload"
--update the
tbkMCI("status waveFile
","")
"Position"
yieldApp()
leavepage
leavepage
buttonDown
Unload
status waveFile position
tbkMCI
Position
Position
Position
yieldApp
These widgets record sound by opening a new wave file, then recording into it. MCI also allows you to record over an existing wave file and save it under a different name. To start, click the Open button to
open a new wave file. An idle handler updates the Position field by querying the status of the wave audio driver.
The Position field requires this page's idle handler. You must copy the handler into the page or background where you paste these elements if you want them to update correctly. sure to forward the messages.
The Wave File, Milliseconds and Current Position fields, and the slider require this page's Idle handler.onds and Current Position fields, and the slider require this page's Idle handler. the slider require this page's Idle handler.ds, and the slider require this page's Idle handler.
editScript "
tbkMCIchk(""
buttonDown
buttonDown
editScript
get tbkMCIchk("open
editscript "
buttonDown
buttonDown
editscript
to handle idle
waveFile : an alias for the new wave file..%
editScript "alias waveFile",
B"Open"
buttonDown
buttonDown
editScript
alias waveFile
Wave Audio
Recording Controlssing controls controls
Restart
rack
Stop t
Play rt
Record
Save Wave File
Position
Position: sition in Milliseconds:
txclassname
3DFrame Recessed
label
Open New Wave File
label
Unload Wave Fileile
--close old wave file
B"Unload"
tbkMCIchk("
qtype waveaudio alias waveFile","",1,1)
buttonDown
buttonDown
buttonDown
Unload
open new type waveaudio alias waveFile
tbkMCIchk
"Position"
("Enter a file
wave
tbkMCIchk("
waveFile" &&
,"",1)
buttonDown
buttonDown
Position
Enter a file name for this wave file.
cancel
save waveFile
tbkMCIchk
Unload
--close the wave file
tbkMCI("
!waveFile","")
buttonDown
buttonDown
close waveFile
tbkMCI
Restart
tbkMCIchk("seek waveFile
0","",1)
buttonDown
buttonDown
seek waveFile to 0
tbkMCIchk
Record
tbkMCIchk("record waveFile","",1)
yieldApp()
buttonDown
buttonDown
record waveFile
tbkMCIchk
yieldApp
tbkMCIchk("stop waveFile","",1)
0","",1)
buttonDown
buttonDown
stop waveFile
tbkMCIchk
seek waveFile to 0
tbkMCIchk
tbkMCIchk("play waveFile","",1)
yieldApp()
buttonDown
buttonDown
play waveFile
tbkMCIchk
yieldApp
Generic: 3D Objects
The 3D objects on this page are simple graphic objects that can be useful in your layouts. These objects are actually groups; don't use too many at a time.
3D fields are made of a group of 3 objects in which the field itself is the first element (the farthest) and the shadow and highlight are 90 degree angledLines.
Other objects are made of various graphic objects, with the shadow as one element, the highlight as the middle element (or vice-versa, depending on whether the object is recessed), and the object itself as the last element.
Some of these objects, such as 3D fields and rectangles, can be resized with no side effects. The others are automatically repaired when you resize them.
The TBKMM.SBK sysBook script contains a handler for the sized message. The sized message is sent to objects after they're resized at author level. The txClassName user property determines how these groups are repaired when they're resized. You can change the properties of the field object in the 3D field by placing the focus in it, and then referring to it as "the focus" in the Command window. The Field Properties menu command also becomes available when the focus is in a field, so you can display the Field Properties dialog box. When your layout is final, ToolBook performance will be slightly better if you ungroup graphics that do not have to be grouped..up graphics that do not have to be grouped.
txClassName : a user property for the objects on this page that need adjustment after they're resized.
editScript "txClassName
>", tbkmmsbk()
buttonUp
buttonUp
editScript
txClassName of target
tbkmmsbk
Generic Layout Objects
3D Objects
(this is a field)
txClassName
3D recessed
txClassName
txClassName
txclassname
3DFrame Recessed
txClassName
txClassName
txClassName
3Drecessed
txClassName
3Drecessed
txclassname
3DFrame
Animation: Buttons
Using the Widget font in apps
uencer: Midi File Button
Generic: Fancy Sliders
Sliders
To learn how sliders work, read about
horizontal and vertical sliders.
You can make your own sliders or ungroup existing sliders and add your own elements, such as a scale or a different thumb. To create a new slider group which will work automatically, follow these rules:
1) The thumb can be any object with a txClassName user property set to "hSliderThumb" or "vSliderThumb".
2) The thumb must be the highest layered object of the group.
3) The bounds of the lowest layered object in the group determines the range of travel for the thumb.
4) If you write a script for the slider or its thumb, forward all buttonDown, buttonStillDown and buttonUp messages.
5) Don't make sliders draw direct. If you do they'll flash as you drag them.
The TBKMM.SBK sysBook slider script is activated by the txClassName user property of the thumb object. This property can be "vSliderThumb" or
"hSliderThumb" , depending on the orientation of the slider..
"Generic:
Horizontal Sliders"
buttonUp
buttonUp
Generic: Horizontal Sliders
"Generic:
Vertical Sliders"
buttonUp
buttonUp
Generic: Vertical Sliders
editScript "vsliderthumb", tbkmmsbk()
buttonUp
buttonUp
editScript
vsliderthumb
tbkmmsbk
editScript "hsliderthumb", tbkmmsbk()
buttonUp
buttonUp
editScript
hsliderthumb
tbkmmsbk
txClassName : a user property of the thumb objects containing either "hSliderThumb" or "vSliderThumb"
editScript "
txClassName
>", tbkmmsbk()
buttonUp
buttonUp
editScript
get txClassName of target
tbkmmsbk
Generic Controls
Fancy Sliders
Linked sliders:
Each of these two sliders also controls the other when you move its thumb with the mouse. It does that by setting the other's
SliderPosition property to its own.
editScript "
sliderPosition",
"slave 1"
buttonUp
buttonUp
editScript
set sliderPosition
slave 1
Slave 0
sliderPosition
"Slave 1"
StillDown
buttonStillDown
buttonUp
buttonStillDown
Slave 1
sliderPosition
sliderPosition
buttonUp
Slave 1
sliderPosition
sliderPosition
0.4451170298627926
height
defStrokeColor
0,0,0
width
glide
button id 3 of page id 14
defFillColor
0,100,0
txClassName
vSliderThumb
Slave 1
sliderPosition
"Slave 0"
StillDown
buttonStillDown
buttonUp
buttonStillDown
Slave 0
sliderPosition
sliderPosition
buttonUp
Slave 0
sliderPosition
sliderPosition
0.4806259314456036
defStrokeColor
0,0,0
width
glide
line id 12 of page id 14
defFillColor
0,100,0
txClassName
HSliderThumb
0.4806259314456036
width
glide
group id 24 of page id 14
txClassname
hSliderThumb
Believe it or not, this is a slider. You can drag its thumb object within the range set by the bounds of the angledline.
0.9373368146214099
SliderPosition
%"0,00"
%"0,00"
%"0,00"
tonUp
keyUp
buttonUp
buttonStillDown
buttonUp
SliderPosition
keyUp
SliderPosition
buttonStillDown
SliderPosition
height
glide
line id 41 of page id 14
txClassName
vSliderThumb
The slider below has an invisible track. Try it.
txclassname
3DFrame Recessed
0.4451170298627926
Wave Audio: Recording Controls
Generic: Fancy Sliders
Timers: Simple Timing Controls
Timers: Simple Timing Controls
Generic: Horizontal Sliders
just displays the slider
thumb
being moved
message so
LysBook gets
txClassName
sliderPosition
%"0,00"
"sposition"
"sPosition"
buttonstilldown
buttonup
leavePage
buttonstilldown
txClassName
thumb
sliderPosition
sposition
buttonup
sPosition
leavePage
sPosition
(h0h0h0h0h0h0h0h0h0h0h0h0h0h0h0h0h0h0h0h0h0h0h0
Sliders are groups. The topmost object is called a "thumb" object. You can do two things with sliders: Read their position and set their position.
To get the position of a slider, get its SliderPosition. To set the position, set its SliderPosition. The SliderPosition is always expressed as a floating point number between 0 and 1. When the thumb object of a horizontal slider is at the far left position, its parent's SliderPosition will be 0. If the thumb object is at the far right, its parent's SliderPosition will be 1.
You can get the position of a slider on buttonStillDown and buttonUp messages. Make sure to include a
forward statement in these handlers so the sysBook receives the button messages too.
The TBKMM.SBK sysBook slider script is activated by the txClassName user property of the thumb object. This property can be "vSliderThumb" or
"hSliderThumb" , depending on the orientation of the slider. The script for this page intercepts buttonStillDown and buttonUp messages to display the slider position.
editScript "
buttonUp
buttonUp
editScript
forward
editScript "vsliderthumb", tbkmmsbk()
buttonUp
buttonUp
editScript
vsliderthumb
tbkmmsbk
editScript "hsliderthumb", tbkmmsbk()
buttonUp
buttonUp
editScript
hsliderthumb
tbkmmsbk
editScript "
buttonUp
buttonUp
editScript
to handle buttonStillDown
editScript "
buttonUp
buttonUp
editScript
to handle buttonUp
txClassName : a user property of the thumb objects containing either "hSliderThumb" or "vSliderThumb"
editScript "
txClassName
>", tbkmmsbk()
buttonUp
buttonUp
editScript
get txClassName of target
tbkmmsbk
Generic Controls
Horizontal Sliderss
0.5743801652892562
txClassName
Slider
follower
rectangle id 6 of page id 15
width
glide
roundedrectangle id 54 of page id 15
txClassName
hSliderThumb
Button
0.3993855606758833
txClassName
Slider
txClassName
hSliderThumb
glide
group id 101 of page id 15
width
follower
rectangle id 6 of page id 15
Button
0.3613138686131387
txClassName
Slider
h!T!txClassName
hSliderThumb
!v!glide
roundedrectangle id 76 of page id 15
!width
!follower
rectangle id 6 of page id 15
Button
`"F"s
0.7471264367816092
t"txClassName
Slider
"hilight
false
"width
#glide
button id 103 of page id 15
F#txClassName
hSliderThumb
Button
0.5128205128205128
#txClassName
Slider
`$L$txClassName
hSliderThumb
$n$glide
button id 107 of page id 15
$width
$hilight
false
Button
0.346512661039538
F%txClassName
Slider
%width
%glide
line id 111 of page id 15
&txClassName
hSliderThumb
0.2825979176995538
&txClassName
Slider
:74 k
4' 'txClassName
hSliderThumb
b'B'glide
line id 118 of page id 15
p'width
sposition
sposition
Slider Position:
Animation: Status
es & Status
"capabilityResults"
"statusResults"
leavePage
leavePage
capabilityResults
statusResults
To use these status panels in your application, copy all the objects on the page and examine the script of the Update buttons.
How it works: The button script simply walks through the textlines of the Capability and Status fields and queries the driver for the term on each textline. The query results are stored in a variable and then displayed in the Capability and Status results fields.
The Capability button queries the animation device; the Status button queries an animation file.em, and finally uses the text again as the name of the field in which to put the item value...
editScript "
B"update capability"
buttonDown
buttonDown
editScript
step i from 1 to textLineCount(it)
update capability
editscript "tbkMCI(""capability",
B"Update Capability"
buttonDown
buttonDown
editscript
tbkMCI("capability
Update Capability
editscript "tbkMCI(""status",
B"Update Status"
buttonDown
buttonDown
editscript
tbkMCI("status
Update Status
aniFile : an alias used for the animation file when displaying status items.
editscript "alias aniFile",
B"Update Status"
buttonDown
buttonDown
editscript
alias aniFile
Update Status
Animation
Capability and Statususs
txclassname
3DFrame Recessed
Status
Status
status
Ready
Length
Position
Time Formatec
Number of tracks
Current track
Current trackrrent trackt trackurrent trackrent track
Current track
statusResults
capability
Can play
Can record
Can reverse
Device type
Has audio
Has video
Compound device
Windows
Capabilityes
Capabilityes
capabilityResults
Update capability
Zcapability
"capabilityResults"
tbkMCI("
animation shareable","")
9" &&
,"") & \
CRLF
mclose
k","")
buttonDown
buttonDown
capabilityResults
open animation shareable
tbkMCI
capability
capability animation
tbkMCI
close animation
tbkMCI
capabilityResults
capability
Update Capability
Update Status
Zstatus
"statusResults"
OpenDlg(".", "*.fl?", "Please choose
animation file.", "Choose Animation File")
tbkMCI("
" &&
&& "alias aniFile","")
- &&
,"") & \
CRLF
qclose
buttonDown
buttonDown
statusResults
*.fl?
Please choose an animation file.
Choose Animation File
OpenDlg
statusResults
alias aniFile
tbkMCI
status
status aniFile
tbkMCI
close aniFile
tbkMCI
statusResults
status
fileName
D:\MM\WIDGET\mmrk.mmm
Update Status
Generic: Vertical Sliders
Slide
just displays the slider
thumb
being moved
message so
NysBook gets
txClassName
sliderPosition
%"0,00"
"sposition"
"sPosition"
buttonstilldown
buttonup
leavePage
buttonstilldown
txClassName
thumb
sliderPosition
sposition
buttonup
sPosition
leavePage
sPosition
Sliders are groups. The topmost object is called a "thumb" object. You can do two things with sliders: Read their position and set their position.
To get the position of a slider, get its SliderPosition. To set the position, set its SliderPosition. The SliderPosition is always expressed as a floating point number between 0 and 1. When the thumb object of a vertical slider is at the bottom position, its parent's SliderPosition will be 0. If the thumb object is at the top, its parent's SliderPosition will be 1.
You can get the position of a slider on buttonStillDown and buttonUp messages. Make sure to include a
forward statement in these handlers so the sysBook receives the button messages too.
The TBKMM.SBK sysBook slider script is activated by the txClassName user property of the thumb object. This property can be "vSliderThumb" or
"hSliderThumb" , depending on the orientation of the slider. The script for this page intercepts buttonStillDown and buttonUp messages to display the slider position..
editScript "
buttonUp
buttonUp
editScript
forward
editScript "vsliderthumb", tbkmmsbk()
buttonUp
buttonUp
editScript
vsliderthumb
tbkmmsbk
editScript "hsliderthumb", tbkmmsbk()
buttonUp
buttonUp
editScript
hsliderthumb
tbkmmsbk
editScript "
buttonUp
buttonUp
editScript
to handle buttonStillDown
editScript "
buttonUp
buttonUp
editScript
to handle buttonUp
txClassName : a user property of the thumb objects containing either "hSliderThumb" or "vSliderThumb"
editScript "
txClassName
>", tbkmmsbk()
buttonUp
buttonUp
editScript
get txClassName of target
tbkmmsbk
Generic Controls
Vertical Slidersrs
txClassName
Slider
height
txClassName
vSliderThumb
glide
button id 60 of page id 16
width
hilight
false
Button
0.6428571428571428
txClassName
Slider
height
hilight
false
width
glide
button id 64 of page id 16
txClassName
vSliderThumb
txClassName
Slider
txClassName
vSliderThumb
glide
roundedrectangle id 76 of page id 16
width
hilight
false
height
6.226650062266503e-002
txClassName
Slider
height
hilight
false
width
glide
roundedrectangle id 121 of page id 16
"!txClassName
vSliderThumb
0.8284625158831004
!txClassName
Slider
~"j"txClassName
vSliderThumb
"glide
button id 89 of page id 16
"width
"hilight
false
"height
N#F#s
b#txClassName
Slider
#height
#hilight
false
$width
$glide
button id 156 of page id 16
N$txClassName
vSliderThumb
Button
0.3260869565217391
$txClassName
Slider
h%^%height
%v%glide
line id 160 of page id 16
%txClassName
vSliderThumb
"&txClassName
Slider
&height
&glide
line id 161 of page id 16
&txClassName
vSliderThumb
^'txClassName
Slider
'height
'glide
line id 163 of page id 16
"(txClassName
vSliderThumb
sposition
sposition
Slider Position:
Animation: Control Panel
4s_aniHandle
tbkMCI("status aniFile ready","")
; <>
untranslateAllWindowMessages
fclose
_","")
","")
"Name"
"Length"
"Position"
sliderPosition
"Slider"
"length"
leavepage
leavepage
status aniFile ready
tbkMCI
close aniFile
tbkMCI
s_aniHandle
status aniFile position
tbkMCI
Length
Position
Slider
sliderPosition
Position
Position
Slider
sliderPosition
length
+Z0r2
fName
F:\TBKMM\MOLECULS.MMM
The controls on this page load and play an animation file in its own overlapped window. You can drag the window anywhere on the screen. The animation file is opened in the Load button script and is closed by the Unload button's script.
If you use controls like these for animation, you should request notification from the window when the user clicks it, or when the user breaks the animation. On notification you can hide the animation window or move it out of the way of the controls.
The slider control's script is in the system book TBKMM.SBK. The thumb button's script seeks to a new position in the animation file. If you change the script of the thumb button, be sure to forward the button event messages.
The Length and Position fields, and the slider require this page's idle handler. You must copy the handler into the page or background where you paste these elements if you want them to update correctly.
editScript "
tbkmcichk(""
B"load"
buttonUp
buttonUp
editScript
get tbkmcichk("open
editScript "
tbkmci(""close",
B"unload"
buttonUp
buttonUp
editScript
get tbkmci("close
unload
editScript "
|", tbkmmsbk()
buttonDown
buttonDown
editScript
to handle buttonStillDown
tbkmmsbk
editScript "
tbkMCIchk(""seek",
B"thumb"
buttonDown
buttonDown
editScript
get tbkMCIchk("seek
thumb
editScript "alias aniFile",
B"load"
buttonUp
buttonUp
editScript
alias aniFile
Animation
Control Paneltrols
Restart
Track
Rewind
Pause t
Play rt
FF n rt
Unload
Play From....
Play To...
Play FromToo.
slider
txClassName
Slider
thumb
--thumb
seek animation file
slider's
tbkMCIchk("status aniFile length","",1,1)
sliderPosition
" &&
,"",1)
buttonUp
buttonUp
status aniFile length
tbkMCIchk
sliderPosition
seek aniFile to
tbkMCIchk
defStrokeColor
0,0,0
width
glide
line id 105 of page id 9
defFillColor
0,100,0
txClassName
HSliderThumb
Length
Position
Position: sition:
Length: onds: e:
txclassname
3DFrame Recessed
Animation File:
fileName
c:\tbkmm2\mmrk.mmm
Rewind
tbkMCIchk("status aniFile
","",1)
$("seek
" &&
b(0,
- 10),"")
buttonStillDown
buttonStillDown
status aniFile position
tbkMCIchk
seek aniFile to
tbkMCI
Step Reverse
tbkMCIchk("
aniFile","",1,1)
reverse
H1","",1)
buttonDown
buttonDown
pause aniFile
tbkMCIchk
step aniFile reverse by 1
tbkMCIchk
Pause
tbkMCIchk("
aniFile","")
buttondown
buttondown
pause aniFile
tbkMCIchk
Step Forward
tbkMCIchk("
aniFile","",1,1)
H1","",1)
buttonDown
buttonDown
pause aniFile
tbkMCIchk
step aniFile by 1
tbkMCIchk
tbkMCIchk("play aniFile","",1)
yieldApp()
buttonDown
buttonDown
play aniFile
tbkMCIchk
yieldApp
tbkMCIchk("status aniFile
","",1)
$("seek
" &&
"length",
+ 10),"")
buttonStillDown
buttonStillDown
status aniFile position
tbkMCIchk
seek aniFile to
length
tbkMCI
Unload
aniFile : an alias for the current animation file.
s_aniHandle : a system variable containing the handle to the animation window.
Restart
tbkMCI("seek aniFile
1","")
buttondown
buttondown
seek aniFile to 1
tbkMCI
Play From
("Play
frame
tbkMCIchk("play aniFile
" &&
,"",1)
buttonDown
buttonDown
Play from frame number
play aniFile from
tbkMCIchk
Play To
"Length"
("Play
frame
tbkMCIchk("play aniFile
" &&
,"",1)
buttonDown
buttonDown
Length
Play to frame number
play aniFile to
tbkMCIchk
Play From To
"Length"
("Play
frame
f"1," &
tbkMCIchk("play aniFile
" &&
&&
,"",1)
buttonDown
buttonDown
Length
Play from frame number, to frame number
play aniFile from
tbkMCIchk
4s_aniHandle
--close animation file
tbkMCI("status aniFile ready","")
P <>
untranslateAllWindowMessages
X","")
buttondown
buttondown
status aniFile ready
tbkMCI
close aniFile
tbkMCI
s_aniHandle
editScript "
s_aniHandle",
B"load"
buttonDown
buttonDown
editScript
set s_aniHandle
Videodisc: Event Editor
Widget Font Quick Reference
Wave Audio: Event Editor
Generic: Audio Mixer
Animation: More Buttons
Animation: More Buttons
Animation: Buttons
vents
tbkMCI("close aniFile","")
leavePage
leavePage
close aniFile
tbkMCI
MCI lets you display animation files in their own windows. See the Window Styles reference page to learn about different types of windows.
To display an animation file in your own application, copy a Generic button to your book and right click it in Reader mode. You'll be prompted for a file name. That file name will be stored as a user property of the button.
These buttons close their animation files automatically when they're done playing. The Manual Close buttons require you to click the animation window to close their files. Or in the case of the overlapped window, close its window by pressing Alt+F4. These buttons use the
translateWindowMessage control structure to trap mouse clicks in the bitmap window, which sends a ToolBook message to close the bitmap file. The Ovelapped button also traps a windows Close Window message. If you use the translateWindowMessage structure, you must first show the animation window when using Popup or Overlapped window styles.
eStyles"
buttonDown
buttonDown
window Styles
editScript "
B"Popup, Auto Close"
buttonDown
buttonDown
editScript
to handle rightButtonUp
Popup, Auto Close
aniFile : an alias for the current animation file.
s_aniHandle : a system variable used in the Manual buttons' scripts containing the handle to the manually closed animation windows.
editScript "alias aniFile",
B"Popup, Auto close"
buttonDown
buttonDown
editScript
alias aniFile
Popup, Auto close
Animation
Generic Animation Buttons 1
Popup, Auto Close
ofileName
tbkMCI("close aniFile","")
tbkMCIchk("
" &&
U && "alias
. style popup", "",1,1)
N state
","",1)
Tplay
k wait","",1)
OpenDlg(".", "*.fl?", "Choose
animation
B.", "
Animation
buttonDown
rightButtonUp
buttonDown
fileName
prightButtonUp
close aniFile
tbkMCI
fileName
alias aniFile style popup
tbkMCIchk
window aniFile state show
tbkMCIchk
play aniFile wait
tbkMCIchk
close aniFile
tbkMCI
rightButtonUp
*.fl?
Choose an animation file for this button.
Choose Animation File
OpenDlg
fileName
fileName
Popup
Child, Auto Close
ofileName
tbkMCI("close aniFile","")
tbkMCIchk("
" &&
U && "alias
. style child
" &&
, "",1,1)
Cplay
Z wait","",1)
OpenDlg(".", "*.fl?", "Choose
animation
B.", "
Animation
buttonDown
rightButtonUp
buttonDown
fileName
prightButtonUp
close aniFile
tbkMCI
fileName
alias aniFile style child parent
tbkMCIchk
play aniFile wait
tbkMCIchk
close aniFile
tbkMCI
rightButtonUp
*.fl?
Choose an animation file for this button.
Choose Animation File
OpenDlg
fileName
fileName
Child
Overlapped, Auto Close
ofileName
tbkMCI("close aniFile","")
tbkMCIchk("
" &&
U && \
" &&
&& "style overlapped alias
P,1,1)
_ state
","",1)
eplay
| wait","",1)
OpenDlg(".", "*.fl?", "Choose
animation
B.", "
Animation
buttonUp
rightButtonUp
buttonUp
fileName
prightButtonUp
close aniFile
tbkMCI
fileName
parent
style overlapped alias aniFile
tbkMCIchk
window aniFile state show
tbkMCIchk
play aniFile wait
tbkMCIchk
close aniFile
tbkMCI
rightButtonUp
*.fl?
Choose an animation file for this button.
Choose Animation File
OpenDlg
fileName
fileName
Overlapped
CD Audio: Event Editor
7`94;l<
=4<&E&E&E
noCopy
The controls on this page let you select a clip from a CD and create a button that plays that clip.
After turning the CD audio driver on, select a clip from the disc by clicking the Start and End Clip buttons while the CD is playing. This will set the Start and End Position Field text to current position of the CD. You can also edit the text in the Start and End Position fields. The End Position field text should be greater than the Start Position field text. Click the Play Clip button to test your clip. When you're done, click the Make A CD Audio Clip Button button. A button that plays your clip will be copied to the clipboard.
The Driver On/Off widget opens and
closes the device and initializes the disc.
The Track and Position fields, as well as the slider position are updated by an
idle handler which queries the status of the CD audio driver. You must copy the handler into the page or background where you paste these elements if you want them to update correctly. pdate correctly. ctly.
editScript "
tbkMCIchk(""
cdAudio shareable""",
"Driver switch"
buttonDown
buttonDown
editScript
get tbkMCIchk("open cdAudio shareable"
Driver switch
editScript "
tbkmci(""close cdAudio""",
"Driver switch"
buttonDown
buttonDown
editScript
get tbkmci("close cdAudio"
Driver switch
editScript "
buttondown
buttondown
editScript
to handle idle
s_device : a system variable used in the idle handler to bypass status queries if the device isn't open.
s_idle : a system variable use to count idle messages.
s_start : a system variable used in the Scan Reverse button, Stop button and slider thumb containing the starting position of track 1.
s_end : a system variable used in the Scan Forward button containing the end position of the disc.track 1.
s_end : a system varible used in the Scan Forward button containing the end position of the disc.
Choose a bitmap file for this button. (.dib or .bmp extensions)
Choose Bitmap File
OpenDlg
fileName
fileName
Would you like to specify the position of the window? If so, please enter 2 numeric coordinates.
cancel
Invalid number of coordinates.
isNumber
Coordinate number
is not a number.
4s_aniHandle
ZfileName
a animation
OpenDlg(".", "*.fl?", "Please choose
J.", "Choose Animation File")
tbkMCI("status aniFile ready","")
untranslateAllWindowMessages
fclose
_","")
tbkMCIchk("
" &&
&& "alias
" &&
8,"",1,1)
frames","",1)
"length"
,"",1)
yseek
1","",1)
state
","",1)
translating
emessages
","",1)
translateWindowMessage
animateWindowClose
--This handles
closes
edirectly (Alt-f4)
--Start timer
efinish its
Fclean
finished
unTranslateAllWindowMessages
tbkTimerStart("single",500,100,
tbkMMTimer
","")
uttonDown
animateWindowClose
buttonDown
tbkMMTimer
buttonDown
*.fl?
Please choose an animation file.
Choose Animation File
OpenDlg
status aniFile ready
tbkMCI
close aniFile
tbkMCI
alias aniFile parent
tbkMCIchk
set aniFile time format frames
tbkMCIchk
length
status aniFile length
tbkMCIchk
seek aniFile to 1
tbkMCIchk
window aniFile state show
tbkMCIchk
status aniFile window handle
tbkMCIchk
animateWindowClose
fileName
s_aniHandle
animateWindowClose
single
tbkTimerStart
s_aniHandle
tbkMMTimer
close aniFile
tbkMCI
Generic Controls: Event Editor
Videodisc: Simple Controls
Index
CD Audio: Small Simple Controls
P!\%>(F)*,4-
5:7\:
=tAdExF
The Driver On/Off switch opens and
closes the device and initializes the disc. The slider position, as well as the track and position fields are updated by an idle handler which queries the status of the CD audio driver.
The slider control's script is in the system book TBKMM.SBK. The thumb button's script plays from a new position on the disc. If you change the script of the thumb button, be sure to forward the button event messages.
Most of the widgets on this page require this page's script. Each button control sends a checkDevice message. The checkDevice handler in the page script makes sure the driver switch has been turned on. Status fields are update by the page script's idle handler.
The first few seconds of a CD are not addressable, so you can't seek to or play from position zero. However you can play from the position of the first track, or seek to the position of the first track plus one second................. one second.
editScript "
tbkMCIchk(""
cdAudio shareable""",
"Driver switch"
buttonDown
buttonDown
editScript
get tbkMCIchk("open cdAudio shareable"
Driver switch
editScript "
tbkmci(""close cdAudio""",
"Driver switch"
buttonDown
buttonDown
editScript
get tbkmci("close cdAudio"
Driver switch
editScript "
buttondown
buttondown
editScript
to handle idle
editScript "
|", tbkmmsbk()
buttonDown
buttonDown
editScript
to handle buttonStillDown
tbkmmsbk
editScript "
tbkMCIchk(""play cdAudio
B"thumb"
buttonDown
buttonDown
editScript
get tbkMCIchk("play cdAudio from
thumb
editScript "
checkDevice",
buttonDown
buttonDown
editScript
to handle checkDevice
s_device : a system variable used in the idle handler to bypass status queries if the device isn't open.
s_idle : a system variable use to count idle messages.
s_prompt : a system variable containing the last value entered when prompting for the play from/to positions.
s_start : a system variable used in the Scan Reverse button, Stop button and slider thumb containing the starting position of track 1.
s_end : a system variable used in the Scan Forward button containing the end position of the disc.c.
Play from (Examples: "3:45 to 4:17", "track 4 to 9"):
cancel
track
set cdAudio time format tmsf
tbkMCIchk
play cdAudio from
:00:00:00 to
:00:00:00
tbkMCIchk
set cdAudio time format msf
tbkMCI
set cdAudio time format msf
tbkMCIchk
play cdAudio from
:00 to
tbkMCIchk
s_prompt
Tracks
Track
Position
-- The
used only
you want
-updating
fits own timer.
-- To turn the
on,
running
"on"
tbkTimer("
V shareable alias tmCDPos",
type periodic","")
1000","")
aplay
vclose
multimedia
ownerPgBkgnd
tbkMCI("sysinfo cdaudio use count","")
(isNumber(
tbkCDAudio("status cdAudio
","")
Tn-2
multimedia
running
running
open timer shareable alias tmCDPos
tbkTimer
set tmCDPos type periodic
tbkTimer
set tmCDPos period 1000
tbkTimer
play tmCDPos
tbkTimer
close tmCDPos
tbkTimer
multimedia
ownerPgBkgnd
running
sysinfo cdaudio use count
tbkMCI
isNumber
status cdAudio position
tbkCDAudio
Animation: Event Editor
bitmap
custom
index widget
4s_path, s_last
tbkBitmapchk("
" &&
5 & "ix1.dib alias
style child", 1, 1)
20, 120")
C state
textScrolled
" &&
& "ix" &
) & \
ix" &
< && "
eix" &
V && "
20, 120")
eix" &
y && "
e" &&
&& "
("close" &&
"ix" &
e" &&
&& "
ouseEnter
textScrolled
mouseEnter
mouseLeave
mouseEnter
ix1.dib alias ix1 style child
tbkBitmapchk
window ix1 position 20, 120
tbkBitmap
window ix1 state show
tbkBitmap
s_path
s_last
textScrolled
.dib alias ix
style child
tbkBitmapchk
window ix
position 20, 120
tbkBitmap
window ix
state show
tbkBitmap
window
state hide
tbkBitmap
close
tbkBitmap
s_path
s_last
mouseLeave
window
state hide
tbkBitmap
close
tbkBitmap
s_last
Wave Audio: Sound and Animation
MIDI sequencer: Simple Controls
Bitmap Graphics: Bitmap Buttons
CDAudio: Controls (1)
Wave Audio: Wave File Buttons
Wave Audio: Event Editor
B"Unload"
--update the
tbkMCI("status waveFile
","")
"Name"
"Length"
"Start Position"
"End
yieldApp()
leavePage
leavePage
buttonDown
Unload
status waveFile position
tbkMCI
Length
Start Position
End Position
Position
Position
Position
yieldApp
noCopy
The controls on this page let you select a clip from a wave file and create a button that plays that clip.
After loading a wave file, select a clip from it by clicking the Start and End Clip buttons while the wave file is playing. This will set the Start and End Position fields' text to the wave file's current position. You can also edit the text of the Start and End Position fields. The End Position field text should be greater than the Start Position field text. Click the Play Clip button to test your clip. When you're done, click the Make A Wave File Button button. A button that plays the clip will be copied to the clipboard.
The Load button opens the device and a file, and the Unload button
closes them. An idle handler updates the Position field by querying the status of the wave audio driver.
The Wave File, Length and Position fields require this page's idle handler. You must copy the handler into the page or background where you paste these elements if you want them to update correctly. e correctly. ectly. you need to use this page's idle handler..andler...
editScript "
tbkmcichk(""
B"load"
buttonDown
buttonDown
editScript
get tbkmcichk("open
editScript "
tbkmci(""close",
B"unload"
buttonDown
buttonDown
editScript
get tbkmci("close
unload
editscript "
buttonDown
buttonDown
editscript
to handle idle
waveFile : an alias for the wave file.
editScript "alias wavefile",
B"load"
buttonDown
buttonDown
editScript
alias wavefile
Wave Audio
Event Editor
Position::sition
Restart
rack
Rewind
Stop t
Play rt
FF n rt
Unload
Position
txclassname
3DFrame Recessed
Wave File: s: e:
Start Position
Start Position: n
End Position
End Position: tion
tbkMCI("play d:\mm\wave.
200 wait","")
buttonUp
buttonUp
play d:\mm\wave.wav from 100 to 200 wait
tbkMCI
fileName
d:\mm\wave.wav
Button
Length
Length: onds: e:
Play Clip
Restart Clipck
ZfileName
a wave
OpenDlg(".", "*.
", "Please choose a
D.", "Choose Wave File")
--close old
B"Unload"
tbkMCIchk("
" &&
&& "alias waveFile","",1,1)
ms","",1)
Tstatus
> length","",1)
"Length"
buttonDown
buttonDown
*.wav
Please choose a wave file.
Choose Wave File
OpenDlg
buttonDown
Unload
alias waveFile
tbkMCIchk
set waveFile time format ms
tbkMCIchk
status waveFile length
tbkMCIchk
Length
fileName
Unload
--close the wave file
tbkMCI("
waveFile","")
buttonDown
buttonDown
close waveFile
tbkMCI
Restart
tbkMCIchk("seek waveFile
0","",1)
buttonDown
buttonDown
seek waveFile to 0
tbkMCIchk
Rewind
4s_ct
Zp, i
- > 100
A > 50
tbkMCIchk("status waveFile" && "
","",1,1)
b(0, p - i)
=eek
" && p,"",1)
buttonDown
buttonStillDown
buttonDown
buttonStillDown
buttonStillDown
status waveFile
position
tbkMCIchk
seek waveFile to
tbkMCIchk
tbkMCIchk("stop waveFile","",1)
0","",1)
buttonDown
buttonDown
stop waveFile
tbkMCIchk
seek waveFile to 0
tbkMCIchk
tbkMCIchk("play waveFile","",1)
yieldApp()
buttonDown
buttonDown
play waveFile
tbkMCIchk
yieldApp
4s_ct
Zp, i
- > 100
A > 50
tbkMCIchk("status waveFile" && "
","",1,1)
"Length", p + i)
Heek
" && p,"",1)
buttonDown
buttonStillDown
buttonDown
buttonStillDown
buttonStillDown
status waveFile
position
tbkMCIchk
Length
seek waveFile to
tbkMCIchk
Restart Clip
"Start Position"
"Please
a clip
tbkMCIchk("seek waveFile
" &&
[,"",1)
buttonDown
buttonDown
Start Position
Please select a clip first.
seek waveFile to
Start Position
tbkMCIchk
Play Clip
"Start Position"
"Please
a clip
tbkMCIchk("play waveFile
" &&
\&& \
" &&
"End
o,"",1)
yieldApp()
buttonDown
buttonDown
Start Position
Please select a clip first.
play waveFile from
Start Position
End Position
tbkMCIchk
yieldApp
Start Clip
tbkMCIchk("status waveFile
","",1,1)
"Start Position"
buttonDown
buttonDown
status waveFile position
tbkMCIchk
Start Position
Start Clip
End Clip
tbkMCIchk("status waveFile
","",1,1)
"End Position"
buttonDown
buttonDown
status waveFile position
tbkMCIchk
End Position
End Clip
Make A Wave Audio Clip Button
ZfileName, startPos, endPos
"Start Position"
"Please
a clip
"End
setDefaultButtonStyle
2000,750
"Wave Clip"
}" & CRLF & TAB & \
tbkMCI(""
" &&
&& "alias clipAlias"",
)" &
ms"",
)" &
Uplay
" &&
&& \
" &&
&& "wait"",
)" &
close
)" &
Bthat plays" &&
&& "
" &&
&& \
" &&
&& "has been copied
the clipboard."
buttonUp
buttonUp
Start Position
Please select a clip first.
Start Position
End Position
setDefaultButtonStyle
Wave Clip
to handle buttonUp
get tbkMCI("open
alias clipAlias","")
get tbkMCI("set clipAlias time format ms","")
get tbkMCI("play clipAlias from
wait","")
get tbkMCI("close clipAlias","")
A button that plays
has been copied to the clipboard.
fileName
startPos
endPos
Make A Wave Audio Clip Button
Wave Audio: Sound and Animation
Wave audio files can be be played during animation sequences by using the
yieldApp( ) function in TBKWIN.DLL. The
hold parameter for the play command prevents a lapse in the animation when the sound file finishes playing.
This page contains simple ToolBook object and font animation. The wheel rolls by setting the scroll property of a field while moving it.
The enterBook handler in the sysBook links the TBKWIN DLL and the yieldApp( ) function... it.
editScript "
yieldApp()",
B"Roll The Wheel"
buttonDown
buttonDown
editScript
get yieldApp()
Roll The Wheel
editScript "hold",
B"Roll The Wheel"
buttonDown
buttonDown
editScript
Roll The Wheel
editScript "
B"Roll The Wheel"
buttonDown
buttonDown
editScript
set scroll
Roll The Wheel
editScript "yieldApp()", tbkmmsbk()
buttonDown
buttonDown
editScript
yieldApp()
tbkmmsbk
waveFile : an alias for the wave file.
editScript "alias wavefile",
B"Roll The Wheel"
buttonDown
buttonDown
editScript
alias wavefile
Roll The Wheel
Wave Audio
Synchronizing Sound and Animation
wheel
Roll the Wheel
4s_path
Zi, j
tbkMCIchk("
" &&
* & "train.wav alias waveFile","",1,1)
:play
0 hold",
--use yield here
let the sound
playing
yieldApp()
"wheel"
H45,0
--
avoid gaps
splays
H-3600,0
tbkmmnotify
tbkmci("close
buttonDown
tbkmmnotify
buttonDown
train.wav alias waveFile
tbkMCIchk
play waveFile from 0 hold
tbkMCIchk
yieldApp
wheel
wheel
yieldApp
wheel
j:to1
s_path
tbkmmnotify
close waveFile
tbkmci
fileName
D:\MM\WIDGET\bells.wav
Roll the Wheel
%&[a:
"Driver Switch"
asure the CD Device
turned on
checkDevice trueOrFalse
--update
`Position, Track
Tracks
4s_device, s_idle
--bypass status queries
- isn't
xtbkMCI("
-cdAudio media present","")
sliderPosition
"Slider"
","")
E" <>
ms","")
","")
SliderPosition
length","")
msf","")
-- wait
messages
4updating following stuff
tracks
","")
current
b","")
avePage
checkDevice
leavePage
leavePage
Driver Switch
checkDevice
Driver Switch
Driver Switch
trueOrFalse
status cdAudio media present
tbkMCI
Position
Position
Track
Tracks
Slider
sliderPosition
status cdAudio position
tbkMCI
Position
Position
set cdAudio time format ms
tbkMCI
status cdAudio position
tbkMCI
Slider
SliderPosition
status cdAudio length
tbkMCI
set cdAudio time format msf
tbkMCI
status cdAudio number of tracks
tbkMCI
Tracks
Tracks
status cdAudio current track
tbkMCI
Track
Track
s_device
s_idle
MIDI sequencer: Status
CD Audio: Status
es & Status
"capabilityResults"
"statusResults"
leavePage
leavePage
capabilityResults
statusResults
The Update buttons scripts walk through the textlines of the Capability and Status fields and queries the driver for the term on each textline. The query results are stored in a variable and then displayed in the Capability and Status Results fields.e driver for the term on each textline. The query results are stored in a variable and then displayed in the Capability and Status Results fields.
The Update buttons scripts walk through the textlines of the Capability and Status fields and queries the driver for the term on each textline. The query results are stored in a variable and then displayed in the Capability and Status Results fields.
The Capability button queries the wave audio device; the Status button queries a wave audio file.
editScript "
B"update capability"
buttonDown
buttonDown
editScript
step i from 1 to textLineCount(it)
update capability
CD Audio
Capability and Statusus
txclassname
3DFrame Recessed
status
Ready
Media Present
Length
Position
Number of tracks
Current trackitsPerSample
SamplesPerSec
Number of tracks
Current trackrent track
statusResults
txclassname
3DFrame Recessed
Capability
Capability
Capability
Can record
Device type
Has audio
Has video
Compound device
capabilityResults
Status
Status
Update capability
Zcapability
"capabilityResults"
tbkMCIchk("
cdAudio shareable","",1,1)
y cdaudio" &&
,"") & \
CRLF
y("close
6,"")
buttonDown
buttonDown
capabilityResults
open cdAudio shareable
tbkMCIchk
capability
capability cdaudio
tbkMCI
close cdaudio
tbkMCI
capabilityResults
capability
Update Capability
Update Status
Zstatus
tbkMCI("
cdAudio shareable","")
7" &&
,"") & \
CRLF
kclose
i","")
statusResults
buttonDown
buttonDown
open cdAudio shareable
tbkMCI
status
status cdAudio
tbkMCI
close cdAudio
tbkMCI
statusResults
status
Update Status
CD Audio: Status
Generic: Vertical Sliders
Status
Generic: Audio Mixer
o controls
.#F&
These sliders do not control device drivers currently supported by MCI. When the audio mixer interface is defined for MCI, these controls can be adapted to control the mixer. You will have to adapt their scripts to suit the needs of your configuration.
The Sound checkbox can be used to turn the sound on or off.
Controls on this page are not hooked up to anything. However, the sliders have a small script that makes them control each other. Use this script as an example to see how you can set slider positions or control other items with sliders.
s_Sound : a system variable containing TRUE or FALSE set in the Sound checkbox. t
editScript "
s_Sound",
B"soundCheckbox"
buttonUp
buttonUp
editScript
set s_Sound
soundCheckbox
Generic Controls
Audio Mixer Mixer
Master
Sound
soundCheckbox
4s_Sound
buttonUp
buttonUp
s_Sound
Sound
Volume Control
tbkMCI("Set audio1 level" &&
(256 *
os), "")
(256 *
os), "")
StillDown
buttonStillDown
buttonUp
buttonStillDown
Set audio1 level
tbkMCI
buttonUp
Set audio1 level
tbkMCI
0.6936647955092221
txClassName
Slider
height
defStrokeColor
0,0,0
width
glide
button id 28 of page id 4
defFillColor
0,100,0
txClassName
vSliderThumb
txclassname
3DFrame Recessed
handl
-(y1,
buttonUp
buttonUp
handl
txclassname
vSwitchHandle
handl
-(y1,
0,50.1875,0
buttonUp
buttonUp
0,50,100
handl
txclassname
vSwitchHandle
CD Driver switch
handl
-(y1,
0,50.1875,0
buttonUp
buttonUp
120,50,100
handl
txclassname
vSwitchHandle
handl
-(y1,
buttonUp
buttonUp
0,50,100
0,0,0
handl
txclassname
vSwitchHandle
handl
-(y1,
buttonUp
buttonUp
120,50,100
0,0,0
handl
txclassname
vSwitchHandle
Player
Volume Control
tbkMCI("Set audioMaster level" &&
(256 *
os), "")
(256 *
os), "")
StillDown
buttonStillDown
buttonUp
buttonStillDown
Set audioMaster level
tbkMCI
buttonUp
Set audioMaster level
tbkMCI
txClassName
Slider
0.7417802726543705
txClassName
vSliderThumb
defFillColor
0,100,0
glide
button id 28 of page id 4
width
defStrokeColor
0,0,0
height
Volume Control
tbkMCI("Set audio3 level" &&
(256 *
os), "")
(256 *
os), "")
StillDown
buttonStillDown
buttonUp
buttonStillDown
Set audio3 level
tbkMCI
buttonUp
Set audio3 level
tbkMCI
!txClassName
Slider
0.5132317562149158
"r"txClassName
vSliderThumb
"defFillColor
0,100,0
"glide
button id 28 of page id 4
"width
#defStrokeColor
0,0,0
$#height
Volume Control
tbkMCI("Set audio2 level" &&
(256 *
os), "")
(256 *
os), "")
StillDown
buttonStillDown
buttonUp
buttonStillDown
Set audio2 level
tbkMCI
buttonUp
Set audio2 level
tbkMCI
$txClassName
Slider
0.5493183640737771
%txClassName
vSliderThumb
%defFillColor
0,100,0
%glide
button id 28 of page id 4
%width
&defStrokeColor
0,0,0
8&height
4s_kHz, s_Channels
FALSE
B"11025"
11025
"stereoMono"
B"1"
"Driver Switch"
asure the CD Device
turned on
checkDevice trueOrFalse
--update
`Position, Track
Tracks
4s_device, s_idle
--bypass status queries
- isn't
xtbkMCI("
-cdAudio media present","")
"Start
"End
","")
" <>
-- wait
messages
4updating following stuff
tracks
","")
current
b","")
leavePage
enterpage
checkDevice
enterpage
11025
stereoMono
s_kHz
s_Channels
leavePage
Driver Switch
checkDevice
Driver Switch
Driver Switch
trueOrFalse
status cdAudio media present
tbkMCI
Position
Position
Track
Tracks
Start Position
End Position
status cdAudio position
tbkMCI
Position
Position
status cdAudio number of tracks
tbkMCI
Tracks
Tracks
status cdAudio current track
tbkMCI
Track
Track
s_device
s_idle
M\D|D|u
System
M\D|D|u
aboutdlginit
M\D|D|-
bookMarks
Wave Audio: Wave File Buttons,Map
u\zp
KWidgets
gD|D|}
C:\TOOLBOOK\tbkmm.sbk
system
G\D|D|
System
TBKWidgets
gD|D|}
\D|D|
pageList
\D|D|
TBKWidgets
\D|D|
TBKWidgets
\D|D|
TBKWidgets
TBKWidgets
system
gD|D|}
gD|D|}
KWidgets
\D|D|
gD|D|}
TBKWidgets
gD|D|}
TBKWidgets
sysBookPath
D:\MM\tbkmm.sbk
aaaaaaaaaa
tbkmm.sbk
Multimedia Widgets
Wave Audio: Simple Controls,Map
s Widget Book
Wave Audio: Wave File Buttons,Map
dget Book
poration. All Rights Reserved
Shabbir Dahod
Michelle DeWilliam
Jim Gallant
Mike Miller
Claude Ostyn
Craig Schwandt
,b14,TRUE
aboutdlgbox
get Font - Quick Reference
Using the Widget font in apps
Optimizing Slider Performance
Use this page for your own notes
KWidgets
\D|D|
,h11,
,s12,Multimedia Widgets
,s13,Copyright 1991 Asymetrix Corporation. All rights reserved.
,b14,TRUE
524480,4,30,20,125,86,,,About Multimedia Widgets,8,Helv,,12.91,4.76,18.29,19.69,11,1342177283,130,toolbook,0,,40.91,10.79,65.37,9.52,12,1342177280,130,Multimedia Widgets,0,,5.45,28.88,115.73,21.58,13,1342177281,130,Copyright 1991 Asymetrix Corporation. All rights reserved.,0,,37.18,53.01,44.80,14.07,14,1342242817,128,OK,0
These buttons show simple examples of how to use the timer functions in TBKMM.DLL.
Timers seem to be limited to a maximum delay of 64k milliseconds (64 seconds). When you click the Set a Single Timer button, you're prompted for a delay, and the buttonDown script simply sets the cursor to an hourglass cursor during that delay period.
The Set A Periodic Timer button sets a delay of 500 milliseconds, and changes the button's caption in its
tbkmmTimer handler. Click the Stop Periodic Timer button to stop the periodic timer.
The call to start the periodic timer returns the timer ID number which is stored in a system variable so it can be used later in the Stop Periodic Timer button..
editScript "
tbkTimerStart(""single"",
B"Set A Single
buttonDown
buttonDown
editScript
get tbkTimerStart("single", it
Set A Single Timer
editScript "
tbkmmTimer",
B"Set A Periodic
buttonDown
buttonDown
editScript
to handle tbkmmTimer
Set A Periodic Timer
editScript "
tbkTimerStop(s_timerID)",
Periodic
buttonDown
buttonDown
editScript
get tbkTimerStop(s_timerID)
Stop Periodic Timer
editScript "
s_timerID
tbkTimerStart(""periodic",
B"Set A Periodic
buttonDown
buttonDown
editScript
set s_timerID to tbkTimerStart("periodic
Set A Periodic Timer
s_timerID : a system variable containing the timer id number used in the Periodic Timer buttons.
editScript "
s_timerID
tbkTimerStart(""periodic",
buttonDown
buttonDown
editScript
set s_timerID to tbkTimerStart("periodic
set a periodic timer
Timers
Simple Timing Controls
Set a Single Timer
("Enter a single delay less than
equal
" && \
tbkTimerCapability() && "
timer."
syserrorNumber
FALSE
tbkTimerStart("
, 1,
sysErrorNumber = 0
tbkmmTimer
"All done."
buttonDown
tbkmmTimer
buttonDown
Enter a single delay less than or equal to
tbkTimerCapability
for this timer.
cancel
single
tbkTimerStart
tbkmmTimer
All done.
Set a Single Timer
Set a Periodic Timer
4s_timerID
tbkTimerStart("periodic", 500, 1,
tbkmmTimer
buttonDown
tbkmmTimer
buttonDown
periodic
tbkTimerStart
s_timerID
tbkmmTimer
.................
timerID
Set a Periodic Timer
Stop Periodic Timer
4s_timerID
tbkTimerStop(
B"Set A Periodic
buttonDown
buttonDown
tbkTimerStop
Set A Periodic Timer
Set A Periodic Timer
s_timerID
Stop Periodic Timer
setScroll
"Description"
"Dependencies"
noCopy
excludeTab
Object"
;All"
FALSE
rf > 0
rf = 0
enterPage
setScroll
enterPage
setScroll
Description
setScroll
Dependencies
noCopy
Copy Object
Copy All
Copy Object
Copy All
setScroll
scrolling
scrolling
Page Title
Description
Dependencies
Script Notes:
copyInstructions
Click an object to copy it to the clipboard.
buttonUp
buttonUp
defStroke
0,0,0
txClassName
button
Previous
buttonUp
buttonUp
defStroke
0,0,0
txClassName
button
buttonUp
buttonUp
defStroke
0,0,0
txClassName
button
buttonUp
buttonUp
txClassName
button
defStroke
0,0,0
Index
index
buttonUp
buttonUp
index
CLASSname
txButton
txClassName
button
Widgets
buttonUp
buttonUp
defStroke
0,0,0
txClassName
button
Widgets
/"reference"
buttonUp
buttonUp
reference
txClassName
button
defStroke
0,0,0
Reference
Search
buttonUp
buttonUp
search
txClassName
button
defStroke
0,0,0
Search...
Copy Object
"copyInstructions"
Zobj, pos
eatclicks()
objectFromPoint(
buttonDown
buttonUp
buttonDown
copyInstructions
buttonUp
eatclicks
eatclicks
copyInstructions
of background
hotword
recordfield
Copy Object
Copy All
buttonUp
buttonUp
selectAll
Copy All
widgets
setScroll
"Description"
"Dependencies"
noCopy
excludeTab
Object"
;All"
FALSE
rf > 0
rf = 0
enterPage
setScroll
enterPage
setScroll
Description
setScroll
Dependencies
noCopy
Copy Object
Copy All
Copy Object
Copy All
setScroll
scrolling
scrolling
Script Notes:
Page Title
Description
Dependencies
Copy All
buttonUp
buttonUp
selectAll
Copy All
Copy Object
"copyInstructions"
Zobj, pos
eatclicks()
objectFromPoint(
buttonDown
buttonUp
buttonDown
copyInstructions
buttonUp
eatclicks
eatclicks
copyInstructions
of background
hotword
recordfield
Copy Object
copyInstructions
Click an object to copy it to the clipboard.
buttonUp
buttonUp
txClassName
button
defStroke
0,0,0
Previous
buttonUp
buttonUp
txClassName
button
defStroke
0,0,0
buttonUp
buttonUp
txClassName
button
defStroke
0,0,0
buttonUp
buttonUp
defStroke
0,0,0
txClassName
button
Index
index
buttonUp
buttonUp
index
txClassName
button
CLASSname
txButton
Widgets
buttonUp
buttonUp
txClassName
button
defStroke
0,0,0
Widgets
/"reference"
buttonUp
buttonUp
reference
defStroke
0,0,0
txClassName
button
Reference
Search
buttonUp
buttonUp
search
defStroke
0,0,0
txClassName
button
Search...
widgets
reference
Page Title
descr1
descr2
descr3
explain
buttonUp
buttonUp
defStroke
0,0,0
txClassName
button
Previous
buttonUp
buttonUp
defStroke
0,0,0
txClassName
button
buttonUp
buttonUp
defStroke
0,0,0
txClassName
button
buttonUp
buttonUp
txClassName
button
defStroke
0,0,0
Index
index
buttonUp
buttonUp
index
CLASSname
txButton
txClassName
button
Widgets
buttonUp
buttonUp
defStroke
0,0,0
txClassName
button
Widgets
buttonUp
buttonUp
txClassName
button
defStroke
0,0,0
Reference
Search
buttonUp
buttonUp
search
txClassName
button
defStroke
0,0,0
Search...
reference
4s_device
Zswitch, x
-(y1,
"off"
tbkMCI("stop cdAudio wait","")
--use
asure
worked
:close
5","")
0,50.1875,0
tbkMCIchk("
shareable","",1,1)
ms","",1)
audio
on","")
--beginning
atus
track 1","")
H1000
" &&
msf","",1)
buttonUp
buttonUp
false
stop cdAudio wait
tbkMCI
close cdAudio
tbkMCI
open cdAudio shareable
tbkMCIchk
set cdAudio time format ms
tbkMCIchk
set cdAudio audio all on
tbkMCI
status cdAudio position track 1
tbkMCI
seek cdAudio to
tbkMCI
set cdAudio time format msf
tbkMCIchk
cdAudio
120,50,100
switch
s_device
Generic: Dog Sliders
4s_Path
tbkMCI("
" &&
& "bobark.wav alias
","")
" &&
C & "oodibark.
","")
just displays the slider
thumbe
being moved
message so
NysBook gets
txClassName
sliderPosition
%"0,00"
"sposition"
"sPosition"
close
","")
","")
buttonstilldown
enterPage
buttonup
leavePage
enterPage
bobark.wav alias bobark
tbkMCI
oodibark.wav alias oodibark
tbkMCI
s_Path
buttonstilldown
txClassName
thumb
sliderPosition
sposition
buttonup
sPosition
leavePage
sPosition
close bobark
tbkMCI
close oodibark
tbkMCI
These sliders use imported DIBs as their thumb objects. Both of these DIBs share the same palette and use gray to fill in around the outlines of the dogs' heads.
The TBKMM.SBK sysBook slider script is activated by the txClassName user property of the thumb object. This property can be "vSliderThumb" or
"hSliderThumb" , depending on the orientation of the slider. The script for this page intercepts buttonStillDown and
buttonUp messages to display the slider position.
editScript "vsliderthumb", tbkmmsbk()
buttonUp
buttonUp
editScript
vsliderthumb
tbkmmsbk
editScript "hsliderthumb", tbkmmsbk()
buttonUp
buttonUp
editScript
hsliderthumb
tbkmmsbk
editScript "
buttonUp
buttonUp
editScript
to handle buttonStillDown
editScript "
buttonUp
buttonUp
editScript
to handle buttonUp
txClassName : a user property of the thumb objects containing either "hSliderThumb" or "vSliderThumb"