Document revision date: 19 July 1999 | |
Previous | Contents | Index |
SET (WIDGET_RESOURCE_TYPES, widget_data_type, widget_resource_type)
WIDGET_RESOURCE_TYPES
A keyword that directs DECTPU to add new DECwindows widget resource types to the list of supported resource types. If you redefine a resource type to be of another data type, DECTPU signals the warning TPU$_TYPEREDEFINED. You cannot save resources in section files. DECTPU does not verify that your third parameter specifies the name of a valid widget resource or resource type. If you misspell the third parameter, you will get an error when you try to use that resource with a widget. For the current list of supported resource types, see the GET_INFO (WIDGET, "widget_resource_types") built-in procedure.widget_data_type
A string that is the data type of the widget resource types given by the third parameter. It tells DECTPU how to process the resource types. DECTPU supports the following data types: "boolean", "callback", "char", "compound_string", "compound_string_table", "int", "short", "unsigned_short", and "unsigned_char".widget_resource_type
A series of names of widget resources or resource types that are of the data type specified by the second parameter. You can specify an array of strings or a comma-separated list of strings. If you use an array, you index the array with any valid DECTPU array indexes. The array elements contain the names of either widget resources (for example, "dialogStyle"), or of widget resource types (for example, "Int"). If you use a comma-separated list of strings, the strings are the names of the widget resources or resource types.
The SET (WIDGET_RESOURCE_TYPES) procedure specifies additional DECwindows widget resource types or resources that DECTPU should support. This built-in is valid only with DECwindows DECTPU.
The following example enables your application to use the "dialogStyle" resource of the DECwindows XmBulletinBoard widget, which is an unsigned_char data type. "dialogStyle" is the name of the resource.
SET (WIDGET_RESOURCE_TYPES, "unsigned_char", "dialogStyle") |
SET (WIDTH, {window |ALL |SCREEN}, integer)
WIDTH
A keyword that indicates that the horizontal dimension is being set.window
The window for which you want to set or change the width.ALL
A keyword that indicates that DECTPU should set the screen and all windows, visible and invisible, to the specified width.SCREEN
A keyword that indicates that DECTPU should set the screen to the specified width without altering the size of any DECTPU windows. By default, EVE resizes the windows to match the width of the screen. You cannot set the screen to be narrower than the widest DECTPU window.integer
The width of the window in columns. You can specify any integer between 1 and 255. In non-DECwindows DECTPU, a value of 80 causes DECTPU to repaint the screen and depict the text in normal-width font, if the text is not already so depicted. A value of 132 causes DECTPU to repaint the screen and depict the text in narrow font, if the text is not already so depicted. Other values do not affect the font. By default, the width of a window is the same as the physical width of the terminal when the window is created.
The SET (WIDTH) procedure sets the width of a window or the DECTPU screen. When you call SET (WIDTH), DECTPU determines the width of the widest visible window. If this width has changed, the effect of SET (WIDTH) depends on your terminal.If you are using DECTPU with a DECwindows terminal emulator, the terminal emulator is resized to match the width of the widest visible window. You can specify any width between 1 column and 255 columns.
If you are using DECTPU on a VT400-series, VT300-series, VT200-series, or VT100-series terminal, setting the width of a window causes a change only if the widest visible window is 80 or 132 columns wide. When the new width is one of these numbers, DECTPU causes the terminal to switch from 80-column mode to 132-column mode, or the reverse.
If you are using DECwindows DECTPU (that is, not in a DECterm window), changing the width of the screen does not affect the font of the characters displayed. (There are no 80-column or 132-column modes.)
If the width of the widest visible window has changed, DECTPU redisplays all windows.
By default, the width of a window is the same as the number of columns on the screen of the terminal on which you are running DECTPU. If you exceed the value set for the width of the window when entering text, DECTPU displays a diamond symbol in the rightmost column of the screen to indicate that there is text beyond the diamond symbol that is not visible on the screen. You cannot force DECTPU to use multiple lines to display a line that is longer than the width of a window.
TPU$_TOOFEW | ERROR | SET (WIDTH) requires three parameters. |
TPU$_TOOMANY | ERROR | You specified more than three parameters. |
TPU$_INVPARAM | ERROR | One or more of the specified parameters have the wrong type. |
TPU$_BADVALUE | ERROR | Arguments are out of minimum or maximum bounds. |
The following example sets the width of the main window to 132 columns and changes the font from standard to narrow:
#1 |
---|
SET (WIDTH, main_window, 132); |
The following example sets the width of the screen and all windows, visible and invisible, to 40 columns. The statement does not affect the font.
#2 |
---|
SET (WIDTH, ALL, 40); |
[[integer2 := ]] SHIFT (window, integer1)
window
The window that is shifted.integer1
The signed integer that specifies how many columns to shift the window. A positive integer causes the window to shift to the right so that you can see text that was previously beyond the right edge of the window.A negative integer causes the window to shift to the left so that you can see text that was previously beyond the left edge of the window. If the first character in the line of text is already in column 1, then using a negative integer has no effect.
If you specify 0 as the value, no shift takes place. Furthermore, 0 as the value does not cause the window to be repainted.
By default, windows are not shifted.
The SHIFT procedure, for a buffer whose lines are too long to be displayed all at once, moves the window so the unseen parts of the lines can be viewed. SHIFT can move the window right to display text past the right edge of the window, or left (for a previously shifted window). SHIFT optionally returns an integer that specifies the number of columns in the buffer lying to the left of the left edge of the shifted window.Because SHIFT commands are cumulative during an editing session, this built-in procedure optionally returns a value in integer2. This positive integer represents the absolute shift value.
The shift applies to any buffer associated with the window that you specify. For example, if you shift a window and then map another buffer to that window, you see the text of the newly mapped buffer in the shifted position. You must specify another shift to return the window to its unshifted position.
If you specify an integer value of 0, the window is not shifted left. Furthermore, when you attempt to shift left, the window is not repainted; otherwise, SHIFT causes the entire window to be repainted. If you execute the SHIFT built-in procedure within a procedure, the screen is not updated to reflect the shift until the procedure has finished executing and control has returned to the screen manager. If you want the screen to reflect changes before the entire program is executed, you can force the immediate update of a window by adding an UPDATE statement to the procedure.
TPU$_TOOFEW | ERROR | SHIFT requires two parameters. |
TPU$_TOOMANY | ERROR | You specified more than two parameters. |
TPU$_INVPARAM | ERROR | One or more of the specified parameters have the wrong type. |
The following example shifts the window user_window five columns to the right:
#1 |
---|
SHIFT (user_window, +5) |
The following example shifts the current window five columns to the left. (If the window was not previously shifted, this statement has no effect.)
#2 |
---|
SHIFT (CURRENT_WINDOW, -5) |
SHOW ( {BUFFER[S] |KEY_MAP_LIST[S] |KEY_MAP[S] |KEYWORDS |PROCEDURES |SCREEN |SUMMARY |VARIABLES |WINDOW[S] |buffer |string |window})
BUFFER[[S ]]
Displays information about all buffers available to the editor. BUFFER is a synonym for BUFFERS.KEY_MAP_LIST[[S ]]
Displays the names of all defined key map lists, their key maps, and the number of keys defined in each key map. KEY_MAP_LIST is a synonym for KEY_MAP_LISTS.KEY_MAP[[S ]]
Displays the names of all defined key maps. KEY_MAP is a synonym for KEY_MAPS.KEYWORDS
Displays the contents of the internal keyword table.PROCEDURES
Displays the names of all defined procedures.SCREEN
Displays information about the terminal.SUMMARY
Displays statistics about DECTPU, including the current version number.VARIABLES
Displays the names of all defined variables.WINDOW[[S ]]
Displays information about all windows available to the editor. WINDOW is a synonym for WINDOWS.buffer
Shows information about the buffer variable you specify.string
Shows information about the string variable you specify.window
Shows information about the window variable you specify.
The SHOW procedure displays information about DECTPU data types and the current settings of attributes that you can apply to certain data types. See also the description of the GET_INFO built-in procedure.DECTPU looks for the variable show_buffer and checks to see if it refers to a buffer. DECTPU also looks for the variable info_window and checks to see if it refers to a window. If these two items exist when you call the SHOW built-in procedure, DECTPU writes information to show_buffer and displays the information on the screen in the window called info_window.
You, or the interface you are using, must create the buffer variable show_buffer when you initialize the interface to ensure that the SHOW built-in procedure works as expected.
If you create a window called info_window, DECTPU associates show_buffer with info_window and maps this window to the screen when there is information to be displayed. You can optionally create a different window in which to display the information from show_buffer. In this case, you must associate show_buffer with the window that you create and map the window to the screen when there is information to be displayed.
Because this built-in procedure maps info_window to the screen, any interfaces layered on DECTPU should provide a mechanism for unmapping info_window and returning you to the editing position that was current before SHOW was invoked.
DECTPU always deletes the current text in the show buffer before inserting the new information.
TPU$_NOSHOWBUF | WARNING | The requested information cannot be stored because the buffer variable show_buffer does not exist. |
TPU$_TOOMANY | ERROR | SHOW accepts only one parameter. |
TPU$_INVPARAM | ERROR | One or more of the specified parameters have the wrong type. |
The following example displays on the screen a list of all the DECTPU built-in procedures and the user-written procedures that are available to your editing interface:
#1 |
---|
SHOW (PROCEDURES) |
The following example displays the names of all defined key map lists, their key maps, and the number of keys defined in each key map:
#2 |
---|
SHOW (KEY_MAP_LISTS) |
When you use the default interface, EVE, the DECTPU SHOW (KEY_MAP_LISTS) command displays information similar to the following:
Defined key map lists: TPU$KEY_MAP_LIST contains the following key maps: EVE$USER_KEYS (0 keys defined) EVE$VT200_KEYS (14 keys defined) EVE$STANDARD_KEYS (29 keys defined) Total of 1 key map list defined
SLEEP ({integer|string})
integer
The number of seconds to sleep.string
An absolute or a delta time string indicating how long to sleep. The format of an absolute time string is "dd-mmm-yyyy hh:mm:ss.cc".In the string above, values have the following meanings:
- dd is the day of the month (1-31)
- mmmm is the month (JAN, FEB, ..., DEC)
- yyyy is the year (000-9999)
- hh is the hour (0-23)
- mm is the minute (0-59)
- s is the second (0-59)
- cc is the hundreth of a second (0-99)
For the format of a delta time, see the SET (GLOBAL_SELECT_TIME) built-in procedure.
The SLEEP procedure causes DECTPU to pause for the amount of time you specify or until input is available. This built-in is useful if you want to display something for only a short period of time. In the character-cell interface, SLEEP ends immediately if input comes from the terminal before the time interval expires. In the DECwindows interface, SLEEP is not interrupted by terminal input.
TPU$_TOOFEW | ERROR | SLEEP requires one argument. |
TPU$_TOOMANY | ERROR | SLEEP accepts only one argument. |
TPU$_ARGMISMATCH | ERROR | The argument to SLEEP must be an integer or string. |
TPU$_INVTIME | ERROR | The argument to SLEEP was an invalid sleep time. |
The following example suspends DECTPU for 2 seconds:
#1 |
---|
SLEEP (2); |
The following example puts a string into the message buffer. The procedure displays the string in reverse video for a third of a second. After a third of a second, reverse video is canceled and the string is displayed as usual.
#2 |
---|
PROCEDURE user_emphasize_message (user_message) LOCAL here, start_mark, the_range; here := MARK (NONE); POSITION (END_OF (message_buffer)); COPY_TEXT (user_message); MOVE_HORIZONTAL (-CURRENT_OFFSET); start_mark := MARK (NONE); MOVE_VERTICAL (1); MOVE_HORIZONTAL (-1); the_range := CREATE_RANGE (start_mark, MARK (NONE), REVERSE); UPDATE (message_window); SLEEP ("0 00:00:00.33"); the_range := 0; UPDATE (message_window); POSITION (here); ENDPROCEDURE; |
pattern := SPAN ( {buffer |range |string} [[, {FORWARD|REVERSE} ]])
buffer
An expression that evaluates to a buffer. SPAN matches only those characters that appear in the buffer.range
An expression that evaluates to a range. SPAN matches only those characters that appear in the range.string
An expression that evaluates to a string. SPAN matches only those characters that appear in the string.FORWARD
A keyword that directs DECTPU to match characters in the forward direction. This is the default.REVERSE
A keyword that directs DECTPU to match characters as follows: first, match characters in the forward direction until DECTPU finds a character that is not a member of the set of characters in the specified buffer, range, or string. Next, return to the first character matched and start matching characters in the reverse direction until DECTPU finds a character that is not in the specified buffer, range, or string.You can specify REVERSE only if you are using SPAN in the first element of a pattern being used in a reverse search. In all other contexts, specifying REVERSE has no effect.
The behavior enabled by REVERSE allows an alternate form of reverse search. By default, a reverse search stops as soon as a successful match occurs, even if there might have been a longer successful match in the reverse direction. By specifying REVERSE, you direct DECTPU not to stop matching in either direction until it has matched as many characters as possible.
The SPAN procedure returns a pattern that matches a string of characters, each of which appears in the buffer, range, or string used as its parameter. SPAN matches as many characters as possible, stopping only if it finds a character not present in its parameter or if it reaches the end of a line. If SPAN is part of a larger pattern, SPAN does not match a character if doing so prevents the rest of the pattern from matching.SPAN does not cross line boundaries. To match a string of characters that may cross one or more line boundaries, use SPANL.
TPU$_NEEDTOASSIGN | ERROR | SPAN must appear on the right-hand side of an assignment statement. |
TPU$_TOOFEW | ERROR | SPAN requires at least one argument. |
TPU$_TOOMANY | ERROR | SPAN accepts no more than one argument. |
TPU$_ARGMISMATCH | ERROR | Argument passed to SPAN is of the wrong type. |
TPU$_CONTROLC | ERROR | You pressed Ctrl/C during the execution of SPAN. |
The following example creates a pattern that matches any word of two or more letters ending in the letter s. Given the word dogs, the SPAN part of the pattern matches dog. It does not also match the s because this would prevent the rest of the pattern from matching.
#1 |
---|
pat1 := span ("abcdefghijklmnopqrstuvwxyz") + "s"; |
The following example removes all lines that contain only the letters x, y, and z:
#2 |
---|
PROCEDURE user_remove_xyz LOCAL pat1, xyz_line; pat1 := LINE_BEGIN + SPAN ("xyz") + LINE_END; LOOP xyz_line := SEARCH_QUIETLY (pat1, FORWARD); EXITIF xyz_line = 0; POSITION (xyz_line); ERASE_LINE; ENDLOOP; ENDPROCEDURE; |
pattern := SPANL ( {buffer |range |string} [[, {FORWARD|REVERSE} ]])
buffer
An expression that evaluates to a buffer. SPANL matches only those characters that appear in the buffer.range
An expression that evaluates to a range. SPANL matches only those characters that appear in the range.string
An expression that evaluates to a string. SPANL matches only those characters that appear in the string.FORWARD
A keyword that directs DECTPU to match characters in the forward direction. This is the default.REVERSE
A keyword that directs DECTPU to match characters as follows: first, match characters in the forward direction until DECTPU finds a character that is not a member of the set of characters in the specified buffer, range, or string. Next, return to the first character matched and start matching characters in the reverse direction until DECTPU finds a character that is not in the specified buffer, range, or string.You can specify REVERSE only if you are using SPANL in the first element of a pattern being used in a reverse search. In all other contexts, specifying REVERSE has no effect.
The behavior enabled by REVERSE allows an alternate form of reverse search. By default, a reverse search stops as soon as a successful match occurs, even if there might be a longer successful match in the reverse direction. By specifying REVERSE, you direct DECTPU not to stop matching in either direction until it has matched as many characters as possible.
The SPANL procedure returns a pattern that matches a string of characters and line breaks, each of which appears in the buffer, range, or string used as its parameter. The pattern matches as many characters and line breaks as possible. SPANL is similar to SPAN; however, unlike SPAN, SPANL does not stop matching when it reaches the end of a line. It successfully matches the end of the line and continues trying to match characters on the next line. If SPANL is part of a larger pattern, it does not match a character or line boundary if doing so prevents the rest of the pattern from matching.Usually, SPANL must match at least one character. However, if the argument to SPANL contains no characters, then SPANL matches one or more line breaks.
TPU$_NEEDTOASSIGN | ERROR | SPANL must appear in the right-hand side of an assignment statement. |
TPU$_TOOFEW | ERROR | SPANL requires at least one argument. |
TPU$_TOOMANY | ERROR | SPANL accepts no more than one argument. |
TPU$_ARGMISMATCH | ERROR | Argument passed to SPANL is of the wrong type. |
TPU$_CONTROLC | ERROR | You pressed Ctrl/C during the execution of SPANL. |
The following example stores a pattern in pat1 that matches the longest sequence of blank characters, starting at the editing point and continuing until the search encounters a nonmatching character or the end of the buffer, range, or string:
#1 |
---|
pat1 := SPANL (" ") |
The following example removes all parts of a document that contain only numbers:
#2 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PROCEDURE user_remove_numbers LOCAL pat1, number_region; pat1 := SPANL ("0123456789"); POSITION (BEGINNING_OF (CURRENT_BUFFER)); LOOP number_region := SEARCH_QUIETLY (pat1, FORWARD); EXITIF number_region = 0; ERASE (number_region); POSITION (number_region); ENDLOOP; POSITION (BEGINNING_OF (CURRENT_BUFFER)); ENDPROCEDURE;
|