PtTerminal

PtTerminal — A window that functions like a terminal.

Synopsis

class PtTerminal PtContainer
{
    term_color_table;     // color array  (Pt_ARG_TERM_COLOR_TABLE)    
    term_cols;            // unsigned short  (Pt_ARG_TERM_COLS)    
    term_console;         // console string  (Pt_ARG_TERM_CONSOLE)    
    term_cur_col;         // short  (Pt_ARG_TERM_CUR_COL)    
    term_cur_pos;         // PhPoint  (Pt_ARG_TERM_CUR_POS)    
    term_cur_row;         // short  (Pt_ARG_TERM_CUR_ROW)    
    term_cursor_flags;    // flag  (Pt_ARG_TERM_CURSOR_FLAGS)    
    term_draw_modes;      // unsigned char  (Pt_ARG_TERM_DRAW_MODES)    
    term_font;            // string  (Pt_ARG_TERM_FONT)    
    term_font_index;      // short  (Pt_ARG_TERM_FONT_INDEX)    
    term_font_list;       // string array  (Pt_ARG_TERM_FONT_LIST)    
    term_font_size;       // PhDim  (Pt_ARG_TERM_FONT_SIZE)    
    term_margins;         // PhRect  (Pt_ARG_TERM_MARGINS)    
    term_maxcols;         // short  (Pt_ARG_TERM_MAXCOLS)    
    term_maxrows;         // short  (Pt_ARG_TERM_MAXROWS)    
    term_maxsize;         // PhPoint  (Pt_ARG_TERM_MAXSIZE)    
    term_mincols;         // short  (Pt_ARG_TERM_MINCOLS)    
    term_minrows;         // short  (Pt_ARG_TERM_MINROWS)    
    term_minsize;         // PhPoint  (Pt_ARG_TERM_MINSIZE)    
    term_options;         // flag  (Pt_ARG_TERM_OPTIONS)    
    term_optmask;         // flag  (Pt_ARG_TERM_OPTMASK)    
    term_protocol;        // short  (Pt_ARG_TERM_PROTOCOL)    
    term_resize_fl;       // flag  (Pt_ARG_TERM_RESIZE_FL)    
    term_resize_str;      // string  (Pt_ARG_TERM_RESIZE_STR)    
    term_rows;            // unsigned short  (Pt_ARG_TERM_ROWS)    
    term_scrlbk_count;    // unsigned short  (Pt_ARG_TERM_SCRLBK_COUNT)    
    term_scrlbk_limit;    // short  (Pt_ARG_TERM_SCRLBK_LIMIT)    
    term_scrlbk_pos;      // short  (Pt_ARG_TERM_SCRLBK_POS)    
    term_scroll;          // unsigned short  (Pt_ARG_TERM_SCROLL)    
    term_size;            // PhPoint  (Pt_ARG_TERM_SIZE)    
    term_visual_bell;     // short  (Pt_ARG_TERM_VISUAL_BELL)    
}
		

Base Classes

PtWidget <-- PtBasic <-- PtContainer <-- PtTerminal

Derived Classes

PtTty

Description

This widget is a terminal window that can be accessed within your application.

[Note]

For detailed information, please refer to PtTerminal in the Photon documentation.

Instance Variables

term_color_table

An array of colors used by the terminal. Default is the 16 standard CGA colors.

term_cols

A number specifying the number of columns of characters displayed on the terminal. Default is 80.

term_console

Provides for console emulation. Details not yet documented.

term_cur_col

A number specifying the cursor's column position.

term_cur_pos

A number specifying the cursor's row and column position.

term_cur_row

A number specifying the cursor's row position.

term_cursor_flags

This instance variable controls various cursor characteristics, and may be a combination of zero or more of the following flags:

ConstantDescription
Pt_TERM_CURSOR_NEVERBlock cursor blinking.
Pt_TERM_CURSOR_ON_FOCUSEnable cursor blinking when the widget has focus.
Pt_TERM_CURSOR_ALWAYSEnable cursor blinking always.
Pt_TERM_CURSOR_TIMERActivate the cursor timer, whether needed or not.
Pt_TERM_CURSOR_NOSPEEDCHKKeeps the cursor blinking even if the Photon connection is slow.

term_draw_modes

This instance variable controls blitting and redrawing of the terminal, and may be a combination of zero or more of the following flags:

ConstantDescription
Pt_TERM_SCROLL_NOBLITAlways redraw--don't blit.
Pt_TERM_SCROLL_NOHWCHKDon't check for hardware support before attempting to blit.
Pt_TERM_SCROLL_RFSHRefresh the screen upon scrolling, even if PtBlit() isn't called.
Pt_TERM_SCROLL_NOVISCHKAssume widget is totally visible--not clipped or obscured.
Pt_TERM_SCROLL_NOSPEEDCHKDon't check bandwidth.

term_font

A string specifying the font used by the terminal. Default is "pcterm14". Only fixed-width fonts are accepted.

term_font_index

An index number into the term_font_list of the font currently in use. The default, -1, is used if a requested font is not on the list.

term_font_list

An array of strings, each of which is the name of a font.

term_font_size

A read-only number indicating the size of the font.

term_margins

A PhRect class whose lower right and upper left point coordinate values specify the number of pixels in the lower, right, upper, and left margins.

term_maxcols

A number specifying the maximum number of columns allowed for the terminal. Default is 1000.

term_maxrows

A number specifying the maximum number of rows allowed for the terminal. Default is 1000.

term_maxsize

A PhPoint whose x and y coordinate values specify the maximum number of columns and rows allowed for the terminal. Default is:

{PhPoint (x . 1000) (y . 1000)} 
term_mincols

A number specifying the minimum number of columns allowed for the terminal. Default is 1.

term_minrows

A number specifying the minimum number of rows allowed for the terminal. Default is 1.

term_minsize

A PhPoint whose x and y coordinate values specify the minimum number of columns and rows allowed for the terminal. Default is:

{PhPoint (x . 1) (y . 1)}
term_options

Provides for various terminal options. Details not yet documented.

term_optmask

A mask for term_options. Details not yet documented.

term_protocol

A number specifying the protocol. 0 specifies QNX 4, 1 (the default) specifies ANSI.

term_resize_fl

This instance variable controls resizing of the terminal, and may be a combination of zero or more of the following flags:

ConstantDescription
Pt_TERM_ANCHOR_PARENT_WIDTHIf the terminal's right edge is anchored to the parent right edge, the parent width is resized.
Pt_TERM_ANCHOR_PARENT_HEIGHTIf the terminal's bottom is anchored to the parent bottom, the parent height is resized.
Pt_TERM_ANCHOR_WINDOWS_ONLYThe parent is not resized unless it is a window.
Pt_TERM_OPFONTCan use escape sequences to set the font.
Pt_TERM_KBFONTCan use the keyboard to set the font.
Pt_TERM_KBFORCEThe widget size or dim stays constant when font sizes are changed with the keyboard.

term_resize_str

A string specifying resize parameters. Details not yet documented.

term_rows

A number specifying the number of rows displayed on the terminal. Default is 25.

term_scrlbk_count

A number indicating the current number of lines in the scrollback buffer.

term_scrlbk_limit

A number specifying the maximum number of lines that can be saved in the scrollback buffer.

term_scrlbk_pos

A number specifying the current position in the scrollback buffer. Any output resets this number to the default, 0.

term_scroll

A number specifying a value used to optimize scrolling. Details are not yet documented.

term_size

A PhPoint specifying the number of rows and columns that make up the screen size. Default is:

{PhPoint (x . 25) (y . 80)}
term_visual_bell

A number of milliseconds that the screen will flash when the ASCII BEL character (Ctrl-G) is pressed.

Callbacks

The following callbacks are associated with this widget:

CallbackDescription
Pt_CB_TERM_INPUTThis callback is generated when mouse or keyboard input is received.
Pt_CB_TERM_FONTThis callback is generated when the font changes.
Pt_CB_TERM_RESIZEThis callback is generated when the terminal is going to change size (rows/columns).
Pt_CB_TERM_RESIZEDThis callback is generated when the terminal size has changed.
Pt_CB_TERM_OPTIONSThis callback is generated when the term_options resource value changes.
Pt_CB_TERM_APPApplication
Pt_CB_TERM_SCRLBKThis callback is generated when the term_scrlbk_pos changes.

Associated Classes

PtCallbackInfo, PtTerminalFontChange, PtTerminalInput, PtTerminalOptionChange, PtTerminalScrlbkCb, PtTerminalSizeChange

Convenience Functions

Arguments

widgetPtTerminal
data 
length 

Function

This function is an extension of the QNX Photon function. You can refer to the PtTerminal function documentation in QNX Helpviewer for more information about it.

PtTerminalPut (widget, data, length?) -- outputs characters to the terminal widget. If an error occurs, the errno is set.

Returns 0 on completion, or -1 for error.