W_BRDR
Control window borders, titles, and their attributes
WSupported on Windows
|
USupported on Unix
|
VSupported on OpenVMS
|
NSupported in Synergy .NET
|
xcall W_BRDR(id, function, arguments[, function, arguments][, ...])
Arguments
id
A variable that contains the window ID. (n)
function
One or more of the following functions:
WB_ATTR = Alter the window border’s attributes.
WB_CHAR = Change the border’s line-drawing characters.
WB_COLOR = Set the border’s display color.
WB_DRAGOFF = Turn the drag bar off. (Windows only)
WB_DRAGON = Turn the drag bar on. (Windows only)
WB_NOCELL = Display border if it does not require a full character cell for display.
WB_OFF = Turn the border off.
WB_ON = Turn the border on.
WB_PARTIAL = Turn the border on and enable partial borders.
WB_SBOFF = Disable scroll bars. (Windows only)
WB_SBON = Enable scroll bars. (Windows only)
WB_TATTR = Alter the title’s attributes. (Unix, OpenVMS only)
WB_TCOLOR = Set the title’s display color.
WB_TITLE = Set the window’s title.
WB_TOFF = Turn off the title display.
WB_TON = Turn on the title display.
WB_TPOS = Position the title.
arguments
(optional) Any arguments used by the specified function.
Discussion
W_BRDR turns a border on or off and modifies window titles and their attributes.
On Windows, Synergy/DE supports three border options: no border, dialog frame, and caption frame. Specifying no border on Windows is the same as specifying no border on Unix or OpenVMS. The dialog frame border contains only a solid frame around the window. The caption frame border contains the system menu box and the drag bar (with space for the title, or caption). Users can drag windows with a caption frame border. Caption frame is the default border type (see WB_DRAGON below), and only caption frame windows can be moved. Keep in mind that on Windows, window borders don’t take up an entire “cell” as they do on Unix and OpenVMS; if you are depending on one window’s border to fully occlude a certain area of another window, this will not be the case. Because the border does not take up an entire cell, you may want to enable borders for Windows (but not for Unix and OpenVMS) using the WB_NOCELL function. The appearance of the window title is determined by the Windows theme; W_BRDR has no effect. |
When a window has a border, the border is drawn around the display area and is not considered part of the window’s content. If the display area changes, the border is redrawn accordingly. If the screen doesn’t have enough room for the border, the border won’t be drawn, unless you specify the WB_PARTIAL function to enable partial border displays.
If you use ^VARARGARRAY, function is the last declared argument for this routine.
WB_ATTR, attributes
WB_ATTR alters the window border’s display attributes. See Attributes for a description of the standard window attributes.
WB_ATTR is ignored on Windows.
In the example below, we first display the border in reverse video. With the ATTR_CHNG function, we add blinking, so that the attributes are then reverse video and blinking. The ATTR_LOAD function loads the named options (in this case, reverse video) and turns off any options that aren’t named (which means that it clears blinking and leaves the reverse video attribute displayed). Finally, we use ATTR_CLR to clear the reverse video.
.define MAXWINS , 15 .define WNDCHNL , 1 .include "WND:windows.def" record wndw_1 ,i4 proc open(WNDCHNL, o, "tt:") xcall w_init(0, WNDCHNL, MAXWINS) xcall w_proc(WP_CREATE, wndw_1, "window1", 8, 40) xcall w_area(wndw_1, WA_FILL, "*") xcall w_proc(WP_PLACE, wndw_1, 11, 21) call pause xcall w_brdr(wndw_1, WB_ATTR, ATTR_SET + ATTR_RVRS) call pause xcall w_brdr(wndw_1, WB_ATTR, ATTR_CHNG + ATTR_BLNK) call pause xcall w_brdr(wndw_1, WB_ATTR, ATTR_LOAD + ATTR_RVRS) call pause xcall w_brdr(wndw_1, WB_ATTR, ATTR_CLR + ATTR_RVRS) call pause xcall w_exit stop pause, xcall w_updt sleep 1 return end
WB_CHAR, horiz_line, vert_line, upper_left, upper_right, lower_left, lower_right WB_CHAR, alpha_expression
WB_CHAR changes the border’s line-drawing characters. You can specify the characters with numerals that represent ASCII characters or with the actual alpha characters. Each argument contains the character for its position: horizontal line, vertical line, upper-left corner, upper-right corner, lower-left corner, and lower-right corner, respectively.
WB_CHAR is ignored on Windows.
If a WB_CHAR argument is an alpha expression, the value itself is the line-drawing character. For example, the string “-|++++” defines horiz_line as “-”, vert_line as “|”, and all the remaining arguments as “+”. Do not separate the characters with commas.
If a WB_CHAR argument is a numeric expression, the values are interpreted as shown in the table, and must be separated by commas.
ASCII character |
|
---|---|
1 |
Horizontal line |
2 |
Vertical line |
3 |
Upper-left corner |
4 |
Top tee |
5 |
Upper-right corner |
6 |
Left tee |
7 |
Crossing |
8 |
Right tee |
9 |
Lower-left corner |
10 |
Bottom tee |
11 |
Lower-right corner |
12–31 |
System specific |
32–255 |
Corresponding ASCII character |
In the following routine, we first change the line-drawing characters to –, |, +, +, +, and +. (In other words, the corners are plus signs, the horizontal lines are dashes, and the vertical lines are vertical bars.) Next, we change the line-drawing characters back to lines and corners. The decimal values correspond to ASCII line-drawing characters, which are listed in the table above.
.define MAXWINS, 15 .define WNDCHNL, 1 .include "WND:windows.def" record wndw_1 ,i4 proc open(WNDCHNL, o, "tt:") xcall w_init(0, WNDCHNL, MAXWINS) xcall w_proc(WP_CREATE, wndw_1, "window1", 8, 40) xcall w_area(wndw_1, WA_FILL, "1234567890") xcall w_proc(WP_PLACE, wndw_1, 11, 21) call pause xcall w_brdr(wndw_1, WB_CHAR, "-|++++") call pause xcall w_brdr(wndw_1, WB_CHAR, 1,2,3,5,9,11) xcall w_exit stop pause, xcall w_updt sleep 1 return end
WB_COLOR, color
WB_COLOR sets the window’s border display color to color, which is a numeric expression that contains a palette number between 1 and 16. See Colors and the color palette for more information. WB_COLOR is ignored on Windows. For WB_COLOR support in SDK-style projects on Linux, the WNDC environment variable must be set in the environment.
WB_DRAGOFF
WB_DRAGOFF turns off the drag bar if the border is on. It changes a caption frame border to a dialog frame border. If the border is off as a result of WB_OFF, you won’t see the border style change until you do WB_ON or WB_NOCELL. This function is only available on Windows.
WB_DRAGON
WB_DRAGON turns on the drag bar if the border is on. It changes a dialog frame border to a caption frame border. This is the default window frame state, except for one-line windows, which do not have a drag bar. This function is only available on Windows.
WB_NOCELL
WB_NOCELL designates that the window should only have a border if the border does not require a full character cell for display. This means the window will have a border only in a Windows environment. You can use this function instead of WB_ON and WB_OFF. (WB_NOCELL and WB_ON/WB_OFF are mutually exclusive.)
WB_OFF
WB_OFF turns off the border, including partial borders. If the placement position was adjusted using WP_PLACE to accommodate a border, the window is shifted back to its original position. On Windows, WB_OFF changes a window border to the no border style.
WB_ON
WB_ON turns on the border (default). It does not override the WB_PARTIAL function; if you want WB_ON functionality after WB_PARTIAL has been set, you must first turn off the border with WB_OFF and then set WB_ON. On Windows, WB_ON restores the window border back to its previous type (caption or dialog frame).
WB_PARTIAL
Like WB_ON, WB_PARTIAL turns the border on for the specified window, but it also enables partial border displays if an entire border doesn’t fit on the screen. For example, if your window is 20 rows by 80 columns (on a 24 x 80 screen) and WB_PARTIAL is set, Synergy DBL still displays the top and bottom borders. Likewise, if your window is too tall for the border to be displayed on the screen, the side borders are still displayed if WB_PARTIAL is set. WB_PARTIAL is ignored on Windows.
window, WB_SBOFF[, scroll_bar]
WB_SBOFF disables scroll bars in Windows environments, which means the specified scroll bars are not displayed at all. Window is the ID of the window and scroll_bar is one of the following:
WBS_HORZ |
Horizontal scroll bar |
WBS_VERT |
Vertical scroll bar |
WBS_BOTH |
Both scroll bars (default) |
This qualifier is ignored on Unix and OpenVMS.
window, WB_SBON[, scroll_bar]
WB_SBON enables the specified scroll bars in Windows environments, where window is the ID of the window and scroll_bar is one of the following:
WBS_HORZ |
Horizontal scroll bar |
WBS_VERT |
Vertical scroll bar |
WBS_BOTH |
Both scroll bars (default) |
When scroll bars are enabled, room is left for them within the window’s frame even when the scroll bars are not displayed. Scroll bars are only displayed if the window’s display area is smaller than the window area. This qualifier is ignored on Unix and OpenVMS.
WB_ATTR, attributes
WB_TATTR alters the title’s display attributes. See Attributes for more information on standard window attributes. WB_TATTR is ignored on Windows.
In the following example, we first make sure that the border is on by using the WB_ON function, and then we set the border’s attributes to reverse video. We then specify a title for the window (the contents of the variable choice) and change the attributes of the title to bold. Finally, we position the title in the center of the top border.
xcall w_brdr(wndw_1, WB_ON, WB_ATTR, ATTR_SET + ATTR_RVRS, & WB_TITLE, choice, WB_TATTR, ATTR_CHNG + ATTR_BOLD, WB_TPOS, & WBT_TOP, WBT_CENTER)
WB_TCOLOR, color
WB_TCOLOR sets the title’s display color to color, which is a numeric expression that contains a palette number between 1 and 16. See Colors and the color palette for more information about color. WB_TCOLOR is ignored on Windows.
WB_TITLE, title
WB_TITLE sets the title for the window, where title is an alpha expression or literal that contains the window title. Note that on Windows, WB_TITLE only works with caption frame borders, and the title is always positioned at WBT_TOP and WBT_CENTER. Also, WB_TITLE updates the tab text if the window is part of a tab set. On Unix and OpenVMS, you must remove and re-add a window to change the text for its tab.
WB_TOFF
WB_TOFF turns off the title display in the border.
WB_TON
WB_TON turns on the title display in the border.
WB_TPOS, border, position
WB_TPOS indicates in which border and at what position within the border the title should be displayed. The following border options are available:
WBT_TOP |
Top border (default) |
WBT_BOTTOM |
Bottom border |
WBT_LEFT |
Left border |
WBT_RIGHT |
Right border |
The following position options are available:
numeric expression |
Actual position |
WBT_BEG |
Beginning of the border (left or top) (default) |
WBT_END |
End of the border (right or bottom) |
WBT_CENTER |
Centered in the border |
WB_TPOS is ignored on Windows.