libyui
3.4.2
|
One cell (one column in one row) of a YTableItem. More...
#include <YTableItem.h>
Public Member Functions | |
YTableCell (const std::string &label, const std::string &iconName="") | |
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 (YTableItem *parent, int column, const std::string &label, const std::string &iconName="") | |
Constructor with parent, column no., label and optional icon name for cells that are created with a parent. | |
virtual | ~YTableCell () |
Destructor. More... | |
std::string | label () const |
Return this cells's label. More... | |
void | setLabel (const std::string &newLabel) |
Set this cell's label. More... | |
std::string | iconName () const |
Return this cell's icon name. | |
bool | hasIconName () const |
Return 'true' if this cell has an icon name. | |
void | setIconName (const std::string &newIconName) |
Set this cell's icon name. More... | |
YTableItem * | parent () const |
Return this cell's parent item or 0 if it doesn't have one yet. | |
int | column () const |
Return this cell's column no. More... | |
int | itemIndex () const |
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. | |
void | reparent (YTableItem *parent, int column) |
Set this cell's parent item and column no. More... | |
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).
Definition at line 218 of file YTableItem.h.
|
inlinevirtual |
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.
Definition at line 253 of file YTableItem.h.
|
inline |
Return this cell's column no.
(counting from 0on) or -1 if it doesn't have a parent yet.
Definition at line 298 of file YTableItem.h.
|
inline |
Return this cells's label.
This is what the user sees in a dialog, so this will usually be a translated text.
Definition at line 259 of file YTableItem.h.
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.
Definition at line 171 of file YTableItem.cc.
|
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.
Definition at line 287 of file YTableItem.h.
|
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.
Definition at line 268 of file YTableItem.h.