Column customization
The table columns can be configured through various resources and functions. Resources define the behavior and appearance of the column. Functions are messages that can be sent to the column to tell it to do something after the table containing the column has been created.
The CwTableColumn is responsible for the appearance of user data in a single column of cells in the table. In fulfilling the responsibility, the CwTableColumn collaborates with the user data and an internal class to the table, the CwTableItem, which internally represents a single row in the table. Each cell in a row is represented by a subitem of the CwTableItem.
The CwTableColumn also controls the appearance of the column headers. The following protocol pertains to how a column can be customized before it is presented to the CwTable, or before the table becomes visible.
Note:
Some customzations work after the table becomes visible; others require the table coumns or the data the table holds to be reasserted.
alignment
Specifies the horizontal alignment for text or pixmap.Default setting: XmALIGNMENTCENTER.
Resource access: CSG.
Answers: Integer One of the following:
•XmALIGNMENTCENTER (center alignment) - causes the centers of the lines of text to be vertically aligned in the center of the widget window. For a pixmap, its
•center is vertically aligned with the center of the widget window.
•XmALIGNMENTEND (right alignment) - causes the right sides of the lines of text to be vertically aligned with the right edge of the widget window. For a pixmap, its
•right side is vertically aligned with the right edge of the widget window.
•XmALIGNMENTBEGINNING (left alignment) - causes the left sides of the lines of text to be vertically aligned with the left edge of the widget window. For a pixmap, its left side is vertically aligned with the left edge of the widget window.
alignment: Integer
Specifies the label alignment for text or pixmap.
attributeName
Specifies the symbol to be performed in order to retrieve the (string) data displayed in the cells in the table column represented by the receiver. .
Default setting: empty symbol.
Resource access: CSG.
Answers::<Symbol>
attributeName: aSymbol
Specifies the symbol to be performed in order to retrieve the (string) data displayed in the cells in the table column represented by the receiver. .
Default setting: empty symbol.
Resource access: CSG.
Answers::<Symbol>
backgroundColor
Specifies the background color of the receiver. .
Answers: <Color | nil>
backgroundColor: Color
Specifies the background color of the receiver.
converter
Answer the receiver’s converter. .
The converter handles the formatting of the user data appearing in the column. .
Answer nil if the receiver has no converter. In this case, cells in the table column must contain strings. .
Default setting: nil.
Answers: CwConverter
converter: aCwConverter
Set the receiver’s converter.
fixedWidth
Indicates whether user can resize the receiver . If so, the user can drag the right side of the column to change the column width. .
Default setting: false (not fixed with) .
Resource access: CSG.
Answers: Boolean
fixedWidth: Boolean
Indicates whether user can resize the receiver . If so, the user can drag the right side of the column to change the column width.
foregroundColor
Specifies the foreground color of the receiver. .
Answers: <Color | nil>
foregroundColor: aColor
Specifies the foreground color of the receiver.
heading
Specifies the heading object to be displayed at the top. of the column. The height of the heading row is the maximum of the heights of the headings of the columns. .
Default setting: ''.
Resource access: CSG.
Arguments: String
heading: aString
Specifies the heading object to be displayed at the top. of the column
image
Specifies the image displayed in the column header.
Default setting: nil.
Answers: <CgPixmap> or <CgIcon>
image: aResource
Specifies the image displayed in the column header
imageOnRight
Indicates whether the image appears to the right of any text. .
Default is false. .
Answers: <Boolean>
imageOnRight: aBoolean
Indicates whether the image appears to the right of any text.
orderIndex
Specifies the left to right position of receiver in the list of columns to appear in the table. .
Answers: Integer
orderIndex: anInteger
Specifies the left to right position of receiver in the list of columns to appear in the table.
resizable
Specify whether the receiver has a fixed or a variable width. If so, the user can drag the right side of the column to change the column width
Default setting: true.
Resource access: CSG.
Answers: Boolean
resizable: aBoolean
Specify whether the receiver has a fixed or a variable width.
width
Specifies width of the column in the table. .
Default setting: 50.
Resource access: CSG.
Arguments: <Integer> a positive Integer
width: anInteger
Specifies width of the column in the table. .
Default setting: 50.
Resource access: CSG.
Arguments: <Integer>
Last modified date: 01/18/2024