Xbasic

{JUSTIFY}

Syntax

{JUSTIFY= Vertical_Justification, Horizontal_Justification }

Arguments

Vertical_Justification

Character. The allowed values are: "Center" "Top" "Bottom"

Horizontal_Justification

Character. The allowed values are: "Center" "Left" "Right"

Description

The {JUSTIFY} command controls the placement of a control within a cell in an Xdialog. The {JUSTIFY} command is typically inserted between {REGION} and {ENDREGION} commands.

Example 

result = ui_dlg_box("Title",<<%dlg%
{region}
Filename:| [.64filename];
{lf};
(Shared) Open as shared?;
{endregion};
{lf};
{region}
{justify=center,right}
<*15&OK> <15&Cancel>;
{endregion}
%dlg% )
images/XD_Justify_Command.gif

The following script displays variable dynamic text centered.

dim cc as C
cc = ui_get_text("","Text to be displayed: ")
mytext="{'%O={B=Blue White}{C=Red}" + cc + "%}"
dialog=<<%str%
text after this next line will be centered;
uncentered text;
{justify=center}
%str%+mytext+";"
ui_dlg_box("center this",dialog)
images/XD_{Justify}_2.gif

The following script justifies labels and fields.

result=ui_dlg_box("Title",<<%dlg%
{region}
Enter your firstname, last name and occupation: ;
{endregion};
{region}
{justify=right}First Name: |{justify=left} .20firstname;
{justify=right}Last Name: |{justify=left} .20lastname;
{justify=right}Job: |{justify=left} .30occupation;
{endregion};
{region}
<&OK> <&Cancel>;
{endregion};
%dlg% )
images/XD_{Justify}.gif

Limitations

Desktop applications only

See Also