news |
info |
people |
software |
stuff |
HelpBalloons XCMD. Version 1.1, by Sam Deane. Copyright ©1994 ULTRALAB. Compiled 16:49:18, 28/04/94.
It lets you display text and picts from a variety of sources in help balloons - under complete HyperTalk control.
This script checks whether or not the Balloon help system is switched on, and displays a dialog if it isn't.
HelpBalloons status
if not the result then
answer "Balloon Help not switched on."
end if
This line turns Balloon help on.
HelpBalloons on
This script displays the time in a balloon. The balloon stays visible until the mouse leaves this field. Note that the balloon will only be displayed if Balloon help is switched on..
get "the mouse was clicked at " & the time
HelpBalloons show,the rect of bg fld "Information",string,it
Finally, this command turns balloon help off.
HelpBalloons off
It is called with the following syntax:
HelpBalloons show,<rect>,<type>,<source>
The <rect> parameter indicates the area which the balloon is providing help for. If the mouse strays outside this rectangle, the balloon will go away.
The <type> and <source> parameters determine the place that the content of the balloon comes from. The <type> parameter can be:
TEXT,STR,PICT,string,card field,bkgnd field
TEXT,STR,PICT:in these cases, the contents of the balloon is taken from a 'STR ', 'TEXT' or 'PICT' resource, stored in any stack that is in the current inheritance path. The source parameter indicates the name of the STR/TEXT/PICT resource to use.
String:in this case, the <source> parameter is taken as the text to be displayed.
Card/Bkgnd Field:in these cases, the text is taken from a field. The <source> parameter gives the name of the field, which should be on the current card.
on mouseWithin get random(3) if it is 1 then HelpBalloons show,the rect of the target,string,"hello?" else if it is 2 then HelpBalloons show,the rect of the target,STR,128 else HelpBalloons show,the rect of the target,text,"Text test" end if end mouseWithin
The value returned is a boolean which is true if Help Balloons are switched on, false if they are switched off.
The syntax is:
HelpBalloons show,<rect>,<type>,<source>
on mouseUp HelpBalloons status answer the result end mouseUp
HelpBalloons "remove"
The syntax is:
HelpBalloons "on"
on mouseUp HelpBalloons on end mouseUp
The syntax is:
HelpBalloons "off"
on mouseUp HelpBalloons off end mouseUp
The syntax is:
HelpBalloons "showing"
The command has the syntax:
HelpBalloons getfont
The font and size are returned in the result
on mouseUp HelpBalloons getfont answer the result end mouseUp
HelpBalloons setfont,<font>,<size>
It sets the default font used by the system to show any help balloon which does not contain its own style information.
Æ NB: This changes the font globally for all applications, and as such it is probably not a very good idea!
on mouseUp ask "Font?" if it is not empty then put it into font ask "Size?" if it is not empty then put it into size HelpBalloons setfont,font,size put the result end if end if end mouseUp