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) |
gap: |
each '.' moves the drawing position 1 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 |
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 |
nudge: |
< means draw the control 1 DU higher than normal |
height: |
each ':' represents 1 DU (a DU is approximately 1/8 of a character height), |
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.