V+ Language Reference Guide, v17.x


FSET program instruction

Syntax

FSET (logical_unit) attribute_list

Function

Set or modify attributes of a graphics window, serial line, or network devicerelated to AdeptNet.

Usage Considerations

If a window has been referenced, it must have been opened already with an FOPEN instruction. If a serial line is referenced, it must have been attached already with an ATTACH instruction.

The use of this instruction withNFS or TCPnetwork devices applies only to systemsfitted with the AdeptNet option andwith the appropriate license(s).

As with all V+ I/O instructions, the IOSTAT real-valued function should be used after each FSET instruction to determine the success of the FSET request.

Parameters

logical_unit Real value, variable, or expression (interpreted as an integer) that defines the logical unit number of the window to be accessed. (See the ATTACH instruction for a description of unit numbers.)
attribute_list List of string constants, variables, and expressions; real values, variables, and expressions; and format specifiers used to define the characteristics of the window. See the description of the FOPEN instruction for detailed information on this parameter.

Details

Using FSET With Windows

This instruction sets attributes for a window that already exists and is already open for access.

NOTE: No interlocks exist to prevent multiple program tasks from changing the attributes of a window.

The argument list for this instruction has exactly the same format as that for the FOPEN instruction, except that no window name is included for this instruction. Refer to the description of the FOPEN instruction for information on how window attributes are specified.

The window attributes described below can be specified with either the FSET or FOPEN instructions (unless noted otherwise). For some attributes, after the attribute has been specified, its effect may be modified later in one of the following ways:

The following information is provided for each attribute described in the table FSET Graphics Window Attributes:

FSET Graphics Window Attributes

Attribute:

/ABS_POSITION

Explanation:

Position the window at an absolute location on the screen rather than at a location relative to the parent window.

Arguments:

The X and Y offsets from the upper left corner of the monitor.

Default:

None

Attribute:

/BORDER

Explanation:

Enable a border around all or part of the window. The border is a line (one pixel wide) inside the window boundary, and it will obscure anything in that area. The border is always drawn with color 1 (black).

Arguments:

One or more of the following keywords.

  • ALL = Display all borders
  • NONE = Display no borders
  • TOP = Display top border
  • NOTOP = Suppress top border
  • BOTTOM = Display bottom border
  • NOBOTTOM = Suppress bottom border
  • LEFT = Display left border
  • NOLEFT = Suppress left border
  • RIGHT = Display right border
  • NORIGHT = Suppress right border

Default:

/BORDER ALL

Attribute:

/CURSOR

Explanation:

Set the mouse cursor to a loaded icon.

Arguments:

The index of the icon element to use, followed by the name of the icon (in single quotes)

Default:

None

Attribute:

/DISPLAY and /NODISPLAY

Explanation:

Display the window. Top-level windows that are not displayed may be displayed by selecting their names from the Adept pull-down menu at the top of the screen.
Arguments: None

Default:

/DISPLAY

Attribute:

/EVENT

Explanation:

Enables or disables event processing for the window. If you want to receive events, you must explicitly use this attribute with FSET or FOPEN each time you open a window. The details of event processing, and descriptions of the events that can be specified with this keyword, are described with the GETEVENT instruction. If the window is opened for write-only access (see the /WRITEONLY attribute), this keyword causes the error File already opened.

Arguments:

One or more keywords (see GETEVENT)

Default:

/EVENT NONE

Attribute:

/FONT

Explanation:

Selects a character font to be used for all text output in the window, except for output from the GTYPE instruction. The new font takes effect immediately, with the following effect on the placement of the next character output to the window: (1) The new character cell's left edge is positioned at the same pixel column as before the font change. (2) Its baseline remains at the same pixel row. (3) If the top of the character cell extends above the text top margin, the character position is bumped down so that no part of the cell is outside the text margins. (4) A similar rule applies if the right edge of the character cell extends beyond the text right margin. Font number 1 is the standard font-it has character cells 8 pixels wide and 15 pixels high; there are 3 pixels below the baseline; and uppercase letters are 9 pixels high.

Arguments:

Font number (the value must be greater than or equal to one)

Default:

/FONT 1

Attribute:

/FONT_HDR

Explanation:

This attribute is ignored by the AdeptWindows PC interface.

Specify the font number to use for the title, menu bars, and pull-down menus of the window. (Changes the title bar immediately, changes the menu bars at the next FSET /MENU... instruction.)

Arguments:

Font number

Default:

/FONT 1

Attribute:

/H_ARROWINC

Explanation: Sets the change in the position of the scroll handle in the horizontal scroll bar that is caused by clicking on the arrow buttons in the horizontal scroll bar. (This keyword is valid only when the event GRAB_H_SCROLL is enabled [see the GETEVENT instruction].)
Arguments: Number of units (see /H_RANGE) to move the handle for each click on an arrow button (the value must be greater than or equal to zero)
Default: Pixel width of the current font cell
Attribute: /H_HANDLE
Explanation: Sets the displayed position of the scroll handle in the horizontal scroll bar. (This keyword is valid only when the event GRAB_H_SCROLL is enabled [see GETEVENT].)
Arguments: Relative position along bar (note that this is not a pixel count; 0 = leftmost end; rightmost end may be set with /H_RANGE)
Default: Current scroll position
Attribute:

/H_RANGE

Explanation: Sets the value of the rightmost position of the scroll handle in the horizontal scroll bar. (This keyword is valid only when the event GRAB_H_SCROLL is enabled [see GETEVENT].)
Arguments: Value associated with the rightmost position of the scroll handle (value must be greater than or equal to zero; if n handle positions are desired, use the value n-1)
Default: Total number of pixels that the window can be scrolled (not the width of the window)
Attribute:

/H_SCROLL

Explanation: Sets the horizontal scroll position of the displayed contents of the window. (This keyword is ignored if it is specified with FOPEN and the window already exists.)
Arguments: Horizontal offset (in pixels) in the bitmap to the first column to display (the value must be greater than or equal to zero)
Default: /H_SCROLL 0
Attribute: /IGNORE
Explanation: Specifies pull-down menu items that cannot be selected. These items are dimmed in the pull-down menu display. This keyword must be specified in the same FSET instruction as the /PULLDOWN keyword.
Arguments: List of numbers in the range 1 to 30, which correspond to rows in the pull-down menu. Numbers greater than the number of pull-down items are ignored.
Default: No pull-down items are ignored
Attribute: /LUT
Explanation:

This attribute is ignored by the AdeptWindows PC interface.

Sets the red, green, and blue (RGB) values of a color. The specified color is actually altered for the entire graphics system. Thus, this keyword must be used with care. Note, for example, that changing color values may cause all the color descriptions in this manual to become invalid.

Arguments: The color to be changed (in the range 0 to 15), followed by the red, green, and blue values for the color (each in the range 0 to 255). A value of -1 may be specified for the red, green, or blue value to return that value to its default. For instance, specifying /LUT 15 127 127 127 changes the default white (color #15) in the system to a gray, and specifying /LUT 15 -1 -1 -1 restores the system to its default color.
Default: System default colors (see GCOLOR)
Attribute:

/MARGINS

Explanation: Sets the text margins for the window. This keyword also sets the text cursor position to the top left corner of the text window defined by the new margins. The text scrolling window is reset to its maximum size.
Arguments: Coordinates of the left, top, right, and bottom edges of the text window (if a value is negative, the corresponding margin is not modified)
Default:
  • X coordinate of left margin = 8
  • Y coordinate of top margin = 8
  • X coordinate of right margin = (right_edge_of_window - 8)
  • Y coordinate of bottom margin = (left_edge_of_window - 8)
Attribute:

/MENU

Explanation: Specifies up to 20 items to appear in the menu bar of the window. Each menu string is displayed in a box in the menu bar, left to right in the order specified. A space is added to each side of each string. If the strings are too long, the excess falls off the end of the menu bar without any error indication. The strings are written in the current font defined for the menu bar. (This keyword is ignored if the window does not have a menu bar.)
Arguments: List of up to 20 strings, each one enclosed in single quotes. Each string delimited by single-quote characters must be separated from the next string by at least one space. The correct way to clear the menu bar is to specify no strings, not a null string (that is, with /MENU, not with /MENU ' ').
Default: /MENU (no items)
Attribute:

/POINTER

Explanation: Specifies the point of reference for position information obtained from the mouse cursor. This keyword takes effect with the next event that occurs-it does not change any events that have already occurred but are waiting to be read.
Arguments:
  • DISPLAY = Return pointer device positions relative to the upper left-hand corner of the window region displayed on the screen.
  • SCREEN = Return pointer device positions relative to the upper left-hand corner of the entire screen.
  • WINDOW = Return pointer device positions relative to the upper left-hand corner of the allocated window, even if the corner is scrolled out of the displayed region.
Default: /POINTER WINDOW
Attribute:

/POSITION

Explanation: Sets the displayed position of the window relative to its parent. The arguments define the position of this window's upper left-hand corner relative to the upper left-hand corner of the parent's allocated window. If this is a top-level window, the position is relative to the upper left-hand corner of the screen. (This keyword may not be specified for control-bar windows.) This keyword is ignored if it is specified with FOPEN and the window already exists. If this keyword is used with FSET, the value specified overrides any mouse drag that may have been done by you. This keyword may also specify the position of the reference point of an icon relative to the top left corner of the icon (see the /ICON keyword for FOPEN).
Arguments: X position (in pixels) relative to parent (always rounded up to be an even number)
Y position (in pixels) relative to parent
Default: /POSITION 0 0
Attribute: /PULLDOWN
Explanation:

Outputs text into a pull-down window, and displays the pull-down window under the specified menu-bar item if that item is currently selected (highlighted). (This keyword may not be specified with FOPEN.) All the strings specified are displayed, left justified, stacked vertically, in a window the width of the longest string (plus a space on each side of the string).

For VGB-equipped systems, with the standard font, the pull-down window may have a maximum area equivalent to 25 lines of text, 25 characters wide. There can be a maximum of 30 lines of text. If there are more than 25 lines, the maximum pull-down will be less than 25 characters wide; conversely, if there are fewer than 25 lines, the pull-down can be more than 25 characters wide. Each line of text will be truncated on the right if necessary.

For systems using the AdeptWindows PC interface, the limit is determined by the FSET attribute list-the maximum length is 512 characters.

See the /IGNORE keyword for information on how to disable pull-down items. Only one pull-down window can be present in the entire system at any one time.

Arguments:
Number of the menu-bar item with which this pull-down list is associated (1 [leftmost item] to N [rightmost item]) followed by a list of strings (each in single quotes) separated by spaces
Default: No pull-down menu specified
Attribute:

/SELECT

Explanation: Specifies that a window is selected for receiving input. The effect of this keyword is equivalent to clicking the mouse on the window.
Arguments: None
Default: The window is not selected
Attribute:

/SHOW

Explanation:

This attribute is ignored by the AdeptWindows PC interface.

Forces a window and all its ancestors to be displayed. (This keyword differs from /DISPLAY-that keyword does not display a window if any one of its ancestors is not displayed.)

Arguments: None
Default: None
Attribute: /SIZE
Explanation:

Sets the size of the window in the display. The size specified overrides any mouse drag that may have been done by you. This keyword may not be specified for control-bar windows. (This keyword is ignored if it is specified with FOPEN and the window already exists.)

The X value is always rounded up to be an even number. For all windows, X and Y values less than 8 are set to 8. The values of X and Y are clipped to the full size of the window as required.

This keyword may also specify the size of an icon or font (see the /ICON or /DEFFONT keyword for the FOPEN instruction).

Arguments:
  • X size (in pixels)
  • Y size (in pixels)
Default: Display the whole window (see /MAXSIZE described in the FOPEN instruction)
Attribute: /SPECIAL
Explanation:

Except for /SPECIAL NOSELECTABLE, this attribute is ignored by the AdeptWindows PC interface.

Sets special attributes for the window.

Arguments:

One or more of the following keywords.

  • DESELECT = Allow deselection
  • NODESELECT = Don't allow deselection
  • POSITION = Allow moving by dragging title bar
  • NOPOSITION = Don't allow dragging of title bar
  • SELECTABLE = Allow window to be selected from pull-down menu under Adept icon
  • NOSELECTABLE = Don't allow window to be selected from pull-down menu under Adept icon. (Window name is dimmed in pull-down menu.)
  • SIZE = Allow resize with sizing icon
  • NOSIZE = Don't allow resize with sizing icon
Default: /SPECIAL DESELECT POSITION SELECTABLE SIZE
Attribute: /STACK

Explanation:

Sets the position of the window in its window stack, which determines the layering of the windows in the display. This keyword may not be specified for control-bar windows. No child of a window can be stacked below that window's control bars.
Arguments:

Code value for desired position:

  • 1 Move to top of parent's stack
  • -1 Move to bottom of parent's stack
Default: /STACK 1
Attribute: /TERMINAL

Explanation:

Sets characteristics of the terminal emulator used to output text to the window.
Arguments:

One or more of the following keywords.

  • CURSOR = Display the text cursor
  • NOCURSOR = Do not display text cursor
  • OVERSTRIKE = Force designated overstrike characters to overstrike the previous character
  • NOOVERSTRIKE = Defeat overstriking
  • WRAP = Wrap lines of text that are too long
  • NOWRAP = Truncate long lines of text
Default: /TERMINAL CURSOR OVERSTRIKE WRAP
Attribute: /TITLE
Explanation: Set the window title, which is the text that is displayed in the title bar. The title has no other meaning to the V+ system.
Arguments: String enclosed in single quotes. The string will be truncated to 40 characters.
Default: Same as the window name
Attribute: /UPDATE and /NOUPDATE
Explanation:
In normal operation, the screen display is updated every time new graphics appear in any displayed window. The /NOUPDATE keyword stops this process for the window currently open, thereby hiding all new graphics from the screen display until normal operation resumes. The /UPDATE keyword will force the screen display to be updated and normal operation to resume. (This keyword may not be specified with the FOPEN instruction.)
Arguments:
None

Default:

/UPDATE

Attribute:

/V_ARROWINC

Explanation:

Sets the change in the position of the scroll handle in the vertical scroll bar that will be caused by clicking on the arrow buttons in the vertical scroll bar. (This keyword is valid only when the event GRAB_V_SCROLL is enabled [see the GETEVENT instruction].)

Arguments:

Number of units (see V_RANGE) to move the handle for each click on an arrow button (the value must be greater than or equal to zero)

Default:

Pixel height of the current font cell

Attribute:

/V_HANDLE

Explanation:

Sets the displayed position of the scroll handle in the vertical scroll bar. (This keyword is valid only when the event GRAB_V_SCROLL is enabled [see GETEVENT].)

Arguments:

Relative position along bar (note that this is not a pixel count; 0 = topmost end; bottommost end may be set with /V_RANGE)

Default:

Current scroll position

Attribute:

/V_RANGE

Explanation:

Sets the value of the bottommost position of the scroll handle in the vertical scroll bar. (This keyword is valid only when the event GRAB_V_SCROLL event is enabled [see GETEVENT].)

Arguments:

Value associated with bottommost position of the scroll handle (the value must be greater than or equal to zero; if n handle positions are desired, use the value n-1)

Default:

Total number of pixels that the window can be scrolled (not the height of the window)

Attribute:

/V_SCROLL

Explanation:

Sets the vertical scroll position of the displayed contents of the window. (This keyword is ignored if it is specified with FOPEN and the window already exists.)

Arguments:

Vertical offset (in pixels) in the bitmap to the first row to display (the value must be greater than or equal to zero)

Default:

/V_SCROLL 0

Using FSET With Serial Lines

The following specifications can be used as arguments to directly ATTACH a serial line:

LOCAL.SERIAL:n
Local serial line n on the local CPU. For Adept CPU boards, n = 1, 2, 3, or 4.

SERIAL:n Global serial line n on the Adept SIO board. For Adept SIO board, n = 1, 2, 3, or 4.

As a convenience, the following synonyms may be used:

KERMIT The serial line currently configured for Kermit protocol.

MONITOR The serial line currently configured for use as the monitor terminal.

The keywords listed in the following table may appear in the keyword list string.

FSET Serial-Line Attributes
Attribute Argument Description
/PARITY NONE No parity generation
EVEN Use even parity
ODD Use odd parity
/STOP_BITS 1 or 2 Use 1 or 2 stop bits per byte
/BYTE_LENGTH 7 or 8 Use 7 or 8 bits per byte
/FLOW NONE No flow control
XON_XOFF Detect and generate XON/XOFF (turn off modem)
MODEM Use modem control RTS/CTS (turn off XON_XOFF).
Available only for LOCAL.SERIAL 2 and 3, and SERIAL 1, 2, and 3.
/DTR OFF Turn off the DTR modem signal.
Available only for LOCAL.SERIAL 2 and 3, and SERIAL 1, 2, and 3.
ON Turn on the DTR modem signal.
Available only for LOCAL.SERIAL 2 and 3, and SERIAL 1, 2, and 3.
/MULTIDROP OFF Do not use multidrop mode
ON Use multidrop mode (Valid only for LOCAL.SERIAL:1 on Adept CPUs)
/FLUSH OFF Disable recognition of CTRL+O for flushing output
ON Enable recognition of CTRL+O for flushing output
/SPEED 110, 300, 600, 1200, 2400, 4800, 7200, 9600, 19200, 38400 Select the indicated baud rate. For the Adept SIO board, a baud rate of 19200 is incompatible with a baud rate of 7200 or 38400 on a pair-wise basis. The pairs are: SERIAL:1 and SERIAL:4 SERIAL:2 and SERIAL:3

The drivers for KERMIT, DDCMP, and NETWORK do not support all the modes indicated by the keywords; they ignore those that are not supported.

Using FSET WithNFS andTCP

The followingAdeptNetdevices may be referenced with the FSET> instruction:

NFS Network File System

TCP Transmission Control Protocol

You can use the attributes listed in the following table when accessing these devices with the FSET instruction:

FSET Attributes forAdeptNet
Attribute Description
/ADDRESS IP address. (Applies only to the TCP device.)
/MOUNT Defines the name to be used for an NFS server remote disk. (Applies only to the NFS device.)
/NODE Node name.
/PATH Path for NFS server remote disk. (Applies only to the NFS device.)

For access to drives/folders on Windows-based PCs, use the Windows path format.
Examples:   a:\  ;  c:\disks

You may define new nodes on the network using the FSET program instruction to access a logical unit that has been attached to the TCP device. The string used with the FSET instruction has the same format as that used with the NODE statement in the V+ configuration file (see the later example).

You may also define new remote mounts, using the FSET program instruction to access a logical unit that has been attached to the NFS device. The string used with the FSET instruction has the same format as that used with the MOUNT statement in the V+ configuration file (see the later example).

Examples

Graphics

The following FSET instruction causes a pull-down menu to be displayed under the menu-bar item just selected by you (assuming that the array element event[2] has been set by a GETEVENT instruction that detected a menu event):

FSET (lun) "/PULLDOWN", event[2], $menu[event[2]]

This instruction requires that string array elements $menu[n] be defined for each of the menu items displayed on the menu bar. The following line shows how a pull-down list with four items can be defined for the first item on the menu bar. (Note that the menu items can have different lengths, they can consist of multiple words, and there is a space between the single quotes delineating items.)

$menu[1] = "'Item #1' 'Second Item' 'One more item' 'Last item'"

The following instruction takes control of the vertical scroll bar away from the window manager. The vertical scroll bar is set to return values from 0 to 10. The initial position of the scroll-bar handle is at the top (zero) and each time the up-arrow or down-arrow icon is clicked, the value of the scroll-bar handle position changes by 2 units.

FSET (lun) "/EVENT GRAB_V_SCROLL/V_RANGE 10/V_HANDLE 0/V_ARROWINC 2"

The following example attaches serial line 2 and sets the baud rate to 2400:

ATTACH (slun, 4) "SERIAL:2"
FSET (slun) "/SPEED 2400"

AdeptNet

Define a new node called SERVER2 with the IP address 172.16.200.102:

ATTACH (lun, 4) "TCP"
FSET (lun) "/NODE 'SERVER2' /ADDRESS 172 16 200 102"

Define a new NFS mount with the disk name DISK2 to access the exported directory /a of the node (server) called SERVER1 (which must already be defined):

ATTACH (lun, 4) "NFS"
FSET (lun) "/MOUNT 'DISK2' /NODE 'SERVER1' /PATH '/a'" 

For a Windows-based PC, define a new NFS mount with the device name XC to access the exported directory c:\adept\disks\disk_c of the node (server) called SERVER2  (which must already be defined):

ATTACH (lun, 4) "NFS"
fset nfs /mount 'XC' /node 'SERVER2' /path 'c:\adept\disks\disk_c'

Related Keywords

FOPEN program instruction

IOSTAT real-valued function


Submit comments to: techpubs@adept.com
Last modified on: 3/27/2012
Copyright © 1994 - 2012. Adept Technology, Inc.