The programmer chooses how the objects in the table will be viewed by defining a collection of fields, one for each column. These fields are each instances of the class WkColumnView, and describe the header, font, justification, field width, fore and back color, validation functions and accessor methods for a particular column. The header is the string that will be displayed at the top of the listbox for that field. The font is the font used to display the column. The justification can be one of left, right, and center. The field width is the number of pixels wide that this field should be; if it is autosizable, the field will be as wide as the widest value displayed in this column. The fore and back colors affect the presentation of data in the cells. The validation functions can be any of those supported by WbEnhancedText. The accessor methods are the messages which will be sent to the object to retrieve a string to display for this field and to update the object when the user changes a cell’s value.
The objects used for cell values and headings are typically Strings, Numbers, and CgIcons, but this is not a requirement. It is possible for an application to use any object as the cell value or heading. Any item which understands #ewHeightUsing:, #ewWidthUsing: and #ewDrawUsing: (called a “renderable object”) can be used for a cell value. Since String, Number, and CgIcon already implement the standard renderable object protocol, they can easily be used. Also, since Object provides default renderable behavior, any object can be rendered, although the default rendering is to render the object’s printString.
addedItems: itemsOrderedCollection at: indicesOrderedCollection
Item(s) were added to the collection of root items at the specified position. The position is specified as an index in the collection of root items only. Refresh the list.
atRow: row column:
columnAnswer the string that is at
column@
row. If there is no value, an empty string will be returned. If there are labels (or name) associated with a given row or column, the argument for that coordinate may be a string corresponding to the label (or column name). Example include: 1@'Name', 'Name'@1, 'Name'@'Year', 1@1
atRow: row column: column put:
newValueSet the value that is at
column@
row to
newValue. If there are labels (or name) associated with a given row or column, the argument for that coordinate may be a string corresponding to the label (or column name). Example include: 1@'Name', 'Name'@1, 'Name'@'Year', 1@1
autosize: aBooleanSpecifies whether the autosizable columns should be autosized whenever the widget resizes.
cellAt:
aPointAnswer the value that is at aPoint.
cellAt: aPoint put:
newValueSet the value that is at aPoint to newValue.
collapseItem:
anItemCollapse the hierarchy rooted at
anItem.
columns: anArraySet the collection of columns.
cursorPolicy: anIntegerSpecifies how cursor keys will be treated.
deferRefreshWhile:
aBlockMinimize the repainting done while aBlock is being evaluated. This message may be safely nested. This message does not guarantee minimal repainting. Rather, it serves as a hint to the widget so that, where possible and appropriate, repainting can be deferred until the block has finished being evaluated.
deselectAllItems
Deselect and remove all elements from the selectedItems list. A selection event is not triggered.
deselectCell: cellPointDeselect a cell by item and column position. A selection event is not triggered. This function is only valid if the selectionPolicy value is XmCELLSINGLESELECT.
deselectColumn: columnDeselect the column given. This message unhighlights the heading of the specified column.
deselectIndex: anIntegerDeselect and remove an item from the selected list by position.
deselectItem: itemDeselect and remove the specified item from the selected list. A selection event is not triggered.
disabledAttributeName: aSymbolSpecifies selector sent to the row object to determine whether the row should be disabled.
editable: aBoolean
Specifies whether the cells in the table are editable. For a cell to be editable, the table widget must be editable, the column must be editable, and the application must hook the About To Begin Edit event and set the callData doit to true
editCellAt: cellPointEdit a cell in the list by item and column position. This message highlights a table cell at the specified point and begins editing on it by calling the About To Begin Edit event. If editing is already in progress, the endEdit API will be invoked and if the end edit is successful, editing for the new cell will begin. This API will provide cell editing behavior independent of the values of the WkTableWidget>>editable, WkTableColumn>>editable, and WkTableWidget>>selectionPolicy resources. It is used to trigger editing by some means other than cell selection.
editSelectedCell
Begin editing the selected cell. If editable is true, this message is not needed, since selecting a cell automatically edits it. Otherwise, this calls the About To Begin Edit event. If editing is already in progress, the endEdit API will be invoked and if the end edit is successful, editing for the new cell will begin.
endEdit
Call the end edit events and proceed with an end to the edit if approved. Hide the edit widget only if the end was approved. Answer whether the end was approved.
expandItem:
anItemExpand the hierarchy rooted at
anItem.
firstColumnPosition: positionMake a column the first visible column by position. This message makes the column at the given position the first visible column. If this column is locked, this message has no effect. If there are locked columns and this column is not locked, then this column becomes the first column visible beyond the locked columns.
headingSeparatorThickness: anInteger
Specifies the thickness of the horizontal line separating the column headings from the rest of the table.
hierarchyPolicy: resourceValueSpecifies how to display and manage the hierarchy. For more information about hierarchy policies, refer to EwHierarchy and its subclasses.
indexAtPoint: aPointAnswer the index of the item in the list which lies beneath the point given. If no item lies beneath the point or if the widget has not been drawn yet, then answer nil.
indexOfItem: itemAnswer the index of the item given in the list or 0 if the item is not present in the list.
isItemExpanded: anItemAnswer whether an item in the list is expanded to show its children.
itemAtPoint: aPointAnswer the item in the list which lies beneath the point given.If no item lies beneath the point, then answer nil.
itemChildrenAttributes: aDictionarySpecifies a collection of selectors (indexed by item class) sent to an item to return its children.
itemCount
Specifies the total number of items. This number might not match XmNitems, since this number is the size of the expanded hierarchy. It is automatically updated by the list whenever an element is added to or deleted from the list."
itemHasChildrenAttributes: aDictionarySpecifies a collection of selectors (indexed by item class) sent to an item to return whether it has children.
itemHeight: anInteger
Specifies the height in pixels of items in the list. This includes the margin height on the top and bottom of the item as well as two pixels for emphasis.
itemIsVisible: itemCheck if a specified item is in the portion of the list that is currently visible. Answer true if it is even partially visible, false if it is not visible.
items: anOrderedCollection
An array of objects that are to be displayed as the list items.
itemsDo: aBlockEvaluate aBlock for each item in the receiver's list.
lastColumnPosition: anInteger
Make a column the last visible column by position. This message makes the column at the given position the last visible column. If this column is locked, this message has no effect. If there are locked columns and this column is not locked, then this column becomes the last column visible.
lockedColumns: anInteger
Specifies the number of columns to be locked down on the left side of the table. A column can be locked only if its preceding column is also locked. When scrolling, the locked columns remain fixed on the left side and all other columns scroll under the locked columns. This value must be no greater than the number of columns.
parentOfItem: anItemAnswer the parent of the item given in the hierarchy or false if it is not in the expanded hierarchy. Answer nil if it is a root item.
refreshCell: cellPointRefresh a cell by item and column position.
refreshColumn: aColumnRefresh all of the cells in the specified column.
refreshItems: aCollectionRefresh all of the items in the collection.
removedItems: itemsOrderedCollection at: indicesOrderedCollectionIdentifies what items were removed from the items attribute ordered collection and at what index. Only the items identified will be refreshed.
reorderableColumns: aBooleanSpecifies whether all of the columns should be reorderable (can be dragged left and right).
resizableColumns: aBooleanSpecifies whether all of the columns should be resizable by the user. If so, the user can drag the right side of a column heading to change the column width.
rowSeparators: aBoolean
Specifies whether the rows are separated by a horizontal line.
scrollableDown
Answers false if the list is all the way at the bottom item.
scrollableUp
Answers false if the list is all the way at the top item.
scrollUp
Scrolls the list box up one item.
selectableColumns: aBoolean
Defines whether the user may select columns by clicking on their headings.
selectColumn: columnSelect the column given. This message selects the heading of the specified column.
selectCell: cellPoint Select a cell in the list by item and column position. This message selects a cell at the specified point and makes it be the selected cell. If editing is in progress, the endEdit API will be invoked and selection will proceed only if the edit is ended successfully. If the specified cell is editable, the About To Begin Edit event will be fired (i.e., the table is editable and the cell's column is editable).
selectColumn: columnSelect the column given. This message selects the heading of the specified column.
selectedCell
Specifies a Point whose x component is the index of the column of the selected cell and whose y component is the index of the item (row) of the selected cell. If nil, then no cell is selected. Note: This resource is only relevant if the selection policy is XmCELLSINGLESELECT."
selectedItems: anOrderedCollection
An OrderedCollection of Objects that represents the list items that are currently selected, either by the user or the application.
selectionIndices: anOrderedCollection
An OrderedCollection of Integers that represents the indices of the list items that are currently selected, either by the user or the application.
separatorsToExtremes: aBoolean
Defines whether row and column separators are to be extended to the extreme right and bottom edges of the table.
setBottomIndex: positionMake an item the last visible item in the list by position. This message makes the item at the specified position the last visible item in the list.
setBottomItem: itemMake the given item the last visible item in the list. The item can be any valid item in the list.
setTopIndex: positionMake an item the first visible item in the list by position. This message makes the item at the given position the first visible position in the list.
setTopItem: itemMake the given item the first visible item in the list. The item can be any valid item in the list.
showGrid: aBooleanSet whether horizontal and vertical grid lines should be displayed.
showLines: aBooleanSet whether vertical separator lines should be displayed.
sortableColumns: aBooleanSpecifies whether all of the columns should be sortable.
sortOn: column ascending: aBooleanSort the items based on <column> either ascending or descending.
topItemIndex: anInteger
Specifies the Integer position of the item that is the first visible item in the list.
visibleItemCount
Specifies the number of items that can fit in the visible space of the list. Until the list is realized, this answers 0.
visualStyle: anInteger
Defines the how the cells are displayed.
Item Expand
These events are triggered when an item is expanded.
Losing Focus
These events are triggered the part loses focus.
Resized
These events are triggered when the part is resized.
Scrolled
These events are triggered when the part is scrolled.
SortedOn
These events are triggered when a column in the part is sorted.
SortedOnIndex
These events are triggered when a column in the part is sorted.
Copyright 2005, 2017 Instantiations, Inc. All rights reserved.