news
About Elegant Chaos
info
About me and my friends
people
Software from Elegant Chaos
software
Other stuff...
stuff

HelpBalloons

An XCMD which allows you to implement balloon help messages for all the buttons, fields and other elements of your Hypercard stacks.

HelpBalloons XCMD. Version 1.1, by Sam Deane. Copyright ©1994 ULTRALAB. Compiled 16:49:18, 28/04/94.


[last exit to hypercard] [externals index] [download HelpBalloons]

Description

The HelpBalloons command allows you to implement System 7's Help Balloon facility for your stacks.

It lets you display text and picts from a variety of sources in help balloons - under complete HyperTalk control.

Examples

The following scripts demonstrate some of the commonly used commands.

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

Commands

show

This command causes a balloon to be displayed, if Balloon help is present and is switched on.

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.

Example script for show

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

status

This command returns the status of the Help Balloon system in the result.

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>

Example script for status

on mouseUp
  HelpBalloons status
  answer the result
end mouseUp

remove

If there is a Help Balloon showing, this command removes it. The syntax is:

  HelpBalloons "remove"

on

These on command switches Balloon Help on, like choosing "Show Balloons" from the help menu.

The syntax is:

  HelpBalloons "on"

Example script for on

on mouseUp
  HelpBalloons on
end mouseUp

off

These off command switches Balloon Help off, like choosing "Hide Balloons" from the help menu.

The syntax is:

  HelpBalloons "off"

Example script for off

on mouseUp
  HelpBalloons off
end mouseUp

showing

This command returns a boolean value in the result. This is true if there is currently a help balloon showing.

The syntax is:

  HelpBalloons "showing"

getfont

The getfont command gets the font and size used to display standard balloon help messages.

The command has the syntax:

  HelpBalloons getfont

The font and size are returned in the result

Example script for getfont

on mouseUp
  HelpBalloons getfont
  answer the result
end mouseUp

setfont

The setfont command has the syntax:

  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!

Example script for setfont

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

[last exit to hypercard] [externals index] [download HelpBalloons]

This page was created automatically, on 25/03/1999 from version 3.0d4 of Last Exit To Hypercard.