26 #include "YUIException.h" 39 const string & label_1,
40 const string & label_2,
41 const string & label_3,
42 const string & label_4,
43 const string & label_5,
44 const string & label_6,
45 const string & label_7,
46 const string & label_8,
47 const string & label_9 )
50 std::vector<string> labels;
52 labels.push_back( label_0 );
53 labels.push_back( label_1 );
54 labels.push_back( label_2 );
55 labels.push_back( label_3 );
56 labels.push_back( label_4 );
57 labels.push_back( label_5 );
58 labels.push_back( label_6 );
59 labels.push_back( label_7 );
60 labels.push_back( label_8 );
61 labels.push_back( label_9 );
67 unsigned lastLabel = labels.size() - 1;
69 while ( labels[ lastLabel ].empty() && --lastLabel > 0 )
76 for (
unsigned i = 0; i <= lastLabel; ++i )
109 YUI_CHECK_PTR(
cell );
110 _cells.push_back(
cell );
120 YUI_CHECK_NEW(
cell );
129 return index >= 0 && (unsigned)
index < _cells.size();
177 if ( _parent && _parent !=
parent && _column !=
column )
178 YUI_THROW(
YUIException(
string(
"Cannot reparent YTableCell \"" )
180 +
"to different parent." ) );
std::string label() const
Just for debugging.
void deleteCells()
Delete all cells.
void addCell(YTableCell *cell_disown)
Add a cell.
bool hasCell(int index) const
Return 'true' if this item has a cell with the specified index (counting from 0 on), 'false' otherwise.
std::string iconName(int index) const
Return the icon name of cell no.
const YTableCell * cell(int index) const
Return the cell at the specified index (counting from 0 on) or 0 if there is none.
virtual ~YTableItem()
Destructor.
One cell (one column in one row) of a YTableItem.
int index() const
Return the index of this item (as set with setIndex() ).
YTableCellCollection::iterator YTableCellIterator
Mutable iterator over YTableCellCollection.
Simple item class for SelectionBox, ComboBox, MultiSelectionBox etc.
bool hasIconName(int index) const
Return 'true' if there is a cell with the specified index that has an icon name.
int column() const
Return this cell's column no.
YTableItem * parent() const
Return this cell's parent item or 0 if it doesn't have one yet.
YTableCellIterator cellsEnd()
Return an iterator that points after the last cell of this item.
void reparent(YTableItem *parent, int column)
Set this cell's parent item and column no.
Item class for YTable items.
YTableItem()
Default constructor.
Base class for UI Exceptions.
YTableCellIterator cellsBegin()
Return an iterator that points to the first cell of this item.