Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

MWAPI - Position, Size and Units

Draft MDC Standard

3.3.9 Position, Size and Units

A UNITS dattribute, wattribute, or elattribute specifies the unit of measure for the size or pos ition 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 ] ]
, 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

A width consists of a horizontal size (hsize) and an optional units of measure designation (unitspec).

    width::= hsize [ , unitspec ]

A height consists of a vertical size (vsize) and an optional units of measure designation (unitspec).

    height::= vsize [ , unitspec ]

Unless indicated otherwise, if an application attempts to assign to an attribute an hsize or vsize value which is less than zero, an error occurs with an ecode = "M47" and $EREF containing a value that indicates the ssvn reference for which the error occurred.

If the unitspec is omitted when a pos, size, width, or height 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, size, width, or height value yields a value that includes a unitspec piece and that is expressed in the unit of measure specified (when the reference is made) by the entity’s UNITS attribute. Modification of a UNITS attribute does not cause the actual size or position of any entity to change.

If a size, position, width or height value assigned by an application cannot be provided, a size, position, width or height is determined by the underlying windowing platform. Any reference to attributes identifying a size, position, width, or height reflects the actual size or position.

Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

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.

Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.

This page most recently updated on 14-Nov-2023, 21:55:04.

For comments, contact Ed de Moel (demoel@jacquardsystems.com)