Squeak Class Documentation category index | class index  
 
BalloonMorph
  category: Morphic-Widgets
  superclass: PolygonMorph
  subclasses:

A balloon with text used for the display of explanatory information.

Balloon help is integrated into Morphic as follows:
If a Morph has the property #balloonText, then it will respond to #showBalloon by adding a text balloon to the world, and to #deleteBalloon by removing the balloon.

Moreover, if mouseOverEnabled is true (see class msg), then the Hand will arrange to cause display of the balloon after the mouse has lingered over the morph for a while, and removal of the balloon when the mouse leaves the bounds of that morph. In any case, the Hand will attempt to remove any such balloons before handling mouseDown events, or displaying other balloons.

Balloons should not be duplicated with veryDeepCopy unless their target is also duplicated at the same time.

instance methods
  accessing
  balloonOwner

  as yet unclassified
  morphicLayerNumber

  initialization
  initialize
popUpFor:hand:
popUpForHand:

  object fileIn
 

  private
  adjustedCenter
setTarget:

  stepping
  step
stepTime

  testing
  isBalloonHelp

class methods
  instance creation
  string:for:
string:for:corner:

  private
  getBestLocation:for:corner:
getTextMorph:
getVertices:

  utility
  balloonColor
balloonFont
chooseBalloonFont
setBalloonColorTo:
setBalloonFontTo:

instance methods
  accessing top  
 

balloonOwner


  as yet unclassified top  
 

morphicLayerNumber

helpful for insuring some morphs always appear in front of or behind others.
smaller numbers are in front


  initialization top  
 

initialize


 

popUpFor:hand:

Pop up the receiver as balloon help for the given hand


 

popUpForHand:

Pop up the receiver as balloon help for the given hand


  object fileIn top  

  private top  
 

adjustedCenter

This horizontal adjustment is needed because we want the interior TextMorph to be centered within the visual balloon rather than simply within the BalloonMorph's bounding box. Without this, balloon-help text would be a bit off-center


 

setTarget:


  stepping top  
 

step

Move with target.


 

stepTime

Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.


  testing top  
 

isBalloonHelp


class methods
  instance creation top  
 

string:for:


 

string:for:corner:

Make up and return a balloon for morph. Find the quadrant that
clips the text the least, using cornerName as a tie-breaker. tk 9/12/97


  private top  
 

getBestLocation:for:corner:

Try four rel locations of the balloon for greatest unclipped area. 12/99 sma


 

getTextMorph:

Construct text morph.


 

getVertices:

Construct vertices for a balloon up and to left of anchor


  utility top  
 

balloonColor


 

balloonFont


 

chooseBalloonFont

BalloonMorph chooseBalloonFont


 

setBalloonColorTo:


 

setBalloonFontTo: