libyui
|
#include <YTableItem.h>
Public Member Functions | |
YTableCell (const string &label, const string &iconName="") | |
YTableCell (YTableItem *parent, int column, const string &label, const string &iconName="") | |
virtual | ~YTableCell () |
string | label () const |
void | setLabel (const string &newLabel) |
string | iconName () const |
bool | hasIconName () const |
void | setIconName (const string &newIconName) |
YTableItem * | parent () const |
int | column () const |
int | itemIndex () const |
void | reparent (YTableItem *parent, int column) |
One cell (one column in one row) of a YTableItem. Each cell has a label (a user visible text) and optionally an icon (*).
Note that cells don't have individual IDs; they have just an index. The first cell in an item is cell(0). In an ideal world, each YTableItem would have exactly as many cells as there are columns in the YTable, but these classes make no such assumptions. A YTableItem might have any number of cells, including none.
The YTable widget is free to ignore any excess cells if there are more than the YTable widget has columns. If there are less cells than the table has columns, the nonexistent cells will be treated as empty.
(*) Not all UIs can handle icons. UIs that can't handle them will simply ignore any icons specified for YTableCells. Thus, applications should either check the UI capabilities if it can handle icons or use icons only as an additional visual cue that still has a text counterpart (so the user can still make sense of the table content when no icons are visible).
YTableCell::YTableCell | ( | const string & | label, |
const string & | iconName = "" |
||
) | [inline] |
Constructor with label and optional icon name for cells that don't have a parent item yet (that will be added to a parent later with setParent()).
YTableCell::YTableCell | ( | YTableItem * | parent, |
int | column, | ||
const string & | label, | ||
const string & | iconName = "" |
||
) | [inline] |
Constructor with parent, column no., label and optional icon name for cells that are created with a parent.
virtual YTableCell::~YTableCell | ( | ) | [inline, virtual] |
Destructor. Not strictly needed inside this class, but useful for derived classes. Since this is the only virtual method of this class, the cost of this is a vtable for this class and a pointer to the vtable in each instance.
int YTableCell::column | ( | ) | const [inline] |
Return this cell's column no. (counting from 0on) or -1 if it doesn't have a parent yet.
bool YTableCell::hasIconName | ( | ) | const [inline] |
Return 'true' if this cell has an icon name.
string YTableCell::iconName | ( | ) | const [inline] |
Return this cell's icon name.
int YTableCell::itemIndex | ( | ) | const [inline] |
Convenience function: Return this cell's parent item's index within its table widget or -1 if there is no parent item or no parent table.
string YTableCell::label | ( | ) | const [inline] |
Return this cells's label. This is what the user sees in a dialog, so this will usually be a translated text.
YTableItem* YTableCell::parent | ( | ) | const [inline] |
Return this cell's parent item or 0 if it doesn't have one yet.
void YTableCell::reparent | ( | YTableItem * | parent, |
int | column | ||
) |
Set this cell's parent item and column no. if it doesn't have a parent yet.
This method will throw an exception if the cell already has a parent.
void YTableCell::setIconName | ( | const string & | newIconName | ) | [inline] |
Set this cell's icon name.
If this is called after the corresponding table item (table row) is added to the table widget, call YTable::cellChanged() to notify the table widget about the fact. Only then will the display be updated.
void YTableCell::setLabel | ( | const string & | newLabel | ) | [inline] |
Set this cell's label.
If this is called after the corresponding table item (table row) is added to the table widget, call YTable::cellChanged() to notify the table widget about the fact. Only then will the display be updated.