YTree Class Reference
Implementation of the Tree widget.
More...
#include <YTree.h>
Inheritance diagram for YTree:
List of all members.
Detailed Description
Implementation of the Tree widget.
Tree
- string label itemList items the items contained in the tree
itemList ::=
[
item
[ , item ]
[ , item ]
...
]
item ::=
string |
`item(
[ `id(
string ),
]
string
[ , true | false ]
[ , itemList ]
)
The boolean parameter inside `item() indicates whether or not the respective tree item should be opened by default - if it has any subitems and if the respective UI is capable of closing and opening subtrees. If the UI cannot handle this, all subtrees will always be open.
`Tree( `id( `treeID ), "treeLabel", [ "top1", "top2", "top3" ] ); Tree1.ycp Tree2.ycp
A tree widget provides a selection from a hierarchical tree structure. The semantics are very much like those of a SelectionBox. Unlike the SelectionBox, however, tree items may have subitems that in turn may have subitems etc.
Each item has a label string, optionally preceded by an ID. If the item has subitems, they are specified as a list of items after the string.
The tree widget will not perform any sorting on its own: The items are always sorted by insertion order. The application needs to handle sorting itself, if desired.
Constructor & Destructor Documentation
|
Constructor - Parameters:
-
opt | the widget options |
text | the initial text of the label |
|
YTree::~YTree |
( |
|
) |
[virtual] |
|
|
Destructor. Frees all tree items. |
Member Function Documentation
|
Adds an item to the selection box.
Uses an opaque data pointer for application use. Use YTreeItem::data() to retrieve this kind of data. The application is responsible for the data contents - and of course for avoiding dangling pointers. |
|
Adds an item to the selection box. |
|
Implements the ui command changeWidget.
Reimplemented from YWidget. |
|
Recursively search for an item with a given ID. Returns 0 if not found. |
|
Recursively search for an item with a given text. Returns 0 if not found. |
virtual const YTreeItem* YTree::getCurrentItem |
( |
|
) |
const [protected, pure virtual] |
|
|
Returns the index of the currently selected item or -1 if no item is selected. |
|
Get the current label text. This method cannot be overidden.
The value of the label cannot be changed other than by calling setLabel, i.e. not by the ui. Therefore setLabel stores the current label in label. |
|
Implements the ui command queryWidget.
Reimplemented from YWidget. |
void YTree::rebuildTree |
( |
|
) |
[virtual] |
|
|
Called once after items have been added.
Overload this to fill the ui specific widget with items. |
void YTree::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 YTree::setCurrentItem |
( |
YTreeItem * |
it |
) |
[protected, pure virtual] |
|
void YTree::setLabel |
( |
const YCPString & |
label |
) |
[virtual] |
|
|
Change the label text. Overload this, but call YTextEntry::setLabel at the end of your own function. |
const char* YTree::shortcutProperty |
( |
|
) |
[inline, virtual] |
|
|
The name of the widget property that holds the keyboard shortcut. Inherited from YWidget.
Reimplemented from YWidget. |
virtual char* YTree::widgetClass |
( |
|
) |
[inline, virtual] |
|
|
Returns a descriptive name of this widget class for logging, debugging etc.
Reimplemented from YWidget. |
Member Data Documentation
|
The current label of the tree |
The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:25 2007 for yast2-core by
1.3.6