☜ | MWAPI - Position, Size and Units1995 Version of ANSI (Equivalent to Current ISO Version) of Standard | ☞ |
A UNITS dattribute, wattribute, or elattribute specifies the unit of measure for the size or position of a display, window, or element, respectively.
unitspec | ::= | │ │ │ │ │ │ |
CHAR [ , chars ] PIXEL POINT REL [ , hscale , vscale ] implementationvalue |
│ │ │ │ │ │ |
A unitspec value of CHAR specifies that position or size is measured relative to the size of characters in a basis font which is determined by context. A unit in the vertical dimension is equal to the line spacing (including external leading) in that font. If chars is specified and is not equal to emptystring, a unit in the horizontal dimension is equal to the average character width in that font for the characters in chars. If chars is not specified or if chars is equal to emptystring, a unit in the horizontal dimension is equal to the maximum character width in that font.
A unitspec value of PIXEL specifies that position or size is measured in pixels. A unit is equal to the size of a pixel.
A unitspec value of POINT specifies that position or size is measured in points. A unit is equal to the size of a point, 1/72 inches.
A unitspec value of REL specifies a relative scale. If hscale and vscale are not given, they default to 100. REL units are defined relative to a basis size of another object. If the other object is a display, the basis size is the size of the display. If the other object is a window, the basis size is the size of the window viewport when that other window is created.
If hbasis and vbasis are the basis size in PIXEL units, and hrel and vrel are a size or position specification in REL units, hrel and vrel are converted to PIXEL units (hpix and vpix) by the following calculations:
hscale | ::= | numlit |
vscale | ::= | numlit |
A position consists of a horizontal location (hpos), a vertical location (vpos), and an optional units of measure designation (unitspec).
pos | ::= | expr V | hpos [ , [ vpos ] [ , unitspec ] ] |
hpos | ::= | [ - ] numlit |
vpos | ::= | [ - ] numlit |
The position of an entity is always specified as the location of the origin of that entity with respect to the origin of a display, window or gadget. The origin of a display or a window frame or a window viewport or a gadget is its upper left hand corner. When a window is created, the origin of its application area is the upper left hand corner of the window viewport. Subsequent scrolling moves the application area origin. The origin is position (0,0) and positions are measured in a positive direction to the right and down.
Note: In the future, support may be added for different coordinate systems to facilitate support of languages with orientations other than left-to-right and top-to-bottom.
A size consists of a horizontal size (hsize), a vertical size (vsize), and an optional units of measure designation (unitspec).
size | ::= | expr V | │ │ │ |
hsize [ , [ vsize ] [ , unitspec ] ] , vsize [ , unitspec ] |
│ │ │ |
hsize | ::= | [ - ] numlit |
vsize | ::= | [ - ] numlit |
Unless indicated otherwise, if an application attempts to assign to an attribute an hsize or vsize value which is less than or equal to zero, an error occurs with $ECODE containing ",M?2," and $EREF containing a value that indicates the ssvn reference for which the error occurred.
If the unitspec is omitted when a pos or size value is assigned to an attribute, unitspec defaults to the then current value of the entity’s UNITS attribute.
Any reference to ^$DISPLAY or ^$WINDOW for a pos or size value yields a value that includes hpos, vpos, and unitspec pieces and that is expressed in the unit of measure specified (when the reference is made) by the entity’s UNITS attribute.
If a size or position value assigned by an application cannot be provided, a size or position is determined by the underlying windowing platform or the MWAPI implementation. Any reference to attributes identifying a size or position reflects the actual size or position.
Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.
This page most recently updated on 14-Nov-2023, 21:55:04.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)