Please enable JavaScript to view this site.

A-Shell Development History

The AUI_WINDOW subroutine has been enhanced to return additional metric information about the screen, including the size in dialog (altpos) units, and taking into account the size of the task bar. This is useful if you want to compute a dialog size relative to the screen size, in advance of creating the dialog.

The new information is returned in the following parameters (which take the position of the l, t, r, b, rows and columns parameters for other flag values):

flg = -1  ! query

cid = -1  ! -1=full screen, -2=full screen minus task bar

xcall AUI,AUI_WINDOW, flg, hgridpix, vgridpix, hresalt, vresalt, hoverhd, voverhd, tsts, bsts, cid, hrespix, vrespix

 

hgridpix, vgridpix (substituting for l, t parameters) return the dialog (altpos) grid size in pixel units.

hresalt, vresalt (substituting for r, b params) return the screen size in dialog (altpos) grid units.

hoverhd, voverhd (substituting for rows, cols) return the dialog size

overhead (added to the size you request) to account for the title bar,

borders, leading, etc. As a general rule, the vertical overhead is equivalent to one logical row (one vertical dialog unit) and the horizontal overhead is negligible.

Previously, that call only set the hg and bg parameters to the size of the screen in pixels.

Although we've flogged this topic many times, as a reminder, if the MBF_ALTPOS flag is specified when creating a dialog, the coordinates are taken to be in "dialog (altpos) units". These are based on the size of default system font, which in turn is affected by the combination of the screen resolution, the font DPI, and the system font face (which for A-Shell's purposes can be set from the Settings...Font dialog). These units can be further adjusted by means of the scale factors in the Settings | Dialog Sizing dialog (which default to 100% for the height and 160% for the width). To put this in simpler terms, a single dialog (altpos) unit is roughly what it takes to display a single average character, with a reasonable amount extra for inter-line spacing and to allow for the possibility that your characters are wider (up to 160%) than "average". Unlike that standard A-Shell row/column grid units, dialog units are not affected by the size of the main window, but they do adjust along with the display size of the standard font (which is generally just what you want, and the way most Windows programs are sized).

The AUIWIN sample program in [908,28] has been updated to display this information about the screen, and a new sample program, DLGCTR [908,28] has been added to demonstrate using the information to create a centered dialog, with no visible parent, and which occupies nearly all of the screen.