| Class | Fox::FXTable |
| In: |
rdoc-sources/FXTable.rb
lib/fox12/core.rb lib/fox12/iterators.rb |
| Parent: | FXScrollArea |
Table Widget
The following messages are sent by FXTable to its target:
| SEL_COMMAND: | sent when a new item is clicked; the message data is an FXTablePos instance indicating the current cell. |
| SEL_KEYPRESS: | sent when a key goes down; the message data is an FXEvent instance. |
| SEL_KEYRELEASE: | sent when a key goes up; the message data is an FXEvent instance. |
| SEL_LEFTBUTTONPRESS: | sent when the left mouse button goes down; the message data is an FXEvent instance. |
| SEL_LEFTBUTTONRELEASE: | sent when the left mouse button goes up; the message data is an FXEvent instance. |
| SEL_RIGHTBUTTONPRESS: | sent when the left mouse button goes down; the message data is an FXEvent instance. |
| SEL_RIGHTBUTTONRELEASE: | sent when the left mouse button goes up; the message data is an FXEvent instance. |
| SEL_SELECTED: | sent when a cell is selected; the message data is an FXTablePos instance indicating the position of the selected cell. |
| SEL_DESELECTED: | sent when a cell is deselected; the message data is an FXTablePos instance indicating the position of the deselected cell. |
| SEL_CHANGED: | sent when the current cell changes; the message data is an FXTablePos instance indicating the current cell. |
| SEL_CLICKED: | sent when a cell is single-clicked; the message data is an FXTablePos instance indicating the current cell. |
| SEL_DOUBLECLICKED: | sent when a cell is double-clicked; the message data is an FXTablePos instance indicating the current cell. |
| SEL_TRIPLECLICKED: | sent when a cell is triple-clicked; the message data is an FXTablePos instance indicating the current cell. |
| SEL_DELETED: | sent when a range of cells is about to be removed; the message data is an FXTableRange instance indicating the cells to be removed. |
| SEL_INSERTED: | sent when a range of cells has been inserted; the message data is an FXTableRange instance indicating the cells inserted. |
| TABLE_COL_SIZABLE: | Columns are resizable |
| TABLE_ROW_SIZABLE: | Rows are resizable |
| TABLE_NO_COLSELECT: | Disallow column selections |
| TABLE_NO_ROWSELECT: | Disallow row selections |
| ID_HORZ_GRID: | x |
| ID_VERT_GRID: | x |
| ID_DELETE_COLUMN: | x |
| ID_DELETE_ROW: | x |
| ID_INSERT_COLUMN: | x |
| ID_INSERT_ROW: | x |
| ID_SELECT_COLUMN_INDEX: | x |
| ID_SELECT_ROW_INDEX: | x |
| ID_SELECT_COLUMN: | x |
| ID_SELECT_ROW: | x |
| ID_SELECT_CELL: | x |
| ID_SELECT_ALL: | x |
| ID_DESELECT_ALL: | x |
| ID_MOVE_LEFT: | x |
| ID_MOVE_RIGHT: | x |
| ID_MOVE_UP: | x |
| ID_MOVE_DOWN: | x |
| ID_MOVE_HOME: | x |
| ID_MOVE_END: | x |
| ID_MOVE_TOP: | x |
| ID_MOVE_BOTTOM: | x |
| ID_MOVE_PAGEDOWN: | x |
| ID_MOVE_PAGEUP: | x |
| ID_MARK: | x |
| ID_EXTEND: | x |
| ID_CUT_SEL: | x |
| ID_COPY_SEL: | x |
| ID_PASTE_SEL: | x |
| ID_DELETE_SEL: | x |
| anchorColumn | [R] | Column number for anchor cell [Integer] |
| anchorRow | [R] | Row number for anchor cell [Integer] |
| baseColor | [RW] | Base GUI color [FXColor] |
| borderColor | [RW] | Border color [FXColor] |
| cellBorderColor | [RW] | Cell border color [FXColor] |
| cellBorderWidth | [RW] | Cell border width, in pixels [Integer] |
| columnHeader | [R] | Column header control [FXHeader] |
| columnHeaderHeight | [RW] | The fixed column header height, if columnHeaderMode is LAYOUT_FIX_HEIGHT. |
| columnHeaderMode | [RW] | The column header height mode is either fixed (LAYOUT_FIX_HEIGHT) or variable. In variable height mode, the column header will size to fit the contents in it. In fixed height mode, the size is explicitly set via the columnHeaderHeight attribute. |
| currentColumn | [R] | Column number for current cell [Integer] |
| currentRow | [R] | Row number for current cell [Integer] |
| defColumnWidth | [RW] | Default column width, in pixels [Integer] |
| defRowHeight | [RW] | Default row height, in pixels [Integer] |
| font | [RW] | Text font [FXFont] |
| gridColor | [RW] | Grid color [FXColor] |
| helpText | [RW] | Status line help text [String] |
| hiliteColor | [RW] | Highlight color [FXColor] |
| leadingCols | [RW] | Number of leading columns [Integer] |
| leadingRows | [RW] | Number of leading rows [Integer] |
| marginBottom | [RW] | Bottom cell margin, in pixels [Integer] |
| marginLeft | [RW] | Left cell margin, in pixels [Integer] |
| marginRight | [RW] | Right cell margin, in pixels [Integer] |
| marginTop | [RW] | Top cell margin, in pixels [Integer] |
| numColumns | [R] | Number of columns [Integer] |
| numRows | [R] | Number of rows [Integer] |
| rowHeader | [R] | Row header control [FXHeader] |
| rowHeaderMode | [RW] | The row header width mode is either fixed (LAYOUT_FIX_WIDTH) or variable. In variable width mode, the row header will size to fit the contents in it. In fixed width mode, the size is explicitly set via the rowHeaderWidth attribute. |
| rowHeaderWidth | [RW] | The fixed row header width, if rowHeaderMode is LAYOUT_FIX_WIDTH. |
| selBackColor | [RW] | Background color for selected cell(s) [FXColor] |
| selEndColumn | [R] | Ending column number for selection, or -1 if there is no selection [Integer] |
| selEndRow | [R] | Ending row number for selection, or -1 if there is no selection [Integer] |
| selStartColumn | [R] | Starting column number for selection, or -1 if there is no selection [Integer] |
| selStartRow | [R] | Starting row number for selection, or -1 if there is no selection [Integer] |
| selTextColor | [RW] | Text color for selected cell(s) [FXColor] |
| shadowColor | [RW] | Shadow color [FXColor] |
| stippleColor | [RW] | Stipple color [FXColor] |
| tableStyle | [RW] | Table style [Integer] |
| textColor | [RW] | Text color [FXColor] |
| trailingCols | [RW] | Number of trailing columns [Integer] |
| trailingRows | [RW] | Number of trailing rows [Integer] |
| visibleCols | [RW] | Number of visible columns [Integer] |
| visibleRows | [RW] | Number of visible rows [Integer] |
Construct a new FXTable instance. The table is initially empty, and reports a default size based on the scroll areas’s scrollbar placement policy.
| p: | the parent window for this table [FXComposite] |
| tgt: | the message target (if any) for this table [FXObject] |
| sel: | the message identifier for this table [Integer] |
| opts: | table options [Integer] |
| x: | initial x-position [Integer] |
| y: | initial y-position [Integer] |
| w: | initial width [Integer] |
| h: | initial height [Integer] |
| pl: | internal padding on the left side, in pixels [Integer] |
| pr: | internal padding on the right side, in pixels [Integer] |
| pt: | internal padding on the top side, in pixels [Integer] |
| pb: | internal padding on the bottom side, in pixels [Integer] |
Append numColumns columns to the right of the table.. If notify is true, a SEL_INSERTED message is sent to the tableÕs message target for each cell that is inserted.
Append numRows rows to the bottom of the table.. If notify is true, a SEL_INSERTED message is sent to the tableÕs message target for each cell that is inserted.
Remove all items from table. If notify is true, a SEL_DELETED message is sent to the table’s message target before the cells are removed.
Determine column containing x. Returns -1 if x is to the left of the first column, and numColumns if x is to the right of the last column. Otherwise, returns the column in the table containing x.
Calls block once for each column in the table, passing an array of references (one element per row) as a parameter.
Calls block once for each row in the table, passing an array of references (one element per column) as a parameter.
Extend selection. If notify is true, a series of SEL_SELECTED and SEL_DESELECTED messages are sent to the table’s message target after each affected item is selected or deselected. Raises IndexError if either row or column is out of bounds.
Extract the text from all the cells in the specified range and return the result as a string. Within the result string, each column’s text is delimited by the character specified by cs, and each row is delimited by the character specified by rs. To reverse this operation (i.e. set the table cells’ text from a string), see overlayText. Raises IndexError if any of startrow, endrow, startcol or endcol is out of bounds.
| startrow: | the starting row for the range [Integer] |
| endrow: | the ending row for the range [Integer] |
| startcol: | the starting column for the range [Integer] |
| endcol: | the ending column for the range [Integer] |
| cs: | the character to insert at each column break [String] |
| rs: | the character to insert at each row break [String] |
Obtain cell background color. The values for row and column are either zero or one. If the value is zero, returns the background color used for even-numbered rows (columns). If the value is one, returns the background color used for odd-numbered rows (columns). See also setCellColor.
Return the item (a reference to an FXTableItem) at the given row and column. Raises IndexError if either row or column is out of bounds.
Return the border style for the cell at (r, c). Raises IndexError if either r or c is out of bounds.
Return the relative position of the icon and text for the cell at (r, c). Raises IndexError if either r or c is out of bounds.
Return item justification for the cell at (r, c). Raises IndexError if either r or c is out of bounds.
Return the background stipple style for the cell at (r, c). Raises IndexError if either r or c is out of bounds.
Return cell text for item at specified row and column. Raises IndexError if either row or column is out of bounds.
Insert numColumns columns beginning at the specified column number. If column is equal to the number of columns in the table, the new columns are added to the right of the table. If notify is true, a SEL_INSERTED message is sent to the table’s message target for each cell that is inserted. Raises IndexError if column is out of bounds.
Insert numRows rows beginning at the specified row number. If row is equal to the number of rows in the table, the new rows are added to the bottom of the table. If notify is true, a SEL_INSERTED message is sent to the table’s message target for each cell that is inserted. Raises IndexError if row is out of bounds.
Returns true if the cell at position (row, column) is the current cell. Raises IndexError if either row or column is out of bounds.
Returns true if the cell at position (row, column) is enabled. Raises IndexError if either row or column is out of bounds.
Returns true if the cell at position (row, column) is selected. Raises IndexError if either row or column is out of bounds.
Return true if the cell at position (r, c) is a spanning cell. Raises IndexError if either r or c is out of bounds.
Returns true if the cell at position (row, column) is visible. Raises IndexError if either row or column is out of bounds.
Kill selection. If notify is true, a SEL_DESELECTED message is sent to the table’s message target for each cell that was previously selected.
Scroll to make cell at (row, column) fully visible. Raises IndexError if either row or column is out of bounds.
Overlay the text for the cells in the specified range with the fields specified in text. Within the text string, each column’s text should delimited by the character specified by cs, and each row should be delimited by the character specified by rs. To reverse this operation (i.e. extract the table cells’ text into a string), see extractText. Raises IndexError if any of startrow, endrow, startcol or endcol is out of bounds.
| startrow: | the starting row for the range [Integer] |
| endrow: | the ending row for the range [Integer] |
| startcol: | the starting column for the range [Integer] |
| endcol: | the ending column for the range [Integer] |
| text: | the text containing the new cell text [String] |
| cs: | the character to insert at each column break [String] |
| rs: | the character to insert at each row break [String] |
Remove the nc columns starting at the specified column. If notify is true, a SEL_DELETED message is sent to the table’s message target for each cell that is removed. Raises IndexError if column is less than zero, or if column + nc is greater than the current number of table columns.
Remove item at (row, col), replacing it with nil. If notify is true, a SEL_REPLACED message is sent to the table’s message target before this cell is removed. Raises IndexError if either row or col is out of bounds.
Remove all cells in the specified range of rows and columns. If notify is true, a SEL_REPLACED message is sent to the table’s message target before each cell is removed. Raises IndexError if startrow, endrow, startcol or endcol is out of bounds.
Remove the nr rows starting at the specified row. If notify is true, a SEL_DELETED message is sent to the table’s message target for each cell that is removed. Raises IndexError if row is less than zero, or if row + nr is greater than the current number of table rows.
Determine row containing y. Returns -1 if y is above the first row, and numRows if y is below the last row. Otherwise, returns the row in the table containing y.
Select a column of cells. If notify is true, a SEL_DESELECTED message is sent to the table’s message target for each previously selected cell that becomes deselected as a result of this operation. Likewise, a SEL_SELECTED message is sent to the table’s message target for each newly-selected cell. Raises IndexError if col is out of bounds.
Select cell at (row, col). If notify is true, a SEL_SELECTED message is sent to the table’s message target after the item is selected. Raises IndexError if either row or col is out of bounds.
Select range. If notify is true, a SEL_DESELECTED message is sent to the table’s message target for each previously selected cell that becomes deselected as a result of this operation. Likewise, a SEL_SELECTED message is sent to the table’s message target for each newly-selected cell. Raises IndexError if startRow, endRow, startColumn or endColumn is out of bounds.
Select a row of cells. If notify is true, a SEL_DESELECTED message is sent to the table’s message target for each previously selected cell that becomes deselected as a result of this operation. Likewise, a SEL_SELECTED message is sent to the table’s message target for each newly-selected cell. Raises IndexError if row is out of bounds.
Change cell background color. The values for row and column are either zero or one. If the value is zero, this background color is used for even-numbered rows (columns). If the value is one, this background color is used for odd-numbered rows (columns). See also getCellColor.
Change current cell. If notify is true, a SEL_CHANGED message is sent to the table’s message target after the current item changes. Raises IndexError if either row or column is out of bounds.
Replace the item at the given row and column with a (possibly subclassed) item. Raises IndexError if either row or column is out of bounds.
Set the relative position of the icon and text for the cell at (r, c). Raises IndexError if either r or c is out of bounds.
Set the background stipple style for the cell at (r, c). Raises IndexError if either r or c is out of bounds.
Modify cell text for item at specified row and column. Raises IndexError if either row or column is out of bounds.
Resize the table content to numRows rows and numCols columns. Note that all existing items in the table will be destroyed and new items will be constructed. If notify is true, then
Raises ArgError if either numRows or numCols is less than zero.
Show or hide horizontal grid. Note that this is equivalent to the horizontalGridShown=() method.
Show or hide vertical grid. Note that this is equivalent to the verticalGridShown=() method.