Frames

Description

Often, to make your dialog look better, and to divide your dialog into different logical sections, you will want to add frames around controls on the dialog, and you will want to insert vertical and horizontal lines. The command to insert a frame is {Frame}. The syntax for the command is:

{Frame=columns,rows:text}

where rows and columns indicate the number of rows and columns of controls to be enclosed by the frame. The text parameter is the text that you want to appear on the frame. The parameter is optional. For example, the following script places a frame around the address fields in the previous script.

result=ui_dlg_box("Title",<<%dlg%
{ymargin=2,2}
{xmargin=2,4}
{ysize=2}
{frame=2,7:Address}
First name:| [.32firstname] ;
Last name:| [.32lastname] ;
Address 1:| [.32address1] ;
Address 2:| [.32address2] ;
City:| [.32City] ;
State:| [State] ;
Zip:| [Zip] ;
{lf};
<OK>
%dlg%)

This script creates this dialog:

Frames - Using Regions 

While the above script works, it is inconvenient to have to count the number of columns and rows that the frame will enclose. A more typical way to use the {Frame} command is to enclose the entire section of the dialog that you want to enclose in a {Region}{Endregion} command pair. This command pair instructs Alpha Anywhere to treat all of the enclosed cells as a single cell. The {frame} command can then be written as {Frame=1,1:text}. We will discuss the {Region}/{Endregion} command later in this lesson. For example, the following script produces the same dialog as the dialog above:

result=ui_dlg_box("Title",<<%dlg%
{ymargin=2,2}
{xmargin=2,4}
{ysize=2}
{frame=1,1Address}{Region}
First name:| [.32firstname] ;
Last name:| [.32lastname] ;
Address 1:| [.32address1] ;
Address 2:| [.32address2] ;
City:| [.32City] ;
State:| [State] ;
Zip:| [Zip] ; {Endregion};
{lf};
<OK>
%dlg%)

Limitations

Desktop applications only.

See Also