Full-View - Windows for Pick

(C) Copyright 1985-1996 Modular Software Corporation. All rights reserved.

Version 2.0 for AP - February 14, 1996

   Goto:  Table of Contents   Index
Chapter:  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

6: WINDOWING FUNCTIONS

6.1: ACTIVATING AND DE-ACTIVATING WINDOWING

FULL-VIEW permits you to decide which applications you wish to operate within the windowing environment. Specifically, the windowing functions can be activated or de-activated by the execution of simple TCL commands. This allows you to run a mix of windowing and non-windowing applications on the same computer system and sharing the same terminals.

6.1.1: LOADING THE FULL-VIEW DRIVERS

In order to use the FULL-VIEW functions, the FULL-VIEW drivers must actually be loaded into the running Pick MONITOR. The command:

    FV-INIT
is used to load FULL-VIEW into the system MONITOR area. This command is normally executed during the system COLDSTART proceedure. You can also execute the command at other times if necessary from system maintenance functions, but this is rarely necessary.

6.1.2: UNLOADING THE FULL-VIEW DRIVERS

It is also possible to unload the FULL-VIEW drivers from a running system by executing the command:

    FV-TERM
This command is intended for system maintenance functions only. This command should only be used if the system is unstable with Windowing active and you are trying to shut the system down.

6.1.3: TURNING WINDOWING ON

In order to activate windowing, the TCL command:

    FV-INITPORT
must be executed. This command will initialize the FULL-VIEW environment for the current port.

Most FULL-VIEW functions will not operate without windowing active.

6.1.4: TURNING WINDOWING OFF

In order to de-activate windowing without logging off or to another account, use the TCL command:

    FV-TERMPORT
This command will de-activate the windowing functions of FULL-VIEW and restore stadard system operation. If you need to deactivate windowing for another port (becuase of some sort of port hang), you can execute:

    FV-TERMPORT port_no

6.2: STARTING A WINDOW

START-WINDOW

    START-WINDOW {X0,X1,Y0,Y1}
This TCL function will establish a new pane with parameters X0,X1,Y0,Y1. X0 refers to the left edge of the window active area, X1 refers to the right edge, Y0 to the top, and Y1 to the bottom. All references are relative to the upper left hand corner (0,0). The window will be created with a border, the contents of the window will be cleared, and the cursor will be positioned in the upper left hand corner of the window. This window will remain in effect until another window is established.

Executing START-WINDOW without any parameters will establish a full-screen pane.

If you attempt to create a window with parameters which are not compatible with the CRT in use (i.e. the window is too big or improperly positioned), the START-WINDOW command will exit with an error message.

START.WINDOW.SUB( )

    CALL START.WINDOW.SUB(X0,X1,Y0,Y1)
This BASIC subroutine allows a bordered window to be created by a BASIC program and operates exactly as the START-WINDOW TCL command.

If the X0 parameter is NULL (an empty string or ""), this subroutine will establish a full-screen pane.

If you attempt to create a window with parameters which are not compatible with the CRT in use (i.e., the window is too big or improperly positioned), the START.WINDOW.SUB subroutine will exit with an error message.

This function may also be coded with an optional fifth parameter as:

    CALL START.WINDOW.SUB(X0,X1,Y0,Y1,SCR)
In this case, SCR is a variable that will contain a print string that can be used to remove the created window.

6.3: STARTING A CHILD PROCESS

A child process refers to a TCL command which will level-push another TCL verb and upon that verb's completion, restore the terminal's screen to it's original contents. With the exception of restoring the screen, a child process is not different than any other TCL command. You should note however that a child process does utilize a system EXECUTE level to run.

START-CHILD

    START-CHILD command . . .
This TCL function will execute COMMAND in a full-screen pane and upon completion of this CHILD function, will restore the screen to it's original status and return to the calling PROC or to TCL.

The called command may be any valid VERB or PROC. This function utilizes the BASIC EXECUTE function and has the same limitations. These include the inability to execute a LOGTO or OFF command and then expect to return to the calling application.

START.CHILD.SUB( )

    CALL START.CHILD.SUB(command)
This BASIC subroutine will execute COMMAND in a full-screen pane and upon completion of this CHILD function, will restore the screen to it's original status and return to the calling PROC or to TCL.

The called command may be any valid VERB or PROC. This function utilizes the BASIC EXECUTE function and has the same limitations. These include the inability to execute a LOGTO or OFF command and then expect to return to the calling application.

START-WINDOW-CHILD

    START-WINDOW-CHILD X0,X1,Y0,Y1 command . . .
This TCL function will execute COMMAND in a pane with parameters X0,X1,Y0,Y1 and upon completion of this CHILD function, will restore the screen to it's original status and return to the calling PROC or to TCL. The numeric parameters will be used to create a bordered window using the START.WINDOW.SUB subroutine.

The called command may be any valid VERB or PROC. This function utilizes the BASIC EXECUTE function and has the same limitations. These include the inability to execute a LOGTO or OFF command and then expect to return to the calling application.

If the command contains the option string:

    `W
START-WINDOW-CHILD will only restore the created window and not the entire screen. This is useful when you are sure that the executed command will not alter the terminal's display outside of the created window.

START.WINDOW.CHILD.SUB( )

    CALL START.WINDOW.CHILD.SUB(X0,X1,Y0,Y1,command)
This BASIC subroutine will execute COMMAND in a pane with parameters X0,X1,Y0,Y1 and upon completion of this CHILD function, will restore the screen to it's original status and return to the calling PROC or to TCL. The numeric parameters will be used to create a bordered window using the START.WINDOW.SUB subroutine.

The called command may be any valid VERB or PROC. This function utilizes the BASIC EXECUTE function and has the same limitations. These include the inability to execute a LOGTO or OFF command and then expect to return to the calling application.

The START.WINDOW.CHILD.SUB subroutine will also accept the `W option specified in the START-WINDOW-CHILD TCL command above.

6.4: TCL SHELL FUNCTION

FULL-VIEW includes a method to execute TCL as a shell function, allowing the user the full utility of TCL while remaining in an application.

You may wish to note that this TCL shell is a simulated TCL. Because of this, several characteristics may be noted:

  1. Simulated TCL is actually a BASIC program which executes TCL commands.


  2. Simulated TCL correctly handles select lists, etc.


  3. Simulated TCL does have more overhead than real TCL because of the overhead in the system EXECUTE command.


  4. Simulated TCL has a built in TCL stacker. This stacker has commands like .L, .E, and .## to list, edit, and execute previous TCL commands. This stacker operates independently of any system TCL stacker which may be on your system. NOTE: If possible, the simulated TCL stacker will utilize the same STACK storage file as the system stacker. This allows the simulated TCL to use and add to the list of stacked commands.
TCL-SHELL

    TCL-SHELL
This TCL command will execute a TCL SHELL function which allows the user to execute any valid TCL command. The user may type the special command 'EXIT' to leave this SHELL function. The original screen's contents are not restored with this function when the function is exited.

TCL.SUB

    CALL TCL.SUB
This is a BASIC subroutine version of TCL-SHELL. The subroutine does not have a parameter list and when the TCL SHELL is exited, the screen's contents will not be restored.

6.5: HOT-KEY FUNCTIONS

FULL-VIEW provides the ability to establish one or more Hot-Keys. Hot-Keys are terminal keys, which when pressed, cause a level-push into a new function. When the new function completes, the original application resumes with complete screen restoration.

Implementing Hot-Keys within an application merely requires that the programs be compiled with the FULL-VIEW 'PC' verb. No changes to code structure or syntax are necessary in order to implement Hot-Keys.

Which Hot-Keys are active and which functions they activate are defined with either TCL commands or by external subroutine calls. This allows an application to change the available Hot-Key functions depending upon application context.

The keys specified in the Hot-Key setup functions are those generated by the FULL-VIEW terminal table for function, control, and other keys. This table is described elsewhere, but in general specification of standardized ASCII values for control, function, editing, and cursor keys. Hot-Keys are typically assigned to function keys, or to editing keys like SEND and PRINT.

SET-HOT-KEY

This command is used to set Hot-Key definitions for the current port:

    SET-HOT-KEY . . . . .
This function can specify multiple items, each separated by a semi-colon ';'. The following phrases are available:

D
Delete all hot-key definitions.
D###
Delete hot-key definition for key ### (key is specified in decimal.
###=tcl command...
Setup TCL command as being hot-key for specified key.
You could specify the following hot-key command (using PROC syntax as an example):

    HSET-HOT-KEY D ;
(Deletes old definitions.)
    H 251 = MENU MENU.SHELL O ;
(ESC key.)
    H 250 = RUN FV.BP PRINT-SCR ;
(Prt Sc key.)
    H 139 = RUN FV.BP CALC ;
(F11 key for calculator.)
    H 140 = RUN FV.BP TCL-SHELL ;
(F12 for TCL shell.)
SET.HOT.KEY.SUB( )

This BASIC subroutine allows the Hot-Key function to be set for the port from within a BASIC program without having to EXECUTE the SET-HOT-KEY TCL statement. To set the GLOBAL FUNCTION for F1 to the TCL SHELL would require the BASIC statement:

    CALL SET.HOT.KEY.SUB('129 = TCL-SHELL')

6.6: HOT-KEY SCREEN RESTORES

The Hot-Key utility is designed to automatically restore the screen display whenever the level-pushed process completes. In this mode, nearly any process can be executed as a Hot-Key function without modification. By operating in this manner, Hot-Keys are forced to restore the entire screen's contents and not just the portion of the screen that the level-pushed application overwrites. If you have an application which saves and restores it's own screen, you can supress the Hot-Key utility's automatic screen restoration function by adding a ~W after the tcl command in the hot key statement. This option is particularily useful when a Hot-Key executes a menu in which the W option is specified. The W option on the MENU command will restore the screen behind the menu when complete and the ~W option on the SET-HOT-KEY command will prevent the Hot-Key utility from restoring the screen redundantly.

6.7: FUNCTION KEY USAGE

FULL-VIEW allows applications to make use of use terminal function keys more easily. It does this in two ways:

  1. Function keys are normalized to single ASCII values regardless of the type of terminal in use. This has the effect of standardizing function key control characters to single values so that applications do not need to sense different multi-key sequences for different types of terminals.


  2. The BASIC INPUT statement's operation can be tailored to function differently whenever one of several defined keys is pressed. This allows a standard BASIC INPUT statement to be used to retrieve both data and function keys with very little overhead. When a specified function key is pressed, an automatic CR is generated which causes the INPUT statement to end early. The application program can then process the last character of the input variable to check for function key processing.
SET-FN-KEY

This function makes it easier to utilize function keys from within BASIC programs. This function causes the BASIC INPUT statement to automatically terminate whenever the user presses any of the defined function (or other) keys. To use this function execute the following TCL statement before your BASIC program executes:

    SET-FN-KEY ...
This VERB has available options which are:

D
Delete all old function key definitions.
D###
Delete function key definitions for key ### (key is specified in decimal).
###
Setup key ### as an application function key.
For example, you could enter the verb as:

    SET-FN-KEY D 129 130
This will cause a BASIC INPUT statement to terminate whenever F1 or F2 are pressed. A version of this routine is also available as a BASIC subroutine called SET.FN.KEY.SUB. The subroutine version is called as:

    CALL SET.FN.KEY.SUB('D 129 130')
For additional information on how to interface to this function, refer to the example programs in DEMO.BP in the FV.DEMO account.

6.8: PRINT FUNCTIONS

The virtual terminal characteristics of FULL-VIEW cause the system to act as a standardized terminal which is within the Pick Operating System. This virtual terminal supports most standard terminal functions, a number of non-standard terminal functions, as well as other interesting features which are described below.

6.8.1: CURSOR CONTROL

All of the standard @(X) and @(X,Y) cursor control functions are supported under FULL-VIEW for cursor positioning within any size pane. Cursor positioning will operate relative to the location of the pane's upper left hand corner.

6.8.2: SCREEN CONTROL

The standard screen manipulation functions,

will function with FULL-VIEW and will only effect the contents of the current pane.

6.8.3: VIDEO ATTRIBUTES

Video attributes may be set with @(-xxx) functions or with the ESC:'C':... sequence. The @(-xxx) functions are defined within the terminal driver.

6.8.4: COLOR ATTRIBUTES

Color attributes may be set in the same manner as monochrome video attributes.

6.8.5: LINE GRAPHICS CHARACTERS

FULL-VIEW will translate certain printed control characters into line graphics characters on those terminals which support this function. The following print functions are used to generate graphics characters:

    PRINT CHAR(128)
Horizontal line
    PRINT CHAR(129)
Vertical line
    PRINT CHAR(130)
Upper-left corner
    PRINT CHAR(131)
Upper-right corner
    PRINT CHAR(132)
Lower-left corner
    PRINT CHAR(133)
Lower-right corner
    PRINT CHAR(134)
Horizontal line with branch up
    PRINT CHAR(135)
Horizontal line with branch down
    PRINT CHAR(136)
Vertical line with branch left
    PRINT CHAR(137)
Vertical line with branch right
    PRINT CHAR(138)
Crossed lines.
These printable characters may be embedded anywhere within any print statement either from BASIC or PROC.

6.8.6: USER DEFINITIONS

FULL-VIEW provides great versatility in defining print functions. This versatility includes the ability to specify different @(-xxx) sequences for many of the control and video attribute functions. The functions listed above are the defaults which are supplied with the system. If you wish to use different @(-xxx) functions for video attributes, or graphics characters, you may specify these with the terminal definition function which is described later.

6.8.7: SPECIAL FUNCTIONS

Special virtual terminal functions which are beyond the normal scope of terminal control are available to your applications:

SETUP WINDOW PARAMETERS

There is a direct method of setting the current pane size by printing a control string. A statement in the form . . .

    PRINT ESC:'W':CHAR(X0):CHAR(X1):CHAR(Y0):CHAR(Y1):
. . . will change the active pane's size and position to the value specified by X0,X1,Y0,Y1 where X0 is the left edge coordinate, X1 is the right edge coordinate, Y0 is the top edge coordinate, and Y1 is the bottom edge coordinate.

When a new pane is established in this manner, the cursor will be positioned at the upper left hand corner of the new pane (0,0) and the contents of the new pane will not be cleared.

If the specified parameters do not fit within the current screen size, the offending parameters will be adjusted to the value of the screen's edge.

SETUP VIDEO ATTRIBUTE

There is a direct method of setting the video attribute without using all of the @(-xx) functions. This operates by using a print statement:

    PRINT ESC : 'C' : CHAR(x) :
Here 'x' is a bit map of the video attribute that you wish to set. The bits are:

The statement:

    PRINT ESC : 'C' : CHAR(0) :
may be used to clear the current attribute setting to the default value.

DON'T SCROLL OPTION (SCROLL SUPPRESS)

FULL-VIEW normally operates within a pane as if the pane were a small CRT. When the cursor gets to the bottom of the pane and a character is printed in the lower right hand corner, the panes contents will scroll. Sometimes, however, it is desirable to print in this square and prevent the screen from scrolling. This can be accomplished in the following manner.

At the beginning of the print string which is intended not to scroll, print the following sequence:

    PRINT ESC : 'N' : . . . :
This will prevent any lines which wrap in the last line of the window from causing the window to scroll and will allow printing in the lower right corner of the window.

This option actually remains in effect until the first cursor position or cursor movement command (i.e. CR, LF, or @(x,y) function ).

6.9: SCREEN QUERY FUNCTIONS

Functions are available to your applications which permit access to the status and data which is currently being displayed on the users terminal. This access is available because of the memory map of the terminal display which FULL-VIEW constantly maintains.

6.9.1: GET SCREEN

    CALL GET.SCR(SCR)
This function will return in SCR a compressed print string of the contents of the entire screen including the current window settings, the current cursor position, and the current video attribute. This function can be used in situation like:

    CALL GET.SCR(SCR)
Save the screen in SCR
    PRINT @(-1) : ' . . .
Display some screen infomation
    INPUT VAR , 10 :
Perform some additional processing
    .
    .
    .
    PRINT SCR :
Restore the previous saves screen

6.9.2: GET WINDOW

    CALL GET.WINDOW(SCR)
This routine operates in the same way as GETSCR(...) with the exception that only the current window's contents will be in the print string. This function may also be coded as:

    CALL GET.WINDOW(SCR,X0,X1,Y0,Y1)
in which case the specified window area will be retrieved.

6.9.3: GET SCREEN DATA

    CALL GET.SCR.DATA(DATA)
This routine will return the contents of the current display memory map as a dynamic array containing two attributes. Attribute one contains a linear string of characters representing the character content of the screen. Attribute two contains a linear string of characters representing the video attribute content of the screen. This function is typically used to obtain information from the screen for later use in printed output.

An example of the use of this function is best illustrated by detailing how you would use this function to format the screen to build a print job. This example assumes an 80x24 screen.

    CALL GET.SCR.DATA(DATA)
    PRINTER ON
    FOR I = 0 TO 23
            PRINT DATA[I*80+1,80]
    NEXT I
    PRINTER OFF
    PRINTER CLOSE

6.9.4: GET SCREEN PARAMETERS

    CALL GET.SCR.PARMS(PARMS)
This routine will return a dynamic array of the current screen parameters as:

    PARMS<1>  = 
CURSOR X POSITION WITHIN WINDOW
    PARMS<2>  = 
CURSOR Y POSITION WITHIN WINDOW
    PARMS<3>  = 
CURRENT VIDEO ATTRIBUTE BYTE
    PARMS<4>  = 
X0 - WINDOW LEFT EDGE
    PARMS<5>  = 
X1 - WINDOW RIGHT EDGE
    PARMS<6>  = 
Y0 - WINDOW TOP EDGE
    PARMS<7>  = 
Y1 - WINDOW BOTTOM EDGE
    PARMS<8>  = 
FULL SCREEN WIDTH
    PARMS<9>  = 
FULL SCREEN HEIGHT
    PARMS<10> = 
ORIGINAL TERMINAL TYPE LETTER
    PARMS<11> = 
EMBEDDED ATTRIBUTE TYPE

6.9.5: GET SCREEN STATUS

    CALL GET.SCR.STATUS(STR)
This function will return in STR a print string which can be used to re-position the cursor to it's current position and attribute value. This function is typically used to return the cursor and window statuses to a previous value.


   Goto:  Table of Contents   Index
Chapter:  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15