Panel configuration files

The layout and general appearance of the screen can be modified by editing "panel description files". These files store names, positions, and characteristics of labels, control buttons, text areas, and other user interface items. You may want to make adjustments to the layout because of different length names or different sized fonts at your installation, or perhaps set a tighter spacing to leave more screen space for other windows. You may prefer a different logical layout of the buttons, for example putting the "help" button in the upper left corner and "quit" button in the lower right. You can also change the names on labeled fields or buttons.

Visual features such as colors, frame border widths, fonts, as well as behavior of the mouse cursor, window stacking, etc. are controlled by windows.

First a few definitions. A "frame" is the outer container for related user interface components for the application program. It corresponds to a window on your screen and is therefore movable & resizable using the screen window manager. The dynamic positioning of the items inside a frame is limited, so that resizing a frame does not always provide a useful shape.

A frame is usually divided into subframes for different functions. One of these is the "list frame", also known as a choice list. It displays rows of text that the user can select with the mouse or keyboard. Some only allow a single item to be selected at a time while others support multi-selection, allowing any number of items to be selected. They are usually formatted to allow long names or verbal descriptions of the choices. If the number of items does not fit in the space provided, a scrollbar displays.

A "text frame" is a general writing area that the user can scroll vertically and horizontally, if needed. Some text frames can be typed into, for example to edit comments. Others are only for displaying information.

A panel is an area that holds control buttons, toggle switches, and short single line typing areas; a sort of cross between an instrument panel and a paper fill-in form. They are usually used to determine settings that are needed during an operation, or to start and stop operations in the same manner as from menus. Panels can be dynamic; certain settings will automatically disable some of the other settings if they are logically incompatible.

The main frame is considered to be the "parent" of the subframes contained in it – the "parent" of a button is the panel that contains it. Items are positioned using coordinates relative to their parent.

Below is an example frame and panel definition file for the tag configuration in the datamatic tools program. If you have the tagtool running on your screen then you can see the association between the description files and the result.

File "tagcnftool.f":

id 0 TagCnfTool;

tit Tag Configuration Tool;;

id 1 main tagcnftool.p;cls 70;;

id 2 names; scb 1;cal 1;x 0;blw main;rws 6;cls 30;cho ;;

id 2 choice; scb 1;cal 1;rgt names;blw main;rws 6;cls 40;cho ;;

The first row "id 0" gives the name of the frame. This name is used internally by application programs, so that unique names should be assigned to all the frames. The title field is written into the title bar of the window that contains this frame.

The next rows divide up the frame into subframes. The row "id 1" defines a control panel subframe named "main" that is 70 columns wide; the description of the panel is found in a separate file named "tagcnftool.p". The application program searches for this control panel with this name "main" so you should not change it.

Two choice panels (id 2) are located below the control panel, positioned by the request "blw main". Similarly the second choice panel is to the right of the first via the command "rgt names". The sizes of these choice panels are 6 character rows and 30 or 40 character columns. A list longer than the frame can be handled because the "scb 1" commands request scrollbars to be placed. The names of the choices will be provided by the program but an empty dummy initial choice ("cho ;") is provided in case the program doesn't find any tag types.

The expression "cal 1" means to enable "callbacks". This indicates that the frame will probably change during use since the application program will be called to examine your choice at the instant that you select it. Another use for callbacks is to check for errors in your input or in the data. Not all panel items need callbacks, since the application program might wait to examine the state of the panel only when you are finished using it. For these reasons you should not remove any callbacks in a panel definition, and there is no reason to add any if the application is not interested in the item.

The contents of the control panel are described by this panel file (simplified):

id 1 panel;;

id 1 OK;bim Done;col  0;row 0;w 8;bva 'd';lay 0;;

id 1 H;bim  Help;col 20;row 0;w 8;bva 'h';lay 0;;

id 1 BM;bim Modify Tag;col 14;row 1;w 11;bva 'M';lay 0;;

id 2 descr;lbl Description:;col 1;row 4;len  50;;

id 3 type; lbl Data Type:;col 1;row 5;cst 1;cal 1;

cho String;cho Numeric; cho Coded;;

id 2 min;lbl Min Value:;col 1;row 6;len 10;sho 0;;

id 2 max;lbl Max Value:;col 1;row 7;len 10;sho 0;;

The first line is special in that it actually uses the syntax reserved for frame files. In this case it gives a name but provides no other information since that was provided in the frame file.

The panel has 3 buttons labeled as shown by the "bim" (button image) command. The positions are set by the "row" and "col" fields and the width by the "w" field. The "lay" field selects layout 0, which means center all the buttons on the same row. The most important fields to the program are the names at the beginning of the line and the value sent to the program when the button is pressed, the "bva" button value field. These must not be changed or the program will not know what button was pressed.

A one-of-many selection is described by the "id 3" row, and the whole set of choices has a label "Data Type". The callback is set, since it affects other items on the panel (see next paragraph). In this case the choices are fixed and known in advance. You may change the spelling of the choices but the meaning is recognized by their order; that is, the program will respond to the uppermost choice to mean "String tag" regardless of the word printed on it. The "cst" tag selects a representation style in which the entries are stacked vertically.

The last two items are "fill-in" fields, single line text editors. They allow up to ten characters to be typed ("len 10"). The "sho 0" field causes the fill-ins to be initially invisible, since they are only used when the tag type is "String". The callback to the data type choice field turns the fill-ins on or off as needed.

Frame configuration files

A frame configuration file consists of records and comments. Each record consists of a variable number of data fields. For readability records are conventionally started on a new line, but the real record divider is a double semicolon (an empty field). C-style comments are supported: everything between "/*" and "*/" marks is ignored.

A data field is a name and a value and a terminating semicolon. The name is usually a short abbreviated word and must be terminated from the rest of the field by at least one space. The value part of the field may be multi-word; everything is scanned up to the semicolon. This means that normally semicolons may not be used within the name-value definition, since it terminates the definition (but see the paragraph below on quoting).

The first field of each record must have the name "id", and as a value a number indicating the object type and a name for the object. The types of subframes are:

ID

Subframe type

0

frame (id record)

1

panel

2

list window for selections

3

multi-select

4

text window

5

canvas window

6

tree window

The name may later be used by the application to find the object. For panels the id field gives the name of a panel definition file. The name may also simply be a dash '-', which means that the panel definitions follow immediately within the frame definition file itself. This kind of internal panel definition needs an empty record to terminate the definition of panel items and return to frame definitions. If a separate panel definition file is used then that file is expected to be in the same directory as the frame definition file.

The first record defines arguments for the top-level frame. The rest of the records represent subframes and specify their arguments.

Arguments for all subframe types

The following table describes frame arguments that apply to all subframes:

Name

Arg

Description

tit

string

title of the frame; use only for subframe type "frame"

sty

n

style of top level frame:

n = 0 Normal frame (default).

n = 1 Embedded frame (replaces client window).

n = 2 Modeless child frame.

n = 3 Frame without caption (title bar).

n = 4 Frame is modeless.

n = 5 Embedded frame (has message pane).

n = 6 Modeless tool frame that does not disable its owner.

n = 7 Modeless tool frame that disables its owner when displayed.

n = 8 Modeless application window that can be maximized or minimized, appears in the Taskbar, and can be switched to with Alt+Tab.

ico

string

icon for child frame

blw

frm

place frame below frame whose name is given as argument; this can also be a list of names separated with spaces

rgt

frm

place frame to the right of frame whose name is given as argument; this can also be a list of names separated with spaces

x

n

n = position of left edge in parent frame, in pixels

y

n

n = position of top edge in parent frame, in pixels

row

n

n = position in parent frame using character coordinates, counted from top

col

n

n = position in parent frame using character coordinates

wdt

n

n = width in pixels

hgt

n

n = height in pixels

mih

n

n = minimum height in character rows

miw

n

n = minimum width in character columns

rws

n

n = height in character rows

cls

n

n = width in character columns

mgl

n

left margin between the frame element and the edge of the window

n = 0 no margin

n = 1 normal margin (default if argument not specified)

mgr

n

right margin between the frame element and the edge of the window

n = 0 no margin

n = 1 normal margin (default if argument not specified)

mgt

n

top margin between the frame element and the edge of the window

n = 0 no margin

n = 1 normal margin (default if argument not specified)

mgb

n

bottom margin between the frame element and the edge of the window

n = 0 no margin

n = 1 normal margin (default if argument not specified)

scb

n

n = 0 put scrollbar on left

n = 1 put scrollbar on right

n = 2 put scrollbar at the bottom

n = 3 put scrollbar at the top

fnt

n

n = font id. The font id is the row in the font list file in your configuration directory. The first font listed (n = 1) is the default. The names used in this fontlist are the names available from your display server. The fontlist file is also found in the environment variable WM_FONT_FILES.

foc

n

n = 1 the subframe has initial keyboard focus

rsz

n

n = 1 allow vertical resize

n = 2 allow horizontal resize

n = 3 allow both vertical and horizontal resize

tip

string

tooltip text for the frame

cli

pointer

pointer to client data, passed to client in callback calls

rem

n

n = 1 remember previous position

n = 2 remember previous size

n = 3 remembers both size and position

If the width (wdt or cls) or height (hgt or rws) dimension is set to zero then the frame extends to the respective edge of the top-level frame. If either of these dimensions is negative then it is taken as a percentage of the top-level frame's respective dimension.

Arguments for panels

The following arguments are available for panels:

Name

Arg

Description

men

name

specifies menu file name for the panel background

spl

n

user adjustable splitter between frame items:

n = 0 no splitter

n = 1 vertical splitter

n = 2 horizontal splitter

Menus are loaded from the same directory as the frame or panel or ../menu if that exists. The use of the separate menu directory is preferred. See Menu configuration files.

Arguments for selection and multi-selection lists

The following arguments are available for selections and multiselects:

Name

Arg

Description

cho

text

choice string

chi

icon

choice image, the name of an icon file

cst

n

feedback style

ord

n

ordinal value of currently selected choice

lwc

n

number of columns to display choices

msv

n

value for multiselect (a string or 1s and 0s indicating which choices are currently selected)

cal

n

callback if n = 1

lcn

n

column id

lch

text

column text

lcw

n

column width

lca

n

n = 0 left alignment

n = 1 center alignment

n = 2 right alignment

lct

n

n = 1 string column

n = 2 integer column

n = 3 time column

n = 4 floating number column

leC

n

even row text color (RGB value)

leB

n

even row background color (RGB value)

loC

n

odd row text color (RGB value)

loB

n

odd row background color (RGB value)

Icon files for choice images are found in the directory "*icon" parallel (same parent) to the panel directory.

RGB color can also be specified using a hexadecimal value in the form: 0xBBGGRR, where RR (red), GG (green) and BB (blue) are hexadecimal values between 00 and FF (same as decimal 0-255).

n = 24bit RGB value if n >= 0

n = -(palette index + 1) if n < 0)

Arguments for text windows

The following arguments are available for text windows:

Name

Arg

Description

fil

name

specifies the text file name

rdo

n

n = 0 text is not read only and user can edit the text

n = 1 text is read only

mem

n

memory size in number of characters

cal

n

callback if n = 1

Arguments for canvas windows

The following arguments are available for canvas windows:

Name

Arg

Description

fnn

name

specifies the font name

fnt

n

font id

inm

n

n = 1 key press

n = 2 key release

n = 3 button press

n = 4 button release

cuf

n

cursor font

men

name

specifies menu file name for the canvas background

fgc

n

foreground color (RGB value)

bac

n

background color (RGB value)

vin

n

vertical scrollbar increment

vmx

n

vertical scrollbar maximum

vss

n

vertical scrollbar slider size

vva

n

vertical scrollbar value

hin

n

horizontal scrollbar increment

hmx

n

horizontal scrollbar maximum

hva

n

horizontal scrollbar value

hss

n

horizontal scrollbar slider size

bks

n

if backing store has been requested, create an off-screen bitmap and a device context for it

n = 0 no backing store

n = 1 backing store

Arguments for tree windows

The following arguments are available for tree windows:

Name

Arg

Description

ms

n

n = 1 tree window supports multi-selection in one branch of the tree

Panel definition files

A panel definition file is built of records with the same general syntax as for frames, but with different argument names. The first record is the title record of the panel. If panel already exists then this data is ignored. Otherwise it is used to create the panel into the new frame.

The remaining records define panel items for the panel.

Panel items

The following item types are available for panels:

ID

Type

Description

1

button

press for function activation

2

fill in

user typed-in text

3

choice

picking from a menu-like list

4

toggle

on-off switches for setting options

5

message

inactive text on the panel

6

slider

continuous moving "volume control"

7

progress

progress bar animation

Panel item attributes

Attributes can be given to an item using the following data fields:

Name

Arg

Description

x

n

horizontal position of item in pixels

y

n

vertical position of item in pixels

col

n

horizontal position of item in character positions

row

n

vertical position of item in character positions

w

n

width of rectangle reserved for this item

h

n

height of rectangle reserved for this item

fnt

n

font id

men

name

menu related to the item. Menus are found in the same directory as the panel file or preferably in the adjacent directory ../menu

lay

n

layout style for series of fill-ins, choices, toggles, and sliders

n = 0 center

n = 1 vertical

n = 2 horizontal

lbl

n

item label, on the side of fill in, choice, toggle, message, or slider

lbf

n

font ID used to render item's label; see font IDs for frames

lbi

icon

item label image, icon name; icons are found from directory "*icon" adjacent to the panel directory

cal

n

callback if n = 1

sho

n

show item (n = 1) or don't show (n = 0); initial state, program will change as needed

bac

n

background color (RGB value)

fgc

n

foreground color for text items (RGB value)

bva

n

Button value of a button item. This must be an integer number; it can be given as a character enclosed in single quotes e.g. 'a'. These values have fixed meaning to the program so they should not be changed, otherwise the program won't know which button was pressed.

bim

icon

Button icon. Replaces the button text value if given.

def

n

n = 1 to make this the default button

min

n

minimum value for fill

max

n

maximum value for fill

val

n

value for fill items and toggle items

vlf

n

id number for font used to render value

len

n

max number of chars in a fill item

dle

n

number of chars that need to be displayed from a fill item

cho

n

Choice string for a choice or toggle. NOTE: This is a vector entity, it lists a set of items.

chi

n

Choice image for a choice or toggle. See button images. NOTE: This is a vector entity, it lists a set of items.

cst

n

choice style:

n = 0 radio buttons

n = 1 rotate (drop-down menu)

n = 6 tabs

ccl

n

number of columns to arrange choices

spc

n

spacing between choices and toggles

n = 0 minimal spacing if there are no more than two items, even spacing if there are three items or more

n = 1 minimal spacing, left-aligned

n = 2 even spacing

tst

n

toggle style:

n = 0 checkbox (default)

n = 1 button

ord

n

ordinal value of current selection

swi

n

slider width

smn

n

min value for slider

smx

n

max value for slider

sva

n

pre-set slider value

sdp

n

n = 1 to display running value of slider

sen

n

n = 1 to label ends of slider bar with min & max

foc

n

n = 1 to set initial keyboard focus to the item

clo

n

n = 1 to set default action for close button of the title bar. If this is not set to any of the buttons, then the close button disappears from title bar.

tip

string

tooltip text for the item

sep

n

n = 1 to show a horizontal dividing line in a message item (with optional text)

anc

n

Anchor panel items to certain corner or side, so elements stay there even if the user resizes the frame. So this should be used together with ‘rsz’ frame argument.

n = 0 no anchor (default)

n = 1 anchor left

n = 2 anchor right

n = 4 anchor top

n = 8 anchor bottom

This value is a bitwise value, so bottom right corner can be archived with value 10.

rdo

n

n = 1 to set fill item to be read only

sta

n

n = 1 to set fill item to be static. Acts like message item in this case.

pwd

n

n = 1 to set fill item to hide given characters

sel

-

If defined, the content of the fill is preselected.

err

name

name of label field that shows the error message when fill item has invalid content

lff

name

name of label field that turns red when fill item has invalid content

pmi

n

minimum value for progress bar

pma

n

maximum value for progress bar

pst

-

steps one step forward

pva

n

current value of the progress

prs

-

reset progress to start value

pmq

n

n = 1 to set progress bar to marquee mode. Marquee progress bars do not have a range or position.

liw

n

width reserved for item label (lbl)

sns

n

n = 0 makes item become insensitive. So item is visible, but gray and not enabled.

mlw

n

Maximum label width space. Longer labels will be truncated.

for

string

Format for floating and double values. Example: %.2f means that the value is presented with two decimals.

Button configuration

Widgets used to implement various input functions can be configured using standard resource files. Widgets implementing text, message or button items in the dialog window can be further configured using special configuration files. These files can be pointed to by the environment variables specified in the following table.

Name

Description

WM_BUTTON_ITEMS

Description of control buttons.

WM_DIALOG BUTS

Describes the location of the control buttons during dialog.

WM_YESNO_BUTS

Describes the location of buttons during yes/no.

WM_SELECT_BUTS

Describes the location of buttons during select.

WM_SELSET_BUTS

Describes the location of buttons during filetool.

WM_TEXT_ITEMS

Description of the text items displayed on DlgBoard.

Button items

Buttons are numbered as follows:

0

Dialog done

1

Cancel

2

Erase

3

Recall

4

Yes

5

No

6

All

7

None

8

Dir

9

Parent

A button can be configured if it has an entry in this config file. Otherwise defaults are used. The following items are needed for one entry:

<button_id> <label string> <width>

Dialog buttons

For each button the following entry is needed:

<button id> <x> <y>

Text items

Text items are numbered as follows:

0

Dialog item

1

Yes/no question

2

Directory

3

Pattern

4

File

Entries contain the following data:

<text id> <x> <y> <label string> <display length>

Example

The button label "Yes" in a yes/no widget should be changed to "Si".

First WM_BUTTON_ITEMS is set:

setenv WM_BUTTON_ITEMS /usr/mysettings/wm_button_items

In the file wm_button_items:

4'Si'6

This will produce a yes/no panel with "Si" replacing "Yes".