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


ANSIButtonPane

ANSIButtonPane Class

ANSIButtonPane objects represent pushbutton widgets. Generally, they are sub-panes of other widget classes. For program examples, see See ANSIMessageBoxPane, and the methods in the ANSIButtonPane and ANSIMessageBoxPane class libraries.

Instance Variables

buttonText

The text that will appear within the button.

outputBuffer

The buffer that contains the ANSIButtonPane’s return text. Normally, the ANSIButtonPane object is drawn by a parent widget, which uses its handleInput and show methods to retrieve the button’s result.

In cases where the ANSIButtonPane object is displayed on its own and uses the ANSIButtonPane handleInput and show methods listed in the next section, this variable contains an empty string if the user presses Escape, or the button text if the user presses Return, which is returned by the show method, below.

Instance Methods

focusHighlightOnOff

Toggle the button’s highlight.

handleInput (void)

Wait for input from the receiver’s paneStream object. Withdraws the receiver if the the user types an escape (0x1b) or carraige return (0x0d) character, or the paneStream object receives these characters from another input source.

The paneStream instance variable (which is declared in ANSITerminalPane class), contains a reference to an ANSITerminalStream object. See ANSITerminalStream.

This method sets the value of the outputBuffer instance variable, as described above.

new (button1_name, button2_name, ...;)

Create one or more new ANSIButtonPane object, with border and shadow decorations, for each name given in the argument list. The buttons’ exact sizes are determined by the withText method, below.

show (Integer x_origin, Integer y_origin)

Display the button or map it to a parent widget. The x_origin and y_origin are relative to the upper left of the display if the button is displayed independently, or relative to the upper left-hand corner of a parent pane.

This method returns the outputBuffer instance variable, which contains the result of input from the user or another source, as described above.

withText (String button_text)

Set the text that will appear inside the button. The method adjusts the button dimensions to fit the text.


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