DocumentTools[Layout] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Document Tools : Layout : DocumentTools/Layout/Cell

DocumentTools[Layout]

  

Cell

  

generate XML for a Cell element

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Cell( c, opts )

Parameters

c

-

(optional) ; content for the Cell

opts

-

(optional) ; one or more keyword options as described below

Options

• 

backgroundstyle : nonnegint:=0 ; Specifies whether the fillcolor option will be respected (1) or ignored (0).

• 

columnspan : nonnegint:=1 ; Specifies how many columns to the right the Cell will span.

• 

fillcolor : {list(nonnegint),symbol,string}:=[255,255,255] ; Specifies the background color of the Cell. The passed value can be either a named color or a list of three integers each between 0 and 255. A list of nonnegative integers is interpreted as RGB values in a 24bit 3-channel color space. The default value is [255,255,255] which corresponds to white.

• 

padding : nonnegint:=NULL ; The number of pixels of padding for the Cell.

• 

rowspan : nonnegint:=1 ; Specifies how many rows downwards the Cell will span.

• 

visible : truefalse:=true ; Specifies whether the cell is visible or hidden

Description

• 

The Cell command in the Layout Constructors package returns an XML function call which represents a Cell element of a worksheet Table.

• 

The generated XML may be used with the results of other commands in the Layout Constructors package to create an entire Worksheet or Document in XML form. Such a representation of a Worksheet or Document may be inserted into the current document using the InsertContent command.

Examples

withDocumentTools:

withDocumentTools:-Layout:

Executing the Cell command produces a function call.

CCellTextfieldSome text

C_XML_Table-Cellcolumnspan=1,backgroundstyle=0,rowspan=1,fillcolor=[255,255,255],visible=true,_XML_Text-fieldalignment=centred,style=Text,layout=Normal,Some text

(1)

By using additional commands from the Layout Constructors package a nested function call can be produced which represents an entire worksheet.

The following example produces a Table, T consisting of a single column and a single row. The contents of the row is C, the Cell element created above.

TTableColumn,RowC:

xmlWorksheetT:

That XML representation of a worksheet can be inserted directly.

InsertContentxml:

Some text

The next example illustrates using a color to fill the background of a Cell.

CCellTextfieldSome text,fillcolor=gold:TTableColumn,RowC:InsertContentWorksheetT:

Some text

Using a fill color on a Cell is an effective way to show a 3D plot with a black background. The next example uses the InlinePlot element constructor for the content of the Cell.

PInlinePlotplot3dx2siny,x=1..1,y=2π..2π,axes=none:CCellTextfieldP,fillcolor=black:TTableColumn,RowC,widthmode=pixels,width=300,alignment=center:InsertContentWorksheetT:

The content of the Cell can be padded by a specified number of pixels.

CCellTextfieldAgTy,padding=50:TTableColumn,RowC:InsertContentWorksheetT:

AgTy

CCellTextfieldAgTy,padding=0:TTableColumn,RowC:InsertContentWorksheetT:

AgTy

Vertical alignment within a Cell is a property of its parent Row, for which the default is top alignment. Note the difference in alignment between the two Cells on the left.

C1CellTextfieldSome text:C2CellTextfieldstyle=TwoDimOutput,Equationsqrtexpt2πΓx:TTableColumn,Column,RowC1,C2,RowC1,C2,align=center:InsertContentWorksheetT:

Some text

ⅇt2πΓx

Some text

ⅇt2πΓx

Horizontal alignment within a Cell is a property of the content (child element) of the Cell.

C1CellTextfieldSome text,alignment=right:

C2CellTableColumn,RowCell,widthmode=pixels,width=50,alignment=center:

C3CellTextfieldOther text,alignment=left:

TTableColumn,Column,Column,RowC1,C2,C3:InsertContentWorksheetT:

Some text

 

Other text

A cell may span more than a single Column or Row of a Table.

TTableColumn,Column,Column,RowCellcolumnspan=2,Cell:InsertContentWorksheetT:

 

 

Parsing of Cells is done Row by Row.

TTableColumn,Column,Column,widthmode=pixels,width=90,alignment=center,RowCellA,columnspan=2,CellA,rowspan=2,RowCellB,rowspan=2,CellB,RowCellC,columnspan=2:InsertContentWorksheetT:

A

A

B

B

C

TTableColumn,Column,Column,widthmode=pixels,width=90,alignment=center,RowCellA,rowspan=2,CellA,columnspan=2,RowCellB,CellB,rowspan=2,RowCellC,columnspan=2:InsertContentWorksheetT:

A

A

B

B

C

Compatibility

• 

The DocumentTools:-Layout:-Cell command was introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.

• 

The DocumentTools:-Layout:-Cell command was updated in Maple 2016.

• 

The visible option was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

Component Constructors

DocumentTools

InsertContent

Layout Constructors

XMLTools