YTable Class Reference
the table widget
More...
#include <YTable.h>
Inheritance diagram for YTable:
List of all members.
Detailed Description
the table widget
Table
- term header the headers of the columns list items the items contained in the selection box immediate make `notify trigger immediately when the selected item changes keepSorting keep the insertion order - don't let the user sort manually by clicking `Table( `header( "Game", "Highscore" ), [ `item( `id(1), "xkobo", "1708" ) ] ) Table1.ycp Table2.ycp Table3.ycp Table4.ycp Table5.ycp
A Table widget is a generalization of the SelectionBox. Information is displayed in a number of columns. Each column has a header. The number of columns and their titles are described by the first argument, which is a term with the symbol header
. For each column you add a string specifying its title. For example `header( "Name", "Price" )
creates the two columns "Name" and "Price".
The second argument is an optional list of items (rows) that are inserted in the table. Each item has the form `item( `id(
id ), first column, second column, ... )
. For each column one argument has to be specified, which must be of type void, string or integer. Strings are being left justified, integer right and a nil denote an empty cell, just as the empty string.
Constructor & Destructor Documentation
YTable::YTable |
( |
const YWidgetOpt & |
opt, |
|
|
int |
num_cols |
|
) |
|
|
|
Creates a new and empty Table - Parameters:
-
| num_cols | The number of columns of the table |
|
Member Function Documentation
void YTable::addItem |
( |
const YCPValue & |
id, |
|
|
vector< string > |
elements |
|
) |
|
|
|
Adds an item to the table. |
bool YTable::addItem |
( |
const YCPValue & |
item |
) |
|
|
|
Adds an item to the table that is given as term yet to be parsed. |
bool YTable::addItems |
( |
const YCPList & |
itemlist |
) |
[virtual] |
|
|
Adds a list of items to the table. The list contains item specifications yet to be parsed. |
virtual void YTable::cellChanged |
( |
int |
index, |
|
|
int |
colnum, |
|
|
const YCPString & |
newtext |
|
) |
[protected, pure virtual] |
|
|
Is called, when the contents of a cell has been changed. Overload this and change the cell text. |
|
Implements the ui command changeWidget.
Reimplemented from YWidget. |
|
Implements the ui command changeWidget with property given as term.
Reimplemented from YWidget. |
virtual int YTable::getCurrentItem |
( |
|
) |
[protected, pure virtual] |
|
|
Returns the index of the currently selected item or -1 if no item is selected. |
virtual void YTable::itemAdded |
( |
vector< string > |
elements, |
|
|
int |
index |
|
) |
[protected, pure virtual] |
|
|
Is called, when an item ( a row ) has been added. Overload this to fill the ui specific widget with items. - Parameters:
-
| elements | the strings of the elements, one for each column. |
| index | index of the new item. |
|
virtual void YTable::itemsCleared |
( |
|
) |
[protected, pure virtual] |
|
|
Is called, when all items have been cleared. Overload this and clear the ui specific table. |
int YTable::itemWithId |
( |
const YCPValue & |
id, |
|
|
bool |
report_error |
|
) |
[protected] |
|
|
Searches for an item with a certain id or a certain label. Returns the index of the found item or -1 if none was found - Parameters:
-
| report_error | set this to true, if you want me to report an error if non item can be found. |
|
int YTable::numCols |
( |
|
) |
const |
|
|
Returns the number of columns of the table. |
int YTable::numItems |
( |
|
) |
const [protected] |
|
|
Returns the current number of items |
|
Implements the ui command queryWidget
Reimplemented from YWidget. |
|
Implements the ui command queryWidget with property given as term.
Reimplemented from YWidget. |
void YTable::saveUserInput |
( |
YMacroRecorder * |
macroRecorder |
) |
[private, virtual] |
|
|
Save the widget's user input to a macro recorder. Intentionally declared as "private" so all macro recording internals are handled by the abstract libyui level, not by a specific UI.
Reimplemented from YWidget. |
virtual void YTable::setCurrentItem |
( |
int |
index |
) |
[protected, pure virtual] |
|
|
Makes another item the selected one. |
const char* YTable::userInputProperty |
( |
|
) |
[inline, virtual] |
|
|
The name of the widget property that will return user input. Inherited from YWidget.
Reimplemented from YWidget. |
virtual char* YTable::widgetClass |
( |
|
) |
[inline, virtual] |
|
|
Returns a descriptive name of this widget class for logging, debugging etc.
Reimplemented from YWidget. |
Member Data Documentation
|
The number of columns of the table |
|
The current data in the table |
The documentation for this class was generated from the following files:
Generated on Fri Jun 16 18:07:47 2006 for yast2-core by
1.4.6