www.brianapps.net - Sizer 4.0 railroad diagrams

Syntax diagrams

The syntax for Sizer expressions and macro is shown below as railroad diagrams. Macros follow the macro diagram; and expressions follow the expression diagram.

macro

option

Used to to set options during the execution of a macro. Supported options are:

OptionDescription
compensate_frame_effectsControls whether to adjust sizes to account for frame effects. See Compensate for Frame Effects for more information.
ignore_runtime_errorsWhen set to on, runtime errors (i.e. index out of range in a window-qualifier) are silently ignored and the macro continues running. The default value is off, which means the macro stops execution when it encounters an error and reports it to the user.

variable

Variable names always starts with $. Variables can be defined anywhere in the macro. Variables must be assigned a value before being used. Variables beginning with an underscore are reserved for use by Sizer and the behaviour is undefined if the user uses a variable that begins with an underscore.

variable-name

resize-block

The resize-block applies the resize actions to one or more windows that match the window-qualifier. If a * is specified after the window-qualifier then all windows that match the filter will be resized, otherwise only the first window matched is resized. Sizer will set two special variables:

These variables allow each window to be positioned differently. For example the following macro places all instances of notepad in a grid pattern with 4 columns:

resize : proc[notepad]*
    t = 300 * (($_index - 1) \ 4)
    l = 400 * (($_index - 1) % 4)
    w = 400
    h = 300

window-qualifier

A window-qualifier is used to specify which window should be resized.

QualifierDescription
activeThe main window of the application that is currently active. Also referred to as the foreground window.
lastThe window used by the previous resize action. If last is used in the first resize macro then the active window is used.
procFinds one or more windows whose process is owned by an executable with a name that contains the given text. e.g. to find windows owned by notepad.exe use proc["notepad.exe"]
capFinds one or more windows whose title (or caption) contains the given text. e.g. to find windows with readme.txt in the title use cap["readme.txt"]
desktopRestrict windows to the current desktop if running with multiple desktops.
numberSelect which window to use (when multiple windows match the process or caption) using a 1-based index.

assignment

Adjusts a dimension of the window being resized (as per the window-qualifier in the resize-block).

DimensionDescription
tTop coordinate of the window in pixels.
lLeft coordinate of the window in pixels.
wWidth of the window in pixels.
hHeight of the window in pixels.

expression

OperatorDescription
+Addition.
-Subtraction.

factor

OperatorDescription
*Top coordinate of the window in pixels.
/Left coordinate of the window in pixels.
\Width of the window in pixels.
%Height of the window in pixels.

unary

term

dimension

Obtain a dimension of an existing window or monitor. The first character describes which dimension to take.

ParamDescription
tTop of the window or monitor.
lLeft the window or monitor.
rRight of the window or monitor.
bBottom of the window or monitor.
wWidth of the window or monitor.
hHeight of the window or monitor.

Following this character is a description of the window or monitor to use. By default the active monitor is used.

ParamDescription
clientThe client area (usually the part of the application inside the window frame and menu).
winThe entire window frame including the border and title bar.
monA monitor attached to the system.
workareaThe work area is the area on a monitor not including the taskbar.

monitor-qualifier

A monitor-qualifier is used to specify which monitor to extract a dimensions from.

QualifierDescription
activeThe monitor on which the active window resides.
primaryThe monitor set to be the primary monitor.
numberA one based index of the monitor to use.

number