Regions

Description

It is convenient to be able to nest table formats. This allows you to divide a cell into a sub-table. It is also convenient to take multiple cells and to group them together so that they act as if they were a single cell. This is achieved with the {Region} {Endregion} command pair. All cells enclosed by the {Region} {Endregion} command are treated as a single cell.

The {Region} {Endregion} command allows for unlimited levels of nesting. It can become quite tricky keeping track of which {Endregion} command belongs with which {Region} command. You can include an optional number in the {Region} and {Endregion} command to help you keep track of things. For example, {Region2} {Region3} {Endregion3} {Endregion2}. The number has no effect on how Alpha Anywhere interprets the dialog box. The following script uses the {Region} {Endregion} command pair:

result = ui_dlg_box("Title",<<%dlg%
{frame=1,1:Billing}
{region1}
First name:|[.32firstname] ;
Last name:|[.32lastname] ;
Address 1:|[.32address1] ;
Address 2:|[.32address2] ;
City:|[.32City] ;
State:|[State] ;
Zip:|[Zip]
{endregion1}|{sp}|
{frame=1,1:Shipping}
{region2}
First name:|[.32firstname] ;
Last name:|[.32lastname] ;
Address 1:|[.32address1] ;
Address 2:|[.32address2] ;
City:|[.32City] ;
State:|[State] ;
Zip:|[Zip]
{endregion2}|{sp}|
{Region3}
<10&OK>;
<10&Cancel>
{Endregion3}
%dlg%)

This script creates this dialog:

images/XD_Region_Endregion.gif

This dialog can be thought of as having one row and four columns. Row 1, column 1 (Billing information) is sub-divided into 2 columns and 7 rows. Row 1, column 2 is a divider column to create horizontal space between the billing and shipping information. Normally Alpha Anywhere does not allocate any space to blank cells. You force Alpha Anywhere to allocate space to a blank cell using the {sp} command. Row 1, column 3 is sub-divided into 2 columns and 7 rows. It contains the Shipping information. Row 1, column 4 is sub-divided into 1 column and 2 rows. This cell contains the buttons. Notice also that in this script the {Frame} commands specify one row and one column. This is because the {Region} {Endregion} command pair that encloses the billing and shipping information turns these regions on the dialog into single "logical" cells.

Horizontal Regions

Normally, different regions have their own column and rows sizes. For example, consider the following script which is a modification of the above dialog. In this dialog the regions appear on different rows (rather than in different columns). Note that the static text "Firstname" in the billing region has been changed to "Customer First name". This increases the size of the first column in the billing region. As a result of this change, the columns in the shipping region no longer line up with the billing region.

result = ui_dlg_box("Title",<<%dlg%
{frame=1,1:Billing}
{region}
Customer First name:|[.32firstname] ;
Last name:|[.32lastname] ;
Address 1:|[.32address1] ;
Address 2:|[.32address2] ;
City:|[.32City] ;
State:|[State] ;
Zip:|[Zip]
{endregion};
{frame=1,1:Shipping}
{region}
First name:|[.32firstname] ;
Last name:|[.32lastname] ;
Address 1:|[.32address1] ;
Address 2:|[.32address2] ;
City:|[.32City] ;
State:|[State] ;
Zip:|[Zip]
{endregion};
{Region3}
<10&OK> <10&Cancel>
{Endregion3}
%dlg%)

This script creates this dialog:

images/XD_Region_Endregion_2.gif

Sharing Row and Column Dimensions Across Regions

You can instruct Alpha Anywhere to assign the same column or row size to two independent regions by including an optional label in the {Region} command. For example, {Region=A}. Alpha Anywhere will attempt to use the same column, or row size for all regions that share the same label.

If you use a label, you cannot use the optional numeric delimiter. E.g. {Region1=A} is not valid.

As the following script demonstrates, the billing and shipping regions now have the same column sizes.

result = ui_dlg_box("Title",<<%dlg%
{frame=1,1:Billing}
{region=a}
Customer First name:|[.32firstname] ;
Last name:|[.32lastname] ;
Address 1:|[.32address1] ;
Address 2:|[.32address2] ;
City:|[.32City] ;
State:|[State] ;
Zip:|[Zip]
{endregion};
{frame=1,1:Shipping}
{region=a}
First name:|[.32firstname] ;
Last name:|[.32lastname] ;
Address 1:|[.32address1] ;
Address 2:|[.32address2] ;
City:|[.32City] ;
State:|[State] ;
Zip:|[Zip]
{endregion};
{Region3}
<10&OK> <10&Cancel>
{Endregion3}
%dlg%)

This script creates this dialog:

images/XD_Region_Endregion_3.gif
You must include a ';' command after the {Endregion} to begin the next {Region} on a new row.

Limitations

Desktop applications only

See Also