Difference between revisions of "CellAlignment"
(Created page with "category:Cell format functions category:Analytica 5.0 ''New to Analytica 5.0'' == CellAlignment( ''horiz, indent, vert, vertIndent'' ) == Specifies the text al...") |
(EW 20199 (word wrap) and 20200 (Hybrid alignment)) |
||
Line 1: | Line 1: | ||
[[category:Cell format functions]] | [[category:Cell format functions]] | ||
[[category:Analytica 5.0]] | [[category:Analytica 5.0]] | ||
+ | {{ReleaseBar}} | ||
''New to [[Analytica 5.0]]'' | ''New to [[Analytica 5.0]]'' | ||
− | == CellAlignment( ''horiz, indent, vert, vertIndent'' ) == | + | == CellAlignment( ''horiz, indent, vert, vertIndent{{Release|6.4||, wrap, hybridFlags}}'' ) == |
Specifies the text alignment (justification) or indention for a cell in a table. This is used from within a [[Cell Format Expression]] attribute, see [[Computed cell formats]] for an overview of using computed formats. | Specifies the text alignment (justification) or indention for a cell in a table. This is used from within a [[Cell Format Expression]] attribute, see [[Computed cell formats]] for an overview of using computed formats. | ||
Parameters: | Parameters: | ||
− | * «horiz»: The horizontal alignment. One of: <code>'Left'</code>, <code>'Center'</code> or <code>' | + | * «horiz»: The horizontal alignment. One of: <code>'Left'</code>, <code>'Center'</code>, <code>'Right'</code>, {{Release||6.3| or }}<code>'Default'</code>{{Release|6.4|| or <code>'Hybrid'</code>}}. |
* «indent»: An indention amount, in units equal to the width of one space character. For <code>'Left'</code> alignment, this is a margin to the left of the text, for <code>'Right'</code> it is a margin to the right of the text, and for <code>'Center'</code> it is a margin on both sides. | * «indent»: An indention amount, in units equal to the width of one space character. For <code>'Left'</code> alignment, this is a margin to the left of the text, for <code>'Right'</code> it is a margin to the right of the text, and for <code>'Center'</code> it is a margin on both sides. | ||
* «vert»: The vertical alignment. One of <code>'Top'</code>, <code>'Middle'</code>, or <code>'Bottom'</code>. | * «vert»: The vertical alignment. One of <code>'Top'</code>, <code>'Middle'</code>, or <code>'Bottom'</code>. | ||
− | * «vertIndent»: Vertical margin in pixel units. For <code>'Top'</code>, this is a margin above the text, for <code>'Bottom'</code> it is a margin below the text, and for <code>'Middle'</code> it is a margin on both sides. | + | * «vertIndent»: Vertical margin in pixel units. For <code>'Top'</code>, this is a margin above the text, for <code>'Bottom'</code> it is a margin below the text, and for <code>'Middle'</code> it is a margin on both sides.{{Release|6.4|| |
+ | * «wrap»: (''new to [[Analytica 6.4]]'') Specifies whether long text should be word-wrapped (the default starting in [[Analytica 6.4]]). | ||
+ | • «hybridFlags»: (''new to [[Analytica 6.4]]'') A bit field that is only used when you set «horiz» to <code>'Hybrid'</code>. The cell content types set here are right-justified, those not set are left-justified. The bits are: | ||
+ | 1 {{=}} Numbers | ||
+ | 2 {{=}} Dates and times | ||
+ | 4 {{=}} Single-line text | ||
+ | 8 {{=}} Multi-line text | ||
+ | 16 {{=}} Nulls | ||
+ | 32 {{=}} Handles | ||
+ | 1024 {{=}} Other}} | ||
The «horiz» and «vert» parameters also accept <code>'Default'</code>, <code>'Justify'</code>, <code>'Fill'</code>, and <code>'Distributed'</code>. However, these modes are not honored -- instead it just maps to the most appropriate justification among the stated options. When reading cell justifications in an excel spreadsheet, these values are possible (e.g., from [[SpreadsheetCell]] with «what» set to <code>'HorizontalAlignment'</code> or <code>'VerticalAlignment'</code>). | The «horiz» and «vert» parameters also accept <code>'Default'</code>, <code>'Justify'</code>, <code>'Fill'</code>, and <code>'Distributed'</code>. However, these modes are not honored -- instead it just maps to the most appropriate justification among the stated options. When reading cell justifications in an excel spreadsheet, these values are possible (e.g., from [[SpreadsheetCell]] with «what» set to <code>'HorizontalAlignment'</code> or <code>'VerticalAlignment'</code>). |
Revision as of 19:01, 31 August 2023
Release: |
4.6 • 5.0 • 5.1 • 5.2 • 5.3 • 5.4 • 6.0 • 6.1 • 6.2 • 6.3 • 6.4 • 6.5 |
---|
New to Analytica 5.0
CellAlignment( horiz, indent, vert, vertIndent, wrap, hybridFlags )
Specifies the text alignment (justification) or indention for a cell in a table. This is used from within a Cell Format Expression attribute, see Computed cell formats for an overview of using computed formats.
Parameters:
- «horiz»: The horizontal alignment. One of:
'Left'
,'Center'
,'Right'
,'Default'
or'Hybrid'
. - «indent»: An indention amount, in units equal to the width of one space character. For
'Left'
alignment, this is a margin to the left of the text, for'Right'
it is a margin to the right of the text, and for'Center'
it is a margin on both sides. - «vert»: The vertical alignment. One of
'Top'
,'Middle'
, or'Bottom'
. - «vertIndent»: Vertical margin in pixel units. For
'Top'
, this is a margin above the text, for'Bottom'
it is a margin below the text, and for'Middle'
it is a margin on both sides. - «wrap»: (new to Analytica 6.4) Specifies whether long text should be word-wrapped (the default starting in Analytica 6.4).
• «hybridFlags»: (new to Analytica 6.4) A bit field that is only used when you set «horiz» to 'Hybrid'
. The cell content types set here are right-justified, those not set are left-justified. The bits are:
1 = Numbers
2 = Dates and times
4 = Single-line text
8 = Multi-line text
16 = Nulls
32 = Handles
1024 = Other
The «horiz» and «vert» parameters also accept 'Default'
, 'Justify'
, 'Fill'
, and 'Distributed'
. However, these modes are not honored -- instead it just maps to the most appropriate justification among the stated options. When reading cell justifications in an excel spreadsheet, these values are possible (e.g., from SpreadsheetCell with «what» set to 'HorizontalAlignment'
or 'VerticalAlignment'
).
Examples
These would appear in the Cell Format Expression attribute.
CellAlignment( 'Center' )
CellAlignment( If IsNumber(Self) Then 'Right' Else 'Left' )
CellSpan( LineItem, CellAlignment(vert:'Middle'), header:true )
In the next example, there is an index named Place
, and a variable Place_level
indexed by Place
, with a 0 for each state, a 1 for each county, and a 2 for each city.
CellSpan(Place, CellAlignment(indent:Place_level*3), header:true) :![]()
See Also
- Computed cell formats
- CellFormats
- CellSpan
- Other cell format predicates: CellFont, CellBorder, CellBar, CellFill, CellNumberFormat, CellOnClick, CellEntry
Enable comment auto-refresher