Type: Integer
Availability: Read or write at any time
The alignment property determines whether the text is placed before or after the button bitmap image for CheckBox and OptionButton classes. For other control classes, it sets the alignment of the text in a control.
For a check box or option button control, the alignment property settings are listed in the following table.
Class Constant | Value | Description |
---|---|---|
Alignment_Left | 0 | Control aligns to the left with text on the right (the default) |
Alignment_Right | 1 | Control aligns to the right with text on the left |
For the Table class, the alignment property settings, which affect the text and picture components of table cells, are listed in the following table. (In this table, the constants with two integer values in the range 1 through 3 are compatible and are the values for vertical or horizontal alignment in each case.)
Table Class Constant | Value | Description |
---|---|---|
Alignment_Default | 0 | Uses default alignment (left for a sheet, or the alignment value of the cell) |
Alignment_Left | 1 | Text aligns to the left of the cell after any cell picture |
Alignment_Left_Middle | 1 | Text is left-justified in the vertical middle of the cell |
Alignment_Right | 2 | Text aligns to the right with any cell picture on its left |
Alignment_Right_Middle | 2 | Text is right-justified in the vertical middle of the cell |
Alignment_Center | 3 | Text and any picture are centered within the cell |
Alignment_Center_Middle | 3 | Text is centered horizontally at the middle of the cell |
Alignment_Left_Top | 4 | Text is left-justified at the top of the cell |
Alignment_Right_Top | 5 | Text is right-justified at the top of the cell |
Alignment_Center_Top | 6 | Text is centered horizontally at the top of the cell |
Alignment_Left_Bottom | 7 | Text is left-justified at the bottom of the cell |
Alignment_Right_Bottom | 8 | Text is right-justified at the bottom of the cell |
Alignment_Center_Bottom | 9 | Text is centered horizontally at the bottom of the cell |
The Table control accessMode, accessedSheet, accessedRow, accessedColumn, or accessedCell property determines whether the alignment for the current sheet, cell, column, or row is being accessed. If the cell is too small to fit both the text and the picture, the text takes precedence over the picture unless the stretch property is set to Stretch_None_Picture_First (2) or Stretch_Cell_Picture_First (3), where the picture takes precedence.
The size of the text is determined by taking the cell size and calculating the text size required using the word wrap option. The space left over is used to scale the image proportionally so that the whole image is displayed. (See also the partialTextIndication and stretch properties.)
For the TextBox class, the alignment property settings are listed in the following table.
TextBox Class Constant | Value | Description |
---|---|---|
Alignment_Left | 0 | Text aligns to the left (the default). |
Alignment_Right | 1 | Text aligns to the right (setting this value resets the scrollBars and scrollHorizontal properties to exclude horizontal scrolling) |
Alignment_Center | 2 | Text aligns to the center (setting this value resets the scrollBars and scrollHorizontal properties to exclude horizontal scrolling) |
If the value of the alignment property of a text box is Alignment_Right or Alignment_Center, setting the value of the scrollHorizontal property to true has no effect.
For the Frame, JadeMask, Label, or StatusLine class, the alignment property settings are listed in the following table.
Class Constant | Value | Description |
---|---|---|
Alignment_Left_Top | 0 | Left justify, top of the control (the default) |
Alignment_Left_Middle | 1 | Left justify, middle (vertically) of the control |
Alignment_Left_Bottom | 2 | Left justify, bottom of the control |
Alignment_Right_Top | 3 | Right justify, top of the control |
Alignment_Right_Middle | 4 | Right justify, middle (vertically) of the control |
Alignment_Right_Bottom | 5 | Right justify, bottom of the control |
Alignment_Center_Top | 6 | Center horizontally at the top of the control |
Alignment_Center_Middle | 7 | Center horizontally at the middle (vertically) of the control |
Alignment_Center_Bottom | 8 | Center horizontally at the bottom of the control |
For JadeMask controls, the alignment occurs within the rectangle defined by the captionLeft, captionTop, captionHeight, and captionWidth properties. If the value of the captionWidth property is zero (0), the width of the caption region is the value of the clientWidth property less the value of the captionWidth property. If the value of the captionHeight property is zero (0), the height is the value of the clientHeight property less the value of the captionTop property.
For frame and status line controls, the text is always displayed inside the area bounded by the 3D borders.
The code fragment in the following example shows the use of the alignment property.
tblPortfolio.alignment := Table.Alignment_Right;
For the JadeRichText control, the alignment property contains the alignment of the current paragraph. (For an example of the use of this property, see "JadeRichText Control Method Example", earlier in this document.)
The alignment property values for the JadeRichText control are listed in the following table.
JadeRichText Class Constant | Value | Paragraph… |
---|---|---|
Alignment_Center | 2 | Is centered in the control |
Alignment_Justify | 3 | Is aligned relative to the left and right margins |
Alignment_Left | 0 | Aligns to the left with text on the right (the default) |
Alignment_Right | 1 | Aligns to the right with text on the left |
ParagraphFormat_Undefined | #80000000 | Alignment cannot be assigned but is returned to indicate that the selected text contains multiple paragraphs with different alignment values |
Although you can define values other than those listed in this table, if you do so, the paragraph is displayed as left-aligned.