32 #include <yui/YTree.h>
33 #include "NCPadWidget.h"
34 #include "NCTreePad.h"
35 #include "NCTablePad.h"
48 friend std::ostream & operator<<( std::ostream & str,
const NCTree & obj );
53 const std::string & label,
54 bool multiselection =
false,
55 bool recursiveselection =
false );
78 virtual void deselectAllItems();
85 virtual void selectItem( YItem *item,
bool selected );
121 virtual void setSize(
int newWidth,
int newHeight );
128 virtual void setLabel(
const std::string & nlabel );
145 return YWidget::setKeyboardFocus();
173 virtual const char *
location()
const {
return "NCTree"; }
267 bool multiSelection );
276 YTreeItem *
YItem()
const {
return dynamic_cast<YTreeItem *
>(
_yitem ); }
291 virtual unsigned Hotspot(
unsigned & at )
const;
A tree selection widget with one-column tree items and optionally multy selection.
const NCTreeLine * getTreeLine(unsigned idx) const
Return a const pointer to the tree line at the specified index for read-only operations.
virtual bool handleInput(wint_t key)
Handle keyboard input.
virtual bool ChangeToVisible()
Change a line that may have been invisible until now to be visible.
virtual void setLabel(const std::string &nlabel)
Set the label (the caption) above the tree.
virtual void startMultipleChanges()
Optimization for NCurses from libyui: Notification that multiple changes are about to come.
virtual void deleteAllItems()
Delete all items and clear the TreePad.
virtual const char * location() const
Code location for logging.
YTreeItem * YItem() const
Return the corresponding YTreeItem.
virtual NCTreePad * myPad() const
Return the TreePad that belongs to this widget.
A virtual window with a real viewport (which is NCursesWindow) and a scrolling mechanism.
virtual void selectItem(YItem *item, bool selected)
Select or deselect an item.
One line in a tree widdget.
virtual void DrawPad()
Fill the TreePad with lines (using CreateTreeLines to create them)
virtual void rebuildTree()
Recursively build the tree in this widget according to the items.
YTableItem * origItem() const
Return the YItem this line corresponds to.
virtual int preferredWidth()
libyui geometry management: Return the preferred width for this widget.
virtual YTreeItem * currentItem()
Get the current item.
virtual void setSize(int newWidth, int newHeight)
libyui geometry management: Apply the width and height assigned from the parent layout widget.
virtual void doneMultipleChanges()
Optimization for NCurses from libyui: Notification that multiple changes are now finished.
virtual void activate()
Activate the item selected in the tree.
virtual YTreeItem * getCurrentItem() const
Return a pointer to the current item (the item under the cursor).
void CreateTreeLines(NCTreeLine *parentLine, NCTreePad *pad, YItem *item)
Create TreeLines and append them to the TreePad.
One line in a NCTable with multiple cells and an optional tree hierarchy.
virtual bool setKeyboardFocus()
Set the keyboard focus to this widget.
virtual void setEnabled(bool do_bv)
Enable or disable this widget.
virtual NCursesEvent wHandleInput(wint_t key)
Keyboard input handler.
virtual NCPad * CreatePad()
Create an empty pad.
NCTreeLine * modifyTreeLine(unsigned idx)
Return a non-const pointer to the tree line at the specified index for read-write operations.
virtual int preferredHeight()
libyui geometry management: Return the preferred height for this widget.