![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
#include <FXTable.h>
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.
See also:
FX::FXTable::FXTable | ( | FXComposite * | p, | |
FXObject * | tgt = NULL , |
|||
FXSelector | sel = 0 , |
|||
FXuint | opts = 0 , |
|||
FXint | x = 0 , |
|||
FXint | y = 0 , |
|||
FXint | w = 0 , |
|||
FXint | h = 0 , |
|||
FXint | pl = DEFAULT_MARGIN , |
|||
FXint | pr = DEFAULT_MARGIN , |
|||
FXint | pt = DEFAULT_MARGIN , |
|||
FXint | pb = DEFAULT_MARGIN | |||
) |
Construct a new table.
The table is initially empty, and reports a default size based on the scroll areas's scrollbar placement policy.
virtual FX::FXTable::~FXTable | ( | ) | [virtual] |
virtual FXint FX::FXTable::getDefaultWidth | ( | ) | [virtual] |
virtual FXint FX::FXTable::getDefaultHeight | ( | ) | [virtual] |
virtual FXint FX::FXTable::getContentWidth | ( | ) | [virtual] |
virtual FXint FX::FXTable::getContentHeight | ( | ) | [virtual] |
virtual FXint FX::FXTable::getVisibleX | ( | ) | const [virtual] |
virtual FXint FX::FXTable::getVisibleY | ( | ) | const [virtual] |
virtual FXint FX::FXTable::getVisibleWidth | ( | ) | const [virtual] |
virtual FXint FX::FXTable::getVisibleHeight | ( | ) | const [virtual] |
virtual void FX::FXTable::create | ( | ) | [virtual] |
virtual void FX::FXTable::detach | ( | ) | [virtual] |
virtual void FX::FXTable::layout | ( | ) | [virtual] |
virtual void FX::FXTable::recalc | ( | ) | [virtual] |
virtual FXbool FX::FXTable::canFocus | ( | ) | const [virtual] |
virtual void FX::FXTable::setFocus | ( | ) | [virtual] |
virtual void FX::FXTable::killFocus | ( | ) | [virtual] |
virtual void FX::FXTable::changeFocus | ( | FXWindow * | child | ) | [virtual] |
FXButton* FX::FXTable::getCornerButton | ( | ) | const [inline] |
Return button in the top/left corner.
FXHeader* FX::FXTable::getColumnHeader | ( | ) | const [inline] |
Return column header control.
FXHeader* FX::FXTable::getRowHeader | ( | ) | const [inline] |
Return row header control.
void FX::FXTable::setVisibleRows | ( | FXint | nvrows | ) |
Change visible rows.
FXint FX::FXTable::getVisibleRows | ( | ) | const [inline] |
void FX::FXTable::setVisibleColumns | ( | FXint | nvcols | ) |
Change visible columns.
FXint FX::FXTable::getVisibleColumns | ( | ) | const [inline] |
Return number of visible columns.
FXbool FX::FXTable::isEditable | ( | ) | const |
Return true if table is editable.
void FX::FXTable::setEditable | ( | FXbool | edit = true |
) |
Set editable flag.
void FX::FXTable::showHorzGrid | ( | FXbool | on = true |
) |
Show or hide horizontal grid.
FXbool FX::FXTable::isHorzGridShown | ( | ) | const [inline] |
Is horizontal grid shown.
void FX::FXTable::showVertGrid | ( | FXbool | on = true |
) |
Show or hide vertical grid.
FXbool FX::FXTable::isVertGridShown | ( | ) | const [inline] |
Is vertical grid shown.
FXint FX::FXTable::getNumRows | ( | ) | const [inline] |
Get number of rows.
FXint FX::FXTable::getNumColumns | ( | ) | const [inline] |
Get number of columns.
void FX::FXTable::setMarginTop | ( | FXint | pt | ) |
Change top cell margin.
FXint FX::FXTable::getMarginTop | ( | ) | const [inline] |
Return top cell margin.
void FX::FXTable::setMarginBottom | ( | FXint | pb | ) |
Change bottom cell margin.
FXint FX::FXTable::getMarginBottom | ( | ) | const [inline] |
Return bottom cell margin.
void FX::FXTable::setMarginLeft | ( | FXint | pl | ) |
Change left cell margin.
FXint FX::FXTable::getMarginLeft | ( | ) | const [inline] |
Return left cell margin.
void FX::FXTable::setMarginRight | ( | FXint | pr | ) |
Change right cell margin.
FXint FX::FXTable::getMarginRight | ( | ) | const [inline] |
Return right cell margin.
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. Return true if editing of the cell has been started.
virtual FXbool FX::FXTable::cancelInput | ( | ) | [virtual] |
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. Return true if editing of the cell has been cancelled.
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. Return true if the new value of the cell has been accepted.
Determine column containing x.
Returns -1 if x left of first column, and ncols if x right of last column; otherwise, returns column in table containing x.
Determine row containing y.
Returns -1 if y above first row, and nrows if y below last row; otherwise, returns row in table containing y.
FXTableItem* FX::FXTable::getItem | ( | FXint | row, | |
FXint | col | |||
) | const |
Return the item at the given index.
void FX::FXTable::setItem | ( | FXint | row, | |
FXint | col, | |||
FXTableItem * | item, | |||
FXbool | notify = false | |||
) |
Replace the item with a [possibly subclassed] item.
Set the table size to nr rows and nc columns; all existing items will be removed.
Insert new row.
virtual void FX::FXTable::insertColumns | ( | FXint | col, | |
FXint | nc = 1 , |
|||
FXbool | notify = false | |||
) | [virtual] |
Insert new column.
Remove rows of cells.
virtual void FX::FXTable::removeColumns | ( | FXint | col, | |
FXint | nc = 1 , |
|||
FXbool | notify = false | |||
) | [virtual] |
Remove column of cells.
virtual FXTableItem* FX::FXTable::extractItem | ( | FXint | row, | |
FXint | col, | |||
FXbool | notify = false | |||
) | [virtual] |
Extract item from table.
Clear single cell.
virtual void FX::FXTable::removeRange | ( | FXint | startrow, | |
FXint | endrow, | |||
FXint | startcol, | |||
FXint | endcol, | |||
FXbool | notify = false | |||
) | [virtual] |
Clear all cells in the given range.
virtual void FX::FXTable::clearItems | ( | FXbool | notify = false |
) | [virtual] |
Remove all items from table.
Scroll to make cell at r,c fully visible.
void FX::FXTable::setColumnHeaderMode | ( | FXuint | hint = LAYOUT_FIX_HEIGHT |
) |
Change column header height mode to fixed or variable.
In variable height mode, the column header will size to fit the contents in it. In fixed mode, the size is explicitly set using setColumnHeaderHeight(). The default is to determine the column header height based on the contents, using the LAYOUT_MIN_HEIGHT option.
FXuint FX::FXTable::getColumnHeaderMode | ( | ) | const |
Return column header height mode.
void FX::FXTable::setRowHeaderMode | ( | FXuint | hint = LAYOUT_FIX_WIDTH |
) |
Change row header width mode to fixed or variable.
In variable width mode, the row header will size to fit the contents in it. In fixed mode, the size is explicitly set using setRowHeaderWidth(). The default is to determine the column header height based on the contents, using the LAYOUT_MIN_WIDTH option.
FXuint FX::FXTable::getRowHeaderMode | ( | ) | const |
Return row header width mode.
void FX::FXTable::setColumnHeaderFont | ( | FXFont * | fnt | ) |
Set column header font.
FXFont* FX::FXTable::getColumnHeaderFont | ( | ) | const |
Return column header font.
void FX::FXTable::setRowHeaderFont | ( | FXFont * | fnt | ) |
Set row header font.
FXFont* FX::FXTable::getRowHeaderFont | ( | ) | const |
Return row header font.
void FX::FXTable::setColumnHeaderHeight | ( | FXint | h | ) |
Change column header height.
FXint FX::FXTable::getColumnHeaderHeight | ( | ) | const |
Return column header height.
void FX::FXTable::setRowHeaderWidth | ( | FXint | w | ) |
Change row header width.
FXint FX::FXTable::getRowHeaderWidth | ( | ) | const |
Return row header width.
void FX::FXTable::setDefColumnWidth | ( | FXint | cwidth | ) |
Change default column width.
FXint FX::FXTable::getDefColumnWidth | ( | ) | const [inline] |
Get default column width.
void FX::FXTable::setDefRowHeight | ( | FXint | rheight | ) |
Change default row height.
FXint FX::FXTable::getDefRowHeight | ( | ) | const [inline] |
Get default row height.
Change column header tip text.
Return tip text of column header at index.
Change column header icon position, e.g. FXHeaderItem::BEFORE, etc.
Return icon position of column header at index.
Change row header icon position, e.g. FXHeaderItem::BEFORE, etc.
Return icon position of row header at index.
Change column header justify, e.g. FXHeaderItem::RIGHT, etc.
Return justify of column header at index.
Change row header justify, e.g. FXHeaderItem::RIGHT, etc.
Modify cell text.
void FX::FXTable::setItemIcon | ( | FXint | r, | |
FXint | c, | |||
FXIcon * | icon, | |||
FXbool | owned = false , |
|||
FXbool | notify = false | |||
) |
Modify cell icon, deleting the old icon if it was owned.
void FX::FXTable::extractText | ( | FXchar *& | text, | |
FXint & | size, | |||
FXint | startrow, | |||
FXint | endrow, | |||
FXint | startcol, | |||
FXint | endcol, | |||
const FXchar * | cs = "\t" , |
|||
const FXchar * | rs = "\n" | |||
) | const |
Extract cells from given range as text, each column separated by a string cs, and each row separated by a string rs.
void FX::FXTable::extractText | ( | FXString & | text, | |
FXint | startrow, | |||
FXint | endrow, | |||
FXint | startcol, | |||
FXint | endcol, | |||
const FXchar * | cs = "\t" , |
|||
const FXchar * | rs = "\n" | |||
) | const |
void FX::FXTable::overlayText | ( | FXint | startrow, | |
FXint | endrow, | |||
FXint | startcol, | |||
FXint | endcol, | |||
const FXchar * | text, | |||
FXint | size, | |||
const FXchar * | cs = "\t," , |
|||
const FXchar * | rs = "\n" , |
|||
FXbool | notify = false | |||
) |
Overlay text over given cell range; the text is interpreted as a number of columns separated by a character from the set cs, and a number of rows separated by a character from the set rs.
Cells outside the given cell range are unaffected.
void FX::FXTable::overlayText | ( | FXint | startrow, | |
FXint | endrow, | |||
FXint | startcol, | |||
FXint | endcol, | |||
const FXString & | text, | |||
const FXchar * | cs = "\t," , |
|||
const FXchar * | rs = "\n" , |
|||
FXbool | notify = false | |||
) |
void FX::FXTable::countText | ( | FXint & | nr, | |
FXint & | nc, | |||
const FXchar * | text, | |||
FXint | size, | |||
const FXchar * | cs = "\t," , |
|||
const FXchar * | rs = "\n" | |||
) | const |
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.
void FX::FXTable::countText | ( | FXint & | nr, | |
FXint & | nc, | |||
const FXString & | text, | |||
const FXchar * | cs = "\t," , |
|||
const FXchar * | rs = "\n" | |||
) | const |
Repaint cells between grid lines sr,er and grid lines sc,ec.
Change item justification.
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.
Change relative position of icon and text of item.
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.
Return relative icon and text position.
Change item borders style.
Borders on each side of the item can be turned controlled individually using FXTableItem::LBORDER, FXTableItem::RBORDER, FXTableItem::TBORDER and FXTableItem::BBORDER.
void FX::FXTable::setItemStipple | ( | FXint | r, | |
FXint | c, | |||
FXStipplePattern | pat | |||
) |
Change item background stipple style.
FXStipplePattern FX::FXTable::getItemStipple | ( | FXint | r, | |
FXint | c | |||
) | const |
return item background stipple style
Change current item.
FXint FX::FXTable::getCurrentRow | ( | ) | const [inline] |
Get row number of current item.
FXint FX::FXTable::getCurrentColumn | ( | ) | const [inline] |
Get column number of current item.
FXint FX::FXTable::getAnchorRow | ( | ) | const [inline] |
Get row number of anchor item.
FXint FX::FXTable::getAnchorColumn | ( | ) | const [inline] |
Get column number of anchor item.
FXint FX::FXTable::getSelStartRow | ( | ) | const [inline] |
Get selection start row; returns -1 if no selection.
FXint FX::FXTable::getSelStartColumn | ( | ) | const [inline] |
Get selection start column; returns -1 if no selection.
FXint FX::FXTable::getSelEndRow | ( | ) | const [inline] |
Get selection end row; returns -1 if no selection.
FXint FX::FXTable::getSelEndColumn | ( | ) | const [inline] |
Get selection end column; returns -1 if no selection.
FXbool FX::FXTable::isAnythingSelected | ( | ) | const |
Is anything selected.
Select a column.
virtual FXbool FX::FXTable::selectRange | ( | FXint | startrow, | |
FXint | endrow, | |||
FXint | startcol, | |||
FXint | endcol, | |||
FXbool | notify = false | |||
) | [virtual] |
Select range.
Extend selection.
void FX::FXTable::setFont | ( | FXFont * | fnt | ) |
Change font.
FXFont* FX::FXTable::getFont | ( | ) | const [inline] |
Return current font.
FXColor FX::FXTable::getTextColor | ( | ) | const [inline] |
Obtain colors of various parts.
FXColor FX::FXTable::getBaseColor | ( | ) | const [inline] |
FXColor FX::FXTable::getHiliteColor | ( | ) | const [inline] |
FXColor FX::FXTable::getShadowColor | ( | ) | const [inline] |
FXColor FX::FXTable::getBorderColor | ( | ) | const [inline] |
FXColor FX::FXTable::getSelBackColor | ( | ) | const [inline] |
FXColor FX::FXTable::getSelTextColor | ( | ) | const [inline] |
FXColor FX::FXTable::getGridColor | ( | ) | const [inline] |
FXColor FX::FXTable::getStippleColor | ( | ) | const [inline] |
FXColor FX::FXTable::getCellBorderColor | ( | ) | const [inline] |
void FX::FXTable::setTextColor | ( | FXColor | clr | ) |
Change colors of various parts.
void FX::FXTable::setBaseColor | ( | FXColor | clr | ) |
void FX::FXTable::setHiliteColor | ( | FXColor | clr | ) |
void FX::FXTable::setShadowColor | ( | FXColor | clr | ) |
void FX::FXTable::setBorderColor | ( | FXColor | clr | ) |
void FX::FXTable::setSelBackColor | ( | FXColor | clr | ) |
void FX::FXTable::setSelTextColor | ( | FXColor | clr | ) |
void FX::FXTable::setGridColor | ( | FXColor | clr | ) |
void FX::FXTable::setStippleColor | ( | FXColor | clr | ) |
void FX::FXTable::setCellBorderColor | ( | FXColor | clr | ) |
Change cell background color for even/odd rows/columns.
Obtain cell background color for even/odd rows/columns.
void FX::FXTable::setCellBorderWidth | ( | FXint | borderwidth | ) |
Change cell border width.
FXint FX::FXTable::getCellBorderWidth | ( | ) | const [inline] |
Return cell border width.
void FX::FXTable::setTableStyle | ( | FXuint | style | ) |
Change table style.
FXuint FX::FXTable::getTableStyle | ( | ) | const |
Return table style.
void FX::FXTable::setColumnRenumbering | ( | FXbool | flag | ) |
Set column renumbering.
FXbool FX::FXTable::getColumnRenumbering | ( | ) | const |
Get column renumbering.
void FX::FXTable::setRowRenumbering | ( | FXbool | flag | ) |
Set row renumbering.
FXbool FX::FXTable::getRowRenumbering | ( | ) | const |
Get row renumbering.
void FX::FXTable::setHelpText | ( | const FXString & | text | ) | [inline] |
Change help text.
const FXString& FX::FXTable::getHelpText | ( | ) | const [inline] |
virtual void FX::FXTable::save | ( | FXStream & | store | ) | const [virtual] |
virtual void FX::FXTable::load | ( | FXStream & | store | ) | [virtual] |
FXDragType FX::FXTable::csvType [static] |
const FXchar FX::FXTable::csvTypeName[] [static] |
![]() |