A 'ruler' can be used to control how the elements of a control are drawn.

A ruler is a string with the following syntax (in BNF notation):

ruler

::=

[position]{element}[height]

position

::=

'+' | '-'

element

::=

gap | prompt | ellipsis | data | help | edge | nudge

gap

::=

{[count] ('.' | '=')}

prompt

::=

{[count] 'p'}        --prompts only

ellipsis

::=

'[E]'        --prompts only

data

::=

{[count] 'd'}        --prompts only

help

::=

'[H]'        --prompts only

edge

::=

'L' | 'R'        --strings, text and buttons only

nudge

::=

[count] '<' | '>'

height

::=

{[count] (':' | '?' | '$' | '!')}

count

::=

{‘0’..’9’}

Where []'s indicate optional items, {}'s indicate replicated items, ()'s represents grouping, |’s represent a choice and ‘’s represent literal text.

The items have the following meaning:

position:

a leading '+' means this control is to be drawn in-line, to the right of whatever was drawn last (same as drPage_InLine)
a leading '-' means draw the control on the front of the (next) line (same as drPage_First).
The ruler position overrides the 'position' property of the control.

gap:

each '.' moves the drawing position 1 DU to the right (a DU is approximately 1/4 of a character width)
each '=' moves the drawing position 4 DU to the right (a DU is approximately 1/4 of a character width)

prompt:

each 'p' represents 1 character position to allow for the prompt text (default is 34), omitted means no prompt text
if a prompt precedes the data entry field, it is right-aligned, otherwise it is left-aligned

ellipsis:

represents the ellipsis button [...] or [```], omitted means no ellipsis button, the button occupies 10 DU

data:

each 'd' represents 1 character position to allow for the data entry field (default is 34), omitted means no data entry field

help:

represents the help button [?], omitted means no help button, the button occupies 13 DU

edge:

an 'L' means place the left edge of the control here
an 'R' means place the right edge of the control here,
the difference between the L and the R is the control width, the absence of an 'R' means the width floats (only meaningful on string controls)

nudge:

< means draw the control 1 DU higher than normal
> means draw the control 1 DU lower than normal

height:

each ':' represents 1 DU (a DU is approximately 1/8 of a character height),
each '?' represents the default height of a prompt control,
each '$' represents the default height of a string control,
each '!' represents the default height of a button control.
For string controls, this sets the height of the text as well as the vertical space to the next line of controls, setting a multi-line height and a width for a string control will cause the string text to fold across multiple lines.
For group controls, this sets the height of the group but does NOT affect the vertical space to the next line of controls.
For all other control types, it sets the vertical space to the next line of controls.

count:

a decimal number that replicates the succeeding character that many times, e.g. '10p' is the same as 'pppppppppp'

The default ruler for a prompt control is: '-34p.[E].34d.[H]?'

The default ruler for a button control is: 'L10=R!'

The default ruler for a string control is: 'L$'

The default ruler for a text controls is: '-L10$74=R'

The default ruler for a group control is : '34=10..L34=R4?'

Space characters in a ruler are ignored and can be used to visually separate elements.