Class: Fox::FXTable

Inherits:
FXScrollArea show all
Includes:
Enumerable
Defined in:
rdoc-sources/FXTable.rb,
lib/fox16/core.rb,
lib/fox16/iterators.rb

Overview

The FXTable widget displays a table of items, each with some text and optional icon. A column Header control provide captions for each column, and a row Header control provides captions for each row. Columns are resizable by means of the column Header control if the TABLE_COL_SIZABLE option is passed. Likewise, rows in the table are resizable if the TABLE_ROW_SIZABLE option is specified. An entire row (column) can be selected by clicking on the a button in the row (column) Header control. Passing TABLE_NO_COLSELECT disables column selection, and passing TABLE_NO_ROWSELECT disables column selection. When TABLE_COL_RENUMBER is specified, columns are automatically renumbered when columns are added or removed. Similarly, TABLE_ROW_RENUMBER will cause row numbers to be recalculated automatically when rows are added or removed. To disable editing of cells in the table, the TABLE_READONLY can be specified. Cells in the table may or may not have items in them. When populating a cell for the first time, an item will be automatically created if necessary. Thus, a cell in the table takes no space unless it has actual contents. Moreover, a contiguous, rectangular region of cells in the table may refer to one single item; in that case, the item will be stretched to cover all the cells in the region, and no grid lines will be drawn interior to the spanning item.

The Table widget issues SEL_SELECTED or SEL_DESELECTED when cells are selected or deselected, respectively. The table position affected is passed along as the 3rd parameter of these messages. Whenever the current (focus) item is changed, a SEL_CHANGED message is sent with the new table position as a parameter. When items are added to the table, a SEL_INSERTED message is sent, with the table range of the newly added cells as the parameter in the message. When items are removed from the table, a SEL_DELETED message is sent prior to the removal of the items, and the table range of the removed cells is passed as a parameter. A SEL_REPLACED message is sent when the contents of a cell are changed, either through editing or by other means; the parameter is the range of affected cells. This message is sent prior to the change. SEL_CLICKED, SEL_DOUBLECLICKED, and SEL_TRIPLECLICKED messages are sent when a cell is clicked, double-clicked, or triple-clicked, respectively. A SEL_COMMAND is sent when an enabled item is clicked inside the table.

Events

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.

SEL_REPLACED

sent when a range of cells has been replaced; the message data is an FXTableRange instance indicating the cells replaced.

Table options

TABLE_COL_SIZABLE

Columns are resizable

TABLE_ROW_SIZABLE

Rows are resizable

TABLE_NO_COLSELECT

Disallow column selections

TABLE_NO_ROWSELECT

Disallow row selections

TABLE_READONLY

Table is not editable

TABLE_COL_RENUMBER

Renumber columns

TABLE_ROW_RENUMBER

Renumber rows

Message identifiers

ID_HORZ_GRID

x

ID_VERT_GRID

x

ID_TOGGLE_EDITABLE

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_START_INPUT

x

ID_CANCEL_INPUT

x

ID_ACCEPT_INPUT

x

ID_MARK

x

ID_EXTEND

x

ID_CUT_SEL

x

ID_COPY_SEL

x

ID_PASTE_SEL

x

ID_DELETE_SEL

x

Instance Attribute Summary collapse

Attributes inherited from FXScrollArea

#contentHeight, #contentWidth, #horizontalScrollBar, #scrollStyle, #verticalScrollBar, #viewportHeight, #viewportWidth, #xPosition, #yPosition

Attributes inherited from FXWindow

#accelTable, #backColor, #defaultCursor, #dragCursor, #focus, #key, #last, #layoutHints, #next, #numChildren, #owner, #parent, #prev, #root, #selector, #shell, #target, #x, #y

Attributes inherited from FXDrawable

#height, #visual, #width

Attributes inherited from FXId

#app, #userData, #xid

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FXScrollArea

#horizontalScrollable?, #position, #scrollCorner, #setPosition, #verticalScrollable?

Methods inherited from FXComposite

#maxChildHeight, #maxChildWidth

Methods inherited from FXWindow

#acceptDrop, #acquireClipboard, #acquireSelection, #active?, #addHotKey, #after?, after?, #before?, before?, #beginDrag, #canFocus?, #changeFocus, #childAtIndex, #childOf?, #children, #clearDragRectangle, #clearShape, colorType, colorTypeName, commonAncestor, #composeContext, #composite?, #contains?, #containsChild?, #create, #createComposeContext, #cursorPosition, #default?, #defaultHeight, #defaultWidth, deleteType, deleteTypeName, #destroy, #destroyComposeContext, #detach, #didAccept, #disable, #doesSaveUnder?, #dragging?, #dropDisable, #dropEnable, #dropEnabled?, #dropFinished, #dropTarget?, #each_child, #each_child_recursive, #enable, #enabled?, #endDrag, #forceRefresh, #getChildAt, #getDNDData, #getHeightForWidth, #getWidthForHeight, #grab, #grabKeyboard, #grabbed?, #grabbedKeyboard?, #handleDrag, #hasClipboard?, #hasFocus?, #hasSelection?, #height, #height=, #hide, imageType, #inFocusChain?, #indexOfChild, #initial?, #inquireDNDAction, #inquireDNDTypes, #killFocus, #layout, #linkAfter, #linkBefore, #lower, #move, octetType, octetTypeName, #offeredDNDType?, #position, #raiseWindow, #recalc, #releaseClipboard, #releaseSelection, #remHotKey, #removeChild, #repaint, #reparent, #resize, #scroll, #setCursorPosition, #setDNDData, #setDefault, #setDragRectangle, #setFocus, #setInitial, #setShape, #shell?, #show, #shown?, stringType, textType, textTypeName, #tr, #translateCoordinatesFrom, #translateCoordinatesTo, #underCursor?, #ungrab, #ungrabKeyboard, #update, urilistType, urilistTypeName, utf16Type, utf16TypeName, utf8Type, utf8TypeName, #visible=, #width, #width=

Methods included from Responder2

#connect

Methods inherited from FXDrawable

#resize

Methods inherited from FXId

#create, #created?, #destroy, #detach, #runOnUiThread

Methods inherited from FXObject

#bind, #handle, #load, #save, subclasses

Constructor Details

#initialize(p, target = nil, selector = 0, opts = 0, x = 0, y = 0, width = 0, height = 0, padLeft = DEFAULT_MARGIN, padRight = DEFAULT_MARGIN, padTop = DEFAULT_MARGIN, padBottom = DEFAULT_MARGIN) ⇒ FXTable

Construct a new FXTable instance. The table is initially empty, and reports a default size based on the scroll areas’s scrollbar placement policy.

Parameters:

p

the parent window for this table Fox::FXComposite

target

the message target (if any) for this table Fox::FXObject

selector

the message identifier for this table [Integer]

opts

table options [Integer]

x

initial x-position [Integer]

y

initial y-position [Integer]

width

initial width [Integer]

height

initial height [Integer]

padLeft

internal padding on the left side, in pixels [Integer]

padRight

internal padding on the right side, in pixels [Integer]

padTop

internal padding on the top side, in pixels [Integer]

padBottom

internal padding on the bottom side, in pixels [Integer]



419
420
# File 'rdoc-sources/FXTable.rb', line 419

def initialize(p, target=nil, selector=0, opts=0, x=0, y=0, width=0, height=0, padLeft=DEFAULT_MARGIN, padRight=DEFAULT_MARGIN, padTop=DEFAULT_MARGIN, padBottom=DEFAULT_MARGIN) # :yields: theTable
end

Instance Attribute Details

#anchorColumnObject (readonly)

Column number for anchor cell [Integer]



340
341
342
# File 'rdoc-sources/FXTable.rb', line 340

def anchorColumn
  @anchorColumn
end

#anchorRowObject (readonly)

Row number for anchor cell [Integer]



337
338
339
# File 'rdoc-sources/FXTable.rb', line 337

def anchorRow
  @anchorRow
end

#baseColorObject

Base GUI color Fox::FXColor



361
362
363
# File 'rdoc-sources/FXTable.rb', line 361

def baseColor
  @baseColor
end

#borderColorObject

Border color Fox::FXColor



370
371
372
# File 'rdoc-sources/FXTable.rb', line 370

def borderColor
  @borderColor
end

#cellBorderColorObject

Cell border color Fox::FXColor



385
386
387
# File 'rdoc-sources/FXTable.rb', line 385

def cellBorderColor
  @cellBorderColor
end

#cellBorderWidthObject

Cell border width, in pixels [Integer]



388
389
390
# File 'rdoc-sources/FXTable.rb', line 388

def cellBorderWidth
  @cellBorderWidth
end

#columnHeaderObject (readonly)

Column header control Fox::FXHeader



268
269
270
# File 'rdoc-sources/FXTable.rb', line 268

def columnHeader
  @columnHeader
end

#columnHeaderFontObject

Column header font Fox::FXFont



316
317
318
# File 'rdoc-sources/FXTable.rb', line 316

def columnHeaderFont
  @columnHeaderFont
end

#columnHeaderHeightObject

The fixed column header height, if columnHeaderMode is LAYOUT_FIX_HEIGHT.



319
320
321
# File 'rdoc-sources/FXTable.rb', line 319

def columnHeaderHeight
  @columnHeaderHeight
end

#columnHeaderModeObject

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.



304
305
306
# File 'rdoc-sources/FXTable.rb', line 304

def columnHeaderMode
  @columnHeaderMode
end

#cornerButtonObject (readonly)

Button in the upper left corner Fox::FXButton



265
266
267
# File 'rdoc-sources/FXTable.rb', line 265

def cornerButton
  @cornerButton
end

#currentColumnObject (readonly)

Column number for current cell [Integer]



334
335
336
# File 'rdoc-sources/FXTable.rb', line 334

def currentColumn
  @currentColumn
end

#currentRowObject (readonly)

Row number for current cell [Integer]



331
332
333
# File 'rdoc-sources/FXTable.rb', line 331

def currentRow
  @currentRow
end

#defColumnWidthObject

Default column width, in pixels [Integer]



325
326
327
# File 'rdoc-sources/FXTable.rb', line 325

def defColumnWidth
  @defColumnWidth
end

#defRowHeightObject

Default row height, in pixels [Integer]



328
329
330
# File 'rdoc-sources/FXTable.rb', line 328

def defRowHeight
  @defRowHeight
end

#fontObject

Text font Fox::FXFont



355
356
357
# File 'rdoc-sources/FXTable.rb', line 355

def font
  @font
end

#gridColorObject

Grid color Fox::FXColor



379
380
381
# File 'rdoc-sources/FXTable.rb', line 379

def gridColor
  @gridColor
end

#helpTextObject

Status line help text [String]



391
392
393
# File 'rdoc-sources/FXTable.rb', line 391

def helpText
  @helpText
end

#hiliteColorObject

Highlight color Fox::FXColor



364
365
366
# File 'rdoc-sources/FXTable.rb', line 364

def hiliteColor
  @hiliteColor
end

#marginBottomObject

Bottom cell margin, in pixels [Integer]



289
290
291
# File 'rdoc-sources/FXTable.rb', line 289

def marginBottom
  @marginBottom
end

#marginLeftObject

Left cell margin, in pixels [Integer]



292
293
294
# File 'rdoc-sources/FXTable.rb', line 292

def marginLeft
  @marginLeft
end

#marginRightObject

Right cell margin, in pixels [Integer]



295
296
297
# File 'rdoc-sources/FXTable.rb', line 295

def marginRight
  @marginRight
end

#marginTopObject

Top cell margin, in pixels [Integer]



286
287
288
# File 'rdoc-sources/FXTable.rb', line 286

def marginTop
  @marginTop
end

#numColumnsObject (readonly)

Number of columns [Integer]



283
284
285
# File 'rdoc-sources/FXTable.rb', line 283

def numColumns
  @numColumns
end

#numRowsObject (readonly)

Number of rows [Integer]



280
281
282
# File 'rdoc-sources/FXTable.rb', line 280

def numRows
  @numRows
end

#rowHeaderObject (readonly)

Row header control Fox::FXHeader



271
272
273
# File 'rdoc-sources/FXTable.rb', line 271

def rowHeader
  @rowHeader
end

#rowHeaderFontObject

Row header font Fox::FXFont



313
314
315
# File 'rdoc-sources/FXTable.rb', line 313

def rowHeaderFont
  @rowHeaderFont
end

#rowHeaderModeObject

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.



310
311
312
# File 'rdoc-sources/FXTable.rb', line 310

def rowHeaderMode
  @rowHeaderMode
end

#rowHeaderWidthObject

The fixed row header width, if rowHeaderMode is LAYOUT_FIX_WIDTH.



322
323
324
# File 'rdoc-sources/FXTable.rb', line 322

def rowHeaderWidth
  @rowHeaderWidth
end

#selBackColorObject

Background color for selected cell(s) Fox::FXColor



373
374
375
# File 'rdoc-sources/FXTable.rb', line 373

def selBackColor
  @selBackColor
end

#selEndColumnObject (readonly)

Ending column number for selection, or -1 if there is no selection [Integer]



352
353
354
# File 'rdoc-sources/FXTable.rb', line 352

def selEndColumn
  @selEndColumn
end

#selEndRowObject (readonly)

Ending row number for selection, or -1 if there is no selection [Integer]



349
350
351
# File 'rdoc-sources/FXTable.rb', line 349

def selEndRow
  @selEndRow
end

#selStartColumnObject (readonly)

Starting column number for selection, or -1 if there is no selection [Integer]



346
347
348
# File 'rdoc-sources/FXTable.rb', line 346

def selStartColumn
  @selStartColumn
end

#selStartRowObject (readonly)

Starting row number for selection, or -1 if there is no selection [Integer]



343
344
345
# File 'rdoc-sources/FXTable.rb', line 343

def selStartRow
  @selStartRow
end

#selTextColorObject

Text color for selected cell(s) Fox::FXColor



376
377
378
# File 'rdoc-sources/FXTable.rb', line 376

def selTextColor
  @selTextColor
end

#shadowColorObject

Shadow color Fox::FXColor



367
368
369
# File 'rdoc-sources/FXTable.rb', line 367

def shadowColor
  @shadowColor
end

#stippleColorObject

Stipple color Fox::FXColor



382
383
384
# File 'rdoc-sources/FXTable.rb', line 382

def stippleColor
  @stippleColor
end

#tableStyleObject

Table style [Integer]



298
299
300
# File 'rdoc-sources/FXTable.rb', line 298

def tableStyle
  @tableStyle
end

#textColorObject

Text color Fox::FXColor



358
359
360
# File 'rdoc-sources/FXTable.rb', line 358

def textColor
  @textColor
end

#visibleColumnsObject

Number of visible columns [Integer]



277
278
279
# File 'rdoc-sources/FXTable.rb', line 277

def visibleColumns
  @visibleColumns
end

#visibleRowsObject

Number of visible rows [Integer]



274
275
276
# File 'rdoc-sources/FXTable.rb', line 274

def visibleRows
  @visibleRows
end

Class Method Details

.csvTypeObject

Returns the drag type for CSV data



394
# File 'rdoc-sources/FXTable.rb', line 394

def FXTable.csvType; end

.csvTypeNameObject

Returns the drag type name for CSV data



397
# File 'rdoc-sources/FXTable.rb', line 397

def FXTable.csvTypeName; end

Instance Method Details

#acceptInput(notify = false) ⇒ Object

End input mode and accept the new value from the control. The item in the cell will be set to the value from the control, and the control will be deleted. If true is passed, a SEL_REPLACED callback will be generated to signify to the target that this call has a new value. You can also accept the input by sending the table an ID_ACCEPT_INPUT message.



476
# File 'rdoc-sources/FXTable.rb', line 476

def acceptInput(notify=false); end

#anythingSelected?Boolean

Return true if any cells are selected.

Returns:

  • (Boolean)


896
# File 'rdoc-sources/FXTable.rb', line 896

def anythingSelected?; end

#appendColumns(numColumns = 1, notify = false) ⇒ Object

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.



634
635
636
# File 'lib/fox16/core.rb', line 634

def appendColumns(numColumns=1, notify=false)
  insertColumns(self.numColumns, numColumns, notify)
end

#appendRows(numRows = 1, notify = false) ⇒ Object

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.



643
644
645
# File 'lib/fox16/core.rb', line 643

def appendRows(numRows=1, notify=false)
  insertRows(self.numRows, numRows, notify)
end

#cancelInputObject

Cancel input mode. The input control is immediately deleted and the cell will retain its old value. You can also cancel input mode by sending the table an ID_CANCEL_INPUT message.



466
# File 'rdoc-sources/FXTable.rb', line 466

def cancelInput(); end

#clearItems(notify = false) ⇒ Object

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.



585
# File 'rdoc-sources/FXTable.rb', line 585

def clearItems(notify=false); end

#colAtX(x) ⇒ Object

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.



491
# File 'rdoc-sources/FXTable.rb', line 491

def colAtX(x) ; end

#columnRenumbering=(renumber) ⇒ Object

Set column renumbering to true or false.



963
# File 'rdoc-sources/FXTable.rb', line 963

def columnRenumbering=(renumber); end

#columnRenumbering?Boolean

Get column renumbering

Returns:

  • (Boolean)


966
# File 'rdoc-sources/FXTable.rb', line 966

def columnRenumbering? ; end

#columnSelected?(c) ⇒ Boolean

Return true if the specified column of cells is selected. Raises IndexError if c is out of bounds.

Returns:

  • (Boolean)


893
# File 'rdoc-sources/FXTable.rb', line 893

def columnSelected?(c); end

#countText(text, cs = "\t,", rs = "\n") ⇒ Object

Determine the number of rows and columns in a block of text where columns are separated by characters from the set cs, and rows are separated by characters from the set rs. Return a two-element array containing the number of rows and columns, respectively.



787
# File 'rdoc-sources/FXTable.rb', line 787

def countText(text, cs="\t,", rs="\n"); end

#createItem(text, icon, data) ⇒ Object

Create a new table item



954
# File 'rdoc-sources/FXTable.rb', line 954

def createItem(text, icon, data) ; end

#disableItem(row, column) ⇒ Object

Disable cell. Raises IndexError if either row or column is out of bounds.



810
# File 'rdoc-sources/FXTable.rb', line 810

def disableItem(row, column) ; end

#drawCell(dc, xlo, xhi, ylo, yhi, xoff, yoff, startRow, endRow, startCol, endCol) ⇒ Object

Draw a table cell



957
# File 'rdoc-sources/FXTable.rb', line 957

def drawCell(dc, xlo, xhi, ylo, yhi, xoff, yoff, startRow, endRow, startCol, endCol) ; end

#drawRange(dc, xlo, xhi, ylo, yhi, xoff, yoff, rlo, rhi, clo, chi) ⇒ Object

Draw a range of cells



960
# File 'rdoc-sources/FXTable.rb', line 960

def drawRange(dc, xlo, xhi, ylo, yhi, xoff, yoff, rlo, rhi, clo, chi) ; end

#each_columnObject

Calls block once for each column in the table, passing an array of references (one element per row) as a parameter.



179
180
181
182
183
184
185
186
187
188
# File 'lib/fox16/iterators.rb', line 179

def each_column # :yields: itemArray
  0.upto(numColumns - 1) do |j|
    tableCol = []
    0.upto(numRows - 1) do |i|
      tableCol << getItem(i, j)
    end
    yield tableCol
  end
  self
end

#each_rowObject Also known as: each

Calls block once for each row in the table, passing an array of references (one element per column) as a parameter.



164
165
166
167
168
169
170
171
172
173
# File 'lib/fox16/iterators.rb', line 164

def each_row # :yields: itemArray
  0.upto(numRows - 1) do |i|
    tableRow = []
    0.upto(numColumns - 1) do |j|
      tableRow << getItem(i, j)
    end
    yield tableRow
  end
  self
end

#editable=(edit) ⇒ Object

Set editability of this table to true or false.



447
# File 'rdoc-sources/FXTable.rb', line 447

def editable=(edit); end

#editable?Boolean

Return true if this table is editable.

Returns:

  • (Boolean)


450
# File 'rdoc-sources/FXTable.rb', line 450

def editable? ; end

#enableItem(row, column) ⇒ Object

Enable cell. Raises IndexError if either row or column is out of bounds.



806
# File 'rdoc-sources/FXTable.rb', line 806

def enableItem(row, column) ; end

#extendSelection(row, column, notify = false) ⇒ Object

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.



926
# File 'rdoc-sources/FXTable.rb', line 926

def extendSelection(row, column, notify=false) ; end

#extractItem(r, c, notify = false) ⇒ Object

Extract item from table and return a reference to it. 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.



561
# File 'rdoc-sources/FXTable.rb', line 561

def extractItem(r, c, notify=false); end

#extractText(startrow, endrow, startcol, endcol, cs = "\t", rs = "\n") ⇒ Object

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 string specified by cs, and each row is delimited by the string 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.

Parameters:

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 string to insert at each column break [String]

rs

the string to insert at each row break [String]



755
# File 'rdoc-sources/FXTable.rb', line 755

def extractText(startrow, endrow, startcol, endcol, cs="\t", rs="\n"); end

#firstObject

Override Enumerable#first with FXWindow#first for backwards compatibility.



156
157
158
# File 'lib/fox16/iterators.rb', line 156

def first
  getFirst
end

#fitColumnsToContents(col, nc = 1) ⇒ Object

Fit column widths to contents, for the nc columns beginning with column index col.



637
# File 'rdoc-sources/FXTable.rb', line 637

def fitColumnsToContents(col, nc=1); end

#fitRowsToContents(row, nr = 1) ⇒ Object

Fit row heights to contents, for the nr rows beginning with row index row.



631
# File 'rdoc-sources/FXTable.rb', line 631

def fitRowsToContents(row, nr=1); end

#getCellColor(row, column) ⇒ Object

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.



951
# File 'rdoc-sources/FXTable.rb', line 951

def getCellColor(row, column) ; end

#getColumnIcon(index) ⇒ Object

Return icon of column header at index. Raises IndexError if index is out of bounds.



661
# File 'rdoc-sources/FXTable.rb', line 661

def getColumnIcon(index); end

#getColumnIconPosition(index) ⇒ Object

Return icon position of column header at index. Raises IndexError if index is out of bounds.



677
# File 'rdoc-sources/FXTable.rb', line 677

def getColumnIconPosition(index); end

#getColumnJustify(index) ⇒ Object

Return justify of column header at index. Raises IndexError if index is out of bounds.



693
# File 'rdoc-sources/FXTable.rb', line 693

def getColumnJustify(index); end

#getColumnText(index) ⇒ Object

Return text of column header at index. Raises IndexError if index is out of bounds.



645
# File 'rdoc-sources/FXTable.rb', line 645

def getColumnText(index); end

#getColumnWidth(column) ⇒ Object

Get column width. Raises IndexError if column is out of bounds.



601
# File 'rdoc-sources/FXTable.rb', line 601

def getColumnWidth(column) ; end

#getColumnX(column) ⇒ Object

Get x-coordinate of column. Raises IndexError if column is out of bounds.



613
# File 'rdoc-sources/FXTable.rb', line 613

def getColumnX(column) ; end

#getItem(row, column) ⇒ Object

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.



495
# File 'rdoc-sources/FXTable.rb', line 495

def getItem(row, column) ; end

#getItemBorders(r, c) ⇒ Object

Return the border style for the cell at (r, c). Raises IndexError if either r or c is out of bounds.



859
# File 'rdoc-sources/FXTable.rb', line 859

def getItemBorders(r, c); end

#getItemData(row, column) ⇒ Object

Return cell user data. Raises IndexError if either row or column is out of bounds.



733
# File 'rdoc-sources/FXTable.rb', line 733

def getItemData(row, column) ; end

#getItemIcon(row, column) ⇒ Object

Return item icon. Raises IndexError if either row or column is out of bounds.



725
# File 'rdoc-sources/FXTable.rb', line 725

def getItemIcon(row, column) ; end

#getItemIconPosition(r, c) ⇒ Object

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.



845
# File 'rdoc-sources/FXTable.rb', line 845

def getItemIconPosition(r, c); end

#getItemJustify(r, c) ⇒ Object

Return item justification for the cell at (r, c). Raises IndexError if either r or c is out of bounds.



830
# File 'rdoc-sources/FXTable.rb', line 830

def getItemJustify(r, c); end

#getItemStipple(r, c) ⇒ Object

Return the background stipple style for the cell at (r, c). Raises IndexError if either r or c is out of bounds.



867
# File 'rdoc-sources/FXTable.rb', line 867

def getItemStipple(r, c); end

#getItemText(row, column) ⇒ Object

Return cell text for item at specified row and column. Raises IndexError if either row or column is out of bounds.



713
# File 'rdoc-sources/FXTable.rb', line 713

def getItemText(row, column) ; end

#getRowHeight(row) ⇒ Object

Get row height. Raises IndexError if row is out of bounds.



609
# File 'rdoc-sources/FXTable.rb', line 609

def getRowHeight(row) ; end

#getRowIcon(index) ⇒ Object

Return icon of row header at index. Raises IndexError if index is out of bounds.



669
# File 'rdoc-sources/FXTable.rb', line 669

def getRowIcon(index); end

#getRowIconPosition(index) ⇒ Object

Return icon position of row header at index. Raises IndexError if index is out of bounds.



685
# File 'rdoc-sources/FXTable.rb', line 685

def getRowIconPosition(index); end

#getRowJustify(index) ⇒ Object

Return justify of row header at index. Raises IndexError if index is out of bounds.



701
# File 'rdoc-sources/FXTable.rb', line 701

def getRowJustify(index); end

#getRowText(index) ⇒ Object

Return text of row header at index. Raises IndexError if index is out of bounds.



653
# File 'rdoc-sources/FXTable.rb', line 653

def getRowText(index); end

#getRowY(row) ⇒ Object

Get y-coordinate of row. Raises IndexError if row is out of bounds.



617
# File 'rdoc-sources/FXTable.rb', line 617

def getRowY(row) ; end

#horizontalGridShown=(vis) ⇒ Object

Set visibility of horizontal grid to true or false.



423
# File 'rdoc-sources/FXTable.rb', line 423

def horizontalGridShown=(vis); end

#horizontalGridShown?Boolean

Return true if horizontal grid is shown.

Returns:

  • (Boolean)


426
# File 'rdoc-sources/FXTable.rb', line 426

def horizontalGridShown? ; end

#insertColumns(column, numColumns = 1, notify = false) ⇒ Object

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.



535
# File 'rdoc-sources/FXTable.rb', line 535

def insertColumns(column, numColumns=1, notify=false) ; end

#insertRows(row, numRows = 1, notify = false) ⇒ Object

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.



525
# File 'rdoc-sources/FXTable.rb', line 525

def insertRows(row, numRows=1, notify=false) ; end

#itemCurrent?(row, column) ⇒ Boolean

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:

  • (Boolean)


877
# File 'rdoc-sources/FXTable.rb', line 877

def itemCurrent?(row, column) ; end

#itemEnabled?(row, column) ⇒ Boolean

Returns true if the cell at position (row, column) is enabled. Raises IndexError if either row or column is out of bounds.

Returns:

  • (Boolean)


814
# File 'rdoc-sources/FXTable.rb', line 814

def itemEnabled?(row, column) ; end

#itemSelected?(row, column) ⇒ Boolean

Returns true if the cell at position (row, column) is selected. Raises IndexError if either row or column is out of bounds.

Returns:

  • (Boolean)


885
# File 'rdoc-sources/FXTable.rb', line 885

def itemSelected?(row, column) ; end

#itemSpanning?(r, c) ⇒ Boolean

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:

  • (Boolean)


791
# File 'rdoc-sources/FXTable.rb', line 791

def itemSpanning?(r, c); end

#itemVisible?(row, column) ⇒ Boolean

Returns true if the cell at position (row, column) is visible. Raises IndexError if either row or column is out of bounds.

Returns:

  • (Boolean)


593
# File 'rdoc-sources/FXTable.rb', line 593

def itemVisible?(row, column) ; end

#killSelection(notify = false) ⇒ Object

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.



931
# File 'rdoc-sources/FXTable.rb', line 931

def killSelection(notify=false) ; end

#makePositionVisible(row, column) ⇒ Object

Scroll to make cell at (row, column) fully visible. Raises IndexError if either row or column is out of bounds.



589
# File 'rdoc-sources/FXTable.rb', line 589

def makePositionVisible(row, column) ; end

#minColumnWidth(c) ⇒ Object

Return minimum column width for column c. Raises IndexError if c is out of bounds.



625
# File 'rdoc-sources/FXTable.rb', line 625

def minColumnWidth(c); end

#minRowHeight(r) ⇒ Object

Return minimum row height for row r. Raises IndexError if r is out of bounds.



621
# File 'rdoc-sources/FXTable.rb', line 621

def minRowHeight(r); end

#overlayText(startrow, endrow, startcol, endcol, text, cs = "\t", rs = "\n", notify = false) ⇒ Object

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.

Parameters:

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]



778
# File 'rdoc-sources/FXTable.rb', line 778

def overlayText(startrow, endrow, startcol, endcol, text, cs="\t", rs="\n", notify=false); end

#removeColumns(column, nc = 1, notify = false) ⇒ Object

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.



553
# File 'rdoc-sources/FXTable.rb', line 553

def removeColumns(column, nc=1, notify=false) ; end

#removeItem(row, col, notify = false) ⇒ Object

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.



569
# File 'rdoc-sources/FXTable.rb', line 569

def removeItem(row, col, notify=false) ; end

#removeRange(startrow, endrow, startcol, endcol, notify = false) ⇒ Object

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.



578
# File 'rdoc-sources/FXTable.rb', line 578

def removeRange(startrow, endrow, startcol, endcol, notify=false); end

#removeRows(row, nr = 1, notify = false) ⇒ Object

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.



544
# File 'rdoc-sources/FXTable.rb', line 544

def removeRows(row, nr=1, notify=false) ; end

#rowAtY(y) ⇒ Object

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.



483
# File 'rdoc-sources/FXTable.rb', line 483

def rowAtY(y) ; end

#rowRenumbering=(renumber) ⇒ Object

Set row renumbering to true or false.



969
# File 'rdoc-sources/FXTable.rb', line 969

def rowRenumbering=(renumber); end

#rowRenumbering?Boolean

Get row renumbering

Returns:

  • (Boolean)


972
# File 'rdoc-sources/FXTable.rb', line 972

def rowRenumbering? ; end

#rowSelected?(r) ⇒ Boolean

Return true if the specified row of cells is selected. Raises IndexError if r is out of bounds.

Returns:

  • (Boolean)


889
# File 'rdoc-sources/FXTable.rb', line 889

def rowSelected?(r); end

#selectColumn(col, notify = false) ⇒ Object

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.



912
# File 'rdoc-sources/FXTable.rb', line 912

def selectColumn(col, notify=false); end

#selectItem(row, col, notify = false) ⇒ Object

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.



652
653
654
# File 'lib/fox16/core.rb', line 652

def selectItem(row, col, notify=false)
  selectRange(row, row, col, col, notify)
end

#selectRange(startRow, endRow, startColumn, endColumn, notify = false) ⇒ Object

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.



920
# File 'rdoc-sources/FXTable.rb', line 920

def selectRange(startRow, endRow, startColumn, endColumn, notify=false) ; end

#selectRow(row, notify = false) ⇒ Object

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.



904
# File 'rdoc-sources/FXTable.rb', line 904

def selectRow(row, notify=false); end

#setAnchorItem(row, column) ⇒ Object

Change anchored cell. Raises IndexError if either row or column is out of bounds.



881
# File 'rdoc-sources/FXTable.rb', line 881

def setAnchorItem(row, column) ; end

#setCellColor(row, column, color) ⇒ Object

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.



941
# File 'rdoc-sources/FXTable.rb', line 941

def setCellColor(row, column, color) ; end

#setColumnIcon(index, icon) ⇒ Object

Change column header icon. Raises IndexError if index is out of bounds.



657
# File 'rdoc-sources/FXTable.rb', line 657

def setColumnIcon(index, icon); end

#setColumnIconPosition(index, mode) ⇒ Object

Change column header icon position, e.g. FXHeaderItem::BEFORE, etc. Raises IndexError if index is out of bounds.



673
# File 'rdoc-sources/FXTable.rb', line 673

def setColumnIconPosition(index, mode); end

#setColumnJustify(index, justify) ⇒ Object

Change column header justify, e.g. FXHeaderItem::RIGHT, etc. Raises IndexError if index is out of bounds.



689
# File 'rdoc-sources/FXTable.rb', line 689

def setColumnJustify(index, justify); end

#setColumnText(index, text) ⇒ Object

Set column header at index to text. Raises IndexError if index is out of bounds.



641
# File 'rdoc-sources/FXTable.rb', line 641

def setColumnText(index, text); end

#setColumnWidth(column, columnWidth) ⇒ Object

Set column width. Raises IndexError if column is out of bounds.



597
# File 'rdoc-sources/FXTable.rb', line 597

def setColumnWidth(column, columnWidth) ; end

#setCurrentItem(row, column, notify = false) ⇒ Object

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.



873
# File 'rdoc-sources/FXTable.rb', line 873

def setCurrentItem(row, column, notify=false) ; end

#setItem(row, column, item) ⇒ Object

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.



499
# File 'rdoc-sources/FXTable.rb', line 499

def setItem(row, column, item) ; end

#setItemBorders(r, c, borders) ⇒ Object

Change item borders style for the item at (r, c). Borders on each side of the item can be turned controlled individually using FXTableItem::LBORDER, FXTableItem::RBORDER, FXTableItem::TBORDER and FXTableItem::BBORDER.

Raises IndexError if either r or c is out of bounds.



855
# File 'rdoc-sources/FXTable.rb', line 855

def setItemBorders(r, c, borders); end

#setItemData(row, column, data) ⇒ Object

Modify cell user data. Raises IndexError if either row or column is out of bounds.



729
# File 'rdoc-sources/FXTable.rb', line 729

def setItemData(row, column, data) ; end

#setItemIcon(row, col, icon, notify = false) ⇒ Object

Modify cell icon, deleting the old icon if it was owned. If notify is true, a SEL_REPLACED message is sent to the table’s message target before the item’s icon is changed.. Raises IndexError if either row or col is out of bounds.



721
# File 'rdoc-sources/FXTable.rb', line 721

def setItemIcon(row, col, icon, notify=false) ; end

#setItemIconPosition(r, c, mode) ⇒ Object

Change relative position of icon and text of item at (r, c). Passing FXTableItem::BEFORE or FXTableItem::AFTER places the icon before or after the text, and passing FXTableItem::ABOVE or FXTableItem::BELOW places it above or below the text, respectively. The default is 0 which places the text on top of the icon.

Raises IndexError if either r or c is out of bounds.



841
# File 'rdoc-sources/FXTable.rb', line 841

def setItemIconPosition(r, c, mode); end

#setItemJustify(r, c, justify) ⇒ Object

Change item justification for the cell at (r, c). Horizontal justification is controlled by passing FXTableItem::RIGHT, FXTableItem::LEFT, or FXTableItem::CENTER_X. Vertical justification is controlled by FXTableItem::TOP, FXTableItem::BOTTOM, or FXTableItem::CENTER_Y. The default is a combination of FXTableItem::RIGHT and FXTableItem::CENTER_Y.

Raises IndexError if either r or c is out of bounds.



826
# File 'rdoc-sources/FXTable.rb', line 826

def setItemJustify(r, c, justify); end

#setItemStipple(r, c, pat) ⇒ Object

Set the background stipple style for the cell at (r, c). Raises IndexError if either r or c is out of bounds.



863
# File 'rdoc-sources/FXTable.rb', line 863

def setItemStipple(r, c, pat); end

#setItemText(row, col, text, notify = false) ⇒ Object

Modify cell text for item at specified row and col. If notify is true, a SEL_REPLACED message is sent to the table’s message target before the item’s text is changed.. Raises IndexError if either row or col is out of bounds.



709
# File 'rdoc-sources/FXTable.rb', line 709

def setItemText(row, col, text, notify=false) ; end

#setRowHeight(row, rowHeight) ⇒ Object

Set row height. Raises IndexError if row is out of bounds.



605
# File 'rdoc-sources/FXTable.rb', line 605

def setRowHeight(row, rowHeight) ; end

#setRowIcon(index, icon) ⇒ Object

Change row header icon. Raises IndexError if index is out of bounds.



665
# File 'rdoc-sources/FXTable.rb', line 665

def setRowIcon(index, icon); end

#setRowIconPosition(index, mode) ⇒ Object

Change row header icon position, e.g. FXHeaderItem::BEFORE, etc. Raises IndexError if index is out of bounds.



681
# File 'rdoc-sources/FXTable.rb', line 681

def setRowIconPosition(index, mode); end

#setRowJustify(index, justify) ⇒ Object

Change row header justify, e.g. FXHeaderItem::RIGHT, etc. Raises IndexError if index is out of bounds.



697
# File 'rdoc-sources/FXTable.rb', line 697

def setRowJustify(index, justify); end

#setRowText(index, text) ⇒ Object

Set row header at index to text. Raises IndexError if index is out of bounds.



649
# File 'rdoc-sources/FXTable.rb', line 649

def setRowText(index, text); end

#setTableSize(numRows, numCols, notify = false) ⇒ Object

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

  • a SEL_DELETED message will be sent to the table’s message target indicating which cells (if any) are about to be destroyed as a result of the resize;

  • a SEL_INSERTED message will be sent to the table’s message target indicating which cells (if any) were added as a result of the resize; and,

  • a SEL_CHANGED message will be sent to the table’s message target indicating the new current cell.

Raises ArgError if either numRows or numCols is less than zero.



515
# File 'rdoc-sources/FXTable.rb', line 515

def setTableSize(numRows, numCols, notify=false) ; end

#showHorzGrid(on = true) ⇒ Object

Show or hide horizontal grid. Note that this is equivalent to the #horizontalGridShown= method.



438
# File 'rdoc-sources/FXTable.rb', line 438

def showHorzGrid(on=true) ; end

#showVertGrid(on = true) ⇒ Object

Show or hide vertical grid. Note that this is equivalent to the #verticalGridShown= method.



444
# File 'rdoc-sources/FXTable.rb', line 444

def showVertGrid(on=true) ; end

#startInput(row, col) ⇒ Object

Start input mode for the cell at the given position. An input control is created which is used to edit the cell; it is filled by the original item’s contents if the cell contained an item. You can enter input mode also by sending the table an ID_START_INPUT message.



459
# File 'rdoc-sources/FXTable.rb', line 459

def startInput(row, col); end

#updateItem(row, column) ⇒ Object

Repaint cell. Raises IndexError if either row or column is out of bounds.



802
# File 'rdoc-sources/FXTable.rb', line 802

def updateItem(row, column) ; end

#updateRange(startRow, endRow, startCol, endCol) ⇒ Object

Repaint cells between grid lines (startRow, endRow) and grid lines (startCol, endCol). Raises IndexError if any of the starting or ending grid lines is out of bounds.



798
# File 'rdoc-sources/FXTable.rb', line 798

def updateRange(startRow, endRow, startCol, endCol) ; end

#verticalGridShown=(vis) ⇒ Object

Set visibility of vertical grid to true or false.



429
# File 'rdoc-sources/FXTable.rb', line 429

def verticalGridShown=(vis); end

#verticalGridShown?Boolean

Is vertical grid shown?

Returns:

  • (Boolean)


432
# File 'rdoc-sources/FXTable.rb', line 432

def verticalGridShown? ; end