Item tags
Item tags define the position and size in a grid-based container.
An item tag defines the position and size of a simple form item in a grid-area
of a GRID or SCROLLGRID container. Form items defined with item tags
are leaf nodes in the structure of a form definition, such as a form field (meaning that it is not a
container form item).
Syntax
[identifier [-] [|...]]
- identifier references a form item definition in the
ATTRIBUTESsection. - The optional
-hyphen-minus defines the real width of the element. - The
|pipe can be used as item tag separator (equivalent to][).
Usage
An item tag is delimited by square brakets ([]) or pipes (|) and
contains an identifier used to reference the description of the form item in the
ATTRIBUTES section. In this example, the identifier of the form item is
"f01", and the form item type is BUTTONEDIT:
LAYOUT
GRID
{
...
[f01 ]
...
}
END
...
ATTRIBUTES
BUTTONEDIT f01 = customer.cust_name, ACTION=zoom;
...
[]) to delimit item tags. The number of characters
and the delimiters define the width of the region to be used by the item:GRID
{
Name: [f001 ]
}
ENDGRID
{
1234567890
[f1]
}
ENDBy default, the real width of the form item is defined by the number of characters used between the tag delimiters.
BUTTONEDIT, COMBOBOX and
DATEEDIT, the width of the field is adjusted to include the button. The form
compiler computes the width as:
width=nbchars-2 if
nbchars>2:GRID
{
1234567
[f1 ] -- this EDIT gets a width of 7
[f2 ] -- this BUTTONEDIT gets a width of 5 (7-2)
}
END-
hyphen-minus symbol can be used to define the real width of the item. In this example, the form item
occupies 7 grid cells, but gets a real width of 5 (this means for an EDIT field, you are able to
enter 5 characters):GRID
{
1234567
[f1 - ]
}
END|) to indicate the end of the first item and the beginning of the second
item:GRID
{
Info: [f001 |f002 |f003 ]
}
ENDGRID
{
Multi-segment: [f001 ]
[ ]
[ ]
[ ]
[ ]
}
ENDThe notation applies to the new LAYOUT section only. For backward
compatibility (when using a SCREEN section), multiple-segment items can be
specified by repeating the identifier in sub-lines.
- Static field sets in a
GRIDcontainer, - Columns of a
TABLE(orTREE) container, or - Fields of a
SCROLLGRIDcontainer with a fixed number of rows (withoutWANTFIXEDPAGESIZE=NO).
Example using a GRID container:
LAYOUT
GRID
{
[f001 ] [f002 ] [f003 ]
[f001 ] [f002 ] [f003 ]
[f001 ] [f002 ] [f003 ]
[f001 ] [f002 ] [f003 ]
}
END
END
ATTRIBUTES
f001 = FORMONLY.field1;
f002 = FORMONLY.field2;
f003 = FORMONLY.field3;
END
INSTRUCTIONS
SCREEN RECORD my_screen_array (FORMONLY.*);
END
-- Vertically arranged item tags
GRID
{
[f001 ] [f002 ]
[f003 ]
[f001 ] [f002 ]
[f003 ]
[f001 ] [f002 ]
[f003 ]
[f001 ] [f002 ]
[f003 ]
}
END-- Horizontally arranged item tags
GRID
{
[f001 ] [f001 ] [f001 ] [f001 ] [f001 ] [f001 ]
[f002 ] [f002 ] [f002 ] [f002 ] [f002 ] [f002 ]
[f003 ] [f003 ] [f003 ] [f003 ] [f003 ] [f003 ]
}
END