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." ) );
YTableCellIterator cellsBegin()
Return an iterator that points to the first cell of this item.
int index() const
Return the index of this item (as set with setIndex() ).
std::string iconName(int index) const
Return the icon name of cell no.
YTableItem * parent() const
Return this cell's parent item or 0 if it doesn't have one yet.
std::string label() const
Just for debugging.
int column() const
Return this cell's column no.
void reparent(YTableItem *parent, int column)
Set this cell's parent item and column no.
Item class for YTable items.
void deleteCells()
Delete all cells.
YTableCellIterator cellsEnd()
Return an iterator that points after the last cell of this item.
YTableItem()
Default constructor.
YTableCellCollection::iterator YTableCellIterator
Mutable iterator over YTableCellCollection.
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.
bool hasIconName(int index) const
Return 'true' if there is a cell with the specified index that has an icon name.
void addCell(YTableCell *cell_disown)
Add a cell.
One cell (one column in one row) of a YTableItem.
bool hasCell(int index) const
Return 'true' if this item has a cell with the specified index (counting from 0 on),...
Base class for UI Exceptions.
Simple item class for SelectionBox, ComboBox, MultiSelectionBox etc.