Public Member Functions

YTableItem Class Reference

#include <YTableItem.h>

Inheritance diagram for YTableItem:

List of all members.

Public Member Functions

 YTableItem ()
 YTableItem (const string &label_0, const string &label_1=string(), const string &label_2=string(), const string &label_3=string(), const string &label_4=string(), const string &label_5=string(), const string &label_6=string(), const string &label_7=string(), const string &label_8=string(), const string &label_9=string())
virtual ~YTableItem ()
void addCell (YTableCell *cell_disown)
void addCell (const string &label, const string &iconName=string())
void deleteCells ()
YTableCellIterator cellsBegin ()
YTableCellConstIterator cellsBegin () const
YTableCellIterator cellsEnd ()
YTableCellConstIterator cellsEnd () const
const YTableCellcell (int index) const
YTableCellcell (int index)
int cellCount () const
bool hasCell (int index) const
string label (int index) const
string iconName (int index) const
bool hasIconName (int index) const
string label () const

Detailed Description

Item class for YTable items. Each YTableItem corresponds to one row in a YTable.

A YTableItem might have any number of cells (columns within this row), including none. The YTable widget is free to ignore any excess cells if there are more than the YTable widget has columns. The YTable widget is to treat nonexistent cells like empty ones.

Note that while YTable items and their cells can be manipulated through pointers, their visual representation on screen might be updated only upon calling certain methods of the YTable widget. See the YTable reference for details.

Constructor & Destructor Documentation

YTableItem::YTableItem ( )

Default constructor. Use addCell() to give it any content.

YTableItem::YTableItem ( const string &  label_0,
const string &  label_1 = string(),
const string &  label_2 = string(),
const string &  label_3 = string(),
const string &  label_4 = string(),
const string &  label_5 = string(),
const string &  label_6 = string(),
const string &  label_7 = string(),
const string &  label_8 = string(),
const string &  label_9 = string() 

Convenience constructor for table items without any icons.

This will create up to 10 (0..9) cells. Empty cells for empty labels at the end of the labels are not created, but empty cells in between are.

new YTableItem( "one", "two", "", "", "five" );

will create an item with 5 cells:

cell[0] ==> "one" cell[1] ==> "two" cell[2] ==> "" cell[3] ==> "" cell[4] ==> "five"

YTableItem::~YTableItem ( ) [virtual]


This will delete all cells.

Member Function Documentation

void YTableItem::addCell ( YTableCell cell_disown)

Add a cell. This item will assume ownership over the cell and delete it when appropriate (when the table is destroyed or when table items are replaced), at which time the pointer will become invalid.

Cells can still be changed after they (and the item they belong to) are added, but in that case, YTable::cellChanged() needs to be called to update the table display accordingly.

void YTableItem::addCell ( const string &  label,
const string &  iconName = string() 

Create a new cell and add it (even if both 'label' and 'iconName' are empty).

const YTableCell * YTableItem::cell ( int  index) const

Return the cell at the specified index (counting from 0 on) or 0 if there is none.

int YTableItem::cellCount ( ) const [inline]

Return the number of cells this item has.

YTableCellIterator YTableItem::cellsBegin ( ) [inline]

Return an iterator that points to the first cell of this item.

YTableCellIterator YTableItem::cellsEnd ( ) [inline]

Return an iterator that points after the last cell of this item.

void YTableItem::deleteCells ( )

Delete all cells.

bool YTableItem::hasCell ( int  index) const

Return 'true' if this item has a cell with the specified index (counting from 0 on), 'false' otherwise.

bool YTableItem::hasIconName ( int  index) const

Return 'true' if there is a cell with the specified index that has an icon name.

string YTableItem::iconName ( int  index) const

Return the icon name of cell no. 'index' (counting from 0 on) or an empty string if there is no cell with that index.

string YTableItem::label ( ) const [inline]

Just for debugging.

Reimplemented from YItem.

string YTableItem::label ( int  index) const

Return the label of cell no. 'index' (counting from 0 on) or an empty string if there is no cell with that index.

The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Friends