Squeak Class Documentation category index | class index  
 
DisplayScanner
  category: Graphics-Text
  superclass: CharacterScanner
  subclasses:

My instances are used to scan text and display it on the screen or in a hidden form.

instance methods
  private
  doesDisplaying
initializeFromParagraph:clippedBy:
setDestForm:
setFont
setPort:
text:textStyle:foreground:background:fillBlt:ignoreColorChanges:
textColor:

  quick print
  drawString:at:
lineHeight
quickPrintOn:box:font:color:
stringWidth:

  scanning
  displayLine:offset:leftInRun:
displayLines:in:clippedBy:
placeEmbeddedObject:

  stop conditions
  characterNotInFont
cr
crossedX
endOfRun
paddedSpace
plainTab
quickPrintNebraska:bitBlt:box:font:color:ignoreColorChanges:
setStopConditions
setYFor:
tab

class methods
  examples
  example

  queries
  defaultFont
quickPrintOn:
quickPrintOn:box:
quickPrintOn:box:font:
quickPrintOn:box:font:color:

instance methods
  private top  
 

doesDisplaying


 

initializeFromParagraph:clippedBy:


 

setDestForm:


 

setFont

Set the font and other emphasis.


 

setPort:

Install the BitBlt to use


 

text:textStyle:foreground:background:fillBlt:ignoreColorChanges:


 

textColor:

Overridden in DisplayScanner


  quick print top  
 

drawString:at:

Draw the given string.


 

lineHeight

Answer the height of the font used by QuickPrint.


 

quickPrintOn:box:font:color:

Initialize myself.


 

stringWidth:

Answer the width of the given string.


  scanning top  
 

displayLine:offset:leftInRun:

The call on the primitive (scanCharactersFrom:to:in:rightX:) will be interrupted according to an array of stop conditions passed to the scanner at which time the code to handle the stop condition is run and the call on the primitive continued until a stop condition returns true (which means the line has terminated). leftInRun is the # of characters left to scan in the current run; when 0, it is time to call setStopConditions.


 

displayLines:in:clippedBy:

The central display routine. The call on the primitive
(scanCharactersFrom:to:in:rightX:) will be interrupted according to an
array of stop conditions passed to the scanner at which time the code to
handle the stop condition is run and the call on the primitive continued
until a stop condition returns true (which means the line has
terminated).


 

placeEmbeddedObject:

Place the anchoredMorph or return false if it cannot be placed.
In any event, advance destX by its width.


  stop conditions top  
 

characterNotInFont

See the note in CharacterScanner>>characterNotInFont.
All fonts have an illegal character to be used when a character is not
within the font's legal range. When characters out of ranged are
encountered in scanning text, then this special character indicates the
appropriate behavior. The character is usually treated as a unary
message understood by a subclass of CharacterScanner.


 

cr

When a carriage return is encountered, simply increment the pointer
into the paragraph.


 

crossedX

This condition will sometimes be reached 'legally' during display, when,
for instance the space that caused the line to wrap actually extends over
the right boundary. This character is allowed to display, even though it
is technically outside or straddling the clipping ectangle since it is in
the normal case not visible and is in any case appropriately clipped by
the scanner.


 

endOfRun

The end of a run in the display case either means that there is actually
a change in the style (run code) to be associated with the string or the
end of this line has been reached.


 

paddedSpace

Each space is a stop condition when the alignment is right justified.
Padding must be added to the base width of the space according to
which space in the line this space is and according to the amount of
space that remained at the end of the line when it was composed.


 

plainTab

This is the basic method of adjusting destX for a tab.


 

quickPrintNebraska:bitBlt:box:font:color:ignoreColorChanges:

Initialize myself.


 

setStopConditions

Set the font and the stop conditions for the current run.


 

setYFor:


 

tab


class methods
  examples top  
 

example

This will quickly print all the numbers from 1 to 100 on the display,
and then answer the default width and height of the string 'hello world'.


  queries top  
 

defaultFont


 

quickPrintOn:

Create an instance to print on the given form in the given rectangle.


 

quickPrintOn:box:

Create an instance to print on the given form in the given rectangle.


 

quickPrintOn:box:font:

Create an instance to print on the given form in the given rectangle.


 

quickPrintOn:box:font:color:

Create an instance to print on the given form in the given rectangle.