Next: , Previous: , Up: Classes   [Index]


ANSILabelPane

ANSILabelPane Class

The ANSILabelPane class draws text labels on a terminal, with or without border and shadow decorations, and with the graphics attributes provided by ANSITerminalPane class. See ANSITerminalPane.

The default is to draw a single-line or multi-line label in a pane with a border and drop shadow. When drawing multi-line labels, it is necessary to give the pane’s dimensions to the appendLine method, below.

To draw a single-line label in reverse video, without any decorations and large enough to contain only the text, use a routine like the following.


  ANSILabelPane new labelBox;

  labelBox borderLess = TRUE;   /* The decorations are specified with */
  labelBox border = FALSE;      /* instance variables.                */
  labelBox shadow = FALSE;
  labelBox reverseOnOff;        /* Defined in ANSITerminalPane class. */

  labelBox appendLine "LabelBox Text", 20, 0;

Note that when creating pane buffers, Ctalk numbers the lines from zero, so it is safe to specify a pane’s height as ‘0’.

When drawing a label alone, pressing Escape or Enter withdraws the label from the display.

Instance Variables

borderLess

Specify that the label not contain extra space around the edges for a border.

text

nA List containing the label text, one item per line of text.

viewHeight

An Integer that contains the height of the label’s viewable area in character rows.

viewWidth

An Integer that contains the width of the label’s viewable area in character columns.

Instance Methods

appendLine (String text)
appendLine (String text, Integer width, Integer height)

Add a line of text to the label’s contents. If given with a width and height, specify the size of the label. Otherwise, the label is drawn large enough to display the contents.

If the label contains multiple lines of text, then the dimensions given (or calculated) for the last line determine the size of the label.

cleanup (void)

Delete the buffers associated with the pane object.

display (Integer x, Integer y)

Display the pane at x,y on the display or parent pane. Unlike show, below, does not wait for user input.

handleInput (void)

Process input for the pane. This method is normally called by the Show method, below. When the pane is displayed by itself, pressing Escape or Enter returns from the method, and the Show method withdraws the pane from the display.

new (label1, label2, label3,...;)

Create new ANSILabelPane objects for each member of the argument list. The arguments specify the names of the new object.

refresh (void)

Draw the pane’s contents on the terminal.

show (Integer x, Integer y)

Display the pane at the position x, y on the terminal. This method also calls the handleInput method, above, and waits for the user’s input before returning.

sizePane (Integer width, Integer height)

Set the size of the pane object and its buffers. This method is normally called by the appendLine method, above.


Next: , Previous: , Up: Classes   [Index]