25 #ifndef NCItemSelector_h
26 #define NCItemSelector_h
32 #include <yui/YItemSelector.h>
33 #include "NCPadWidget.h"
34 #include "NCTablePad.h"
39 friend std::ostream & operator<<( std::ostream & str,
const NCItemSelectorBase & obj );
52 const YItemCustomStatusVector & customStates );
82 virtual void setSize(
int newWidth,
int newHeight );
132 virtual void addItem( YItem * item );
144 virtual void selectItem( YItem * item,
bool selected );
158 virtual void startMultipleChanges() { startMultidraw(); }
160 virtual void doneMultipleChanges() { stopMultidraw(); }
162 virtual const char * location()
const {
return "NCItemSelectorBase"; }
260 virtual void wRecoded() { NCPadWidget::wRecoded(); }
295 virtual const char * location()
const {
return "NCItemSelector"; }
virtual wsze preferredSize()
Return the preferred size for this widget.
virtual ~NCItemSelectorBase()
Destructor.
virtual int preferredHeight()
Return the preferred height for this widget.
virtual void deleteAllItems()
Delete all items.
virtual NCTableTag * tagCell(int index) const
Return the tag cell (the cell with the "[x]" or "(x)" selector) for the item with the specified index...
virtual void addItem(YItem *item)
Add an item to this widget.
virtual NCTableTag * createTagCell(YItem *item)=0
Create a tag cell for an item.
virtual void selectItem(YItem *item, bool selected)
Select or deselect an item.
int findItemLine(YItem *item) const
Return the line number that contains the first line of 'item' or -1 if not found.
const NCTableLine * getLine(int lineNo)
Return the text line with the specified line number.
virtual bool setKeyboardFocus()
Set the keyboard focus to this widget.
int linesCount() const
Return the number of lines in this widget.
virtual void setVisibleItems(int newVal)
Set the number of visible items for this widget.
int currentLine() const
Return number of the current line, i.e.
virtual int preferredWidth()
Return the preferred width for this widget.
YItem * scrollUpToPreviousItem()
If the cursor is not on the first line of an item (the line with the "[x]" selector),...
virtual void setSize(int newWidth, int newHeight)
Set the size of this widget.
virtual void cycleCurrentItemStatus()=0
Cycle the status of the current item through its possible values.
virtual bool statusChangeAllowed(int fromStatus, int toStatus)
Return 'true' if a status change (by user interaction) from status 'fromStatus' to status 'toStatus' ...
NCItemSelectorBase(YWidget *parent, bool enforceSingleSelection)
Standard constructor.
virtual YItem * currentItem() const
Return the current item, i.e.
virtual NCTablePad * myPad() const
Return the pad for this widget; overloaded to narrow the type.
std::vector< std::string > descriptionLines(YItem *item) const
Return the description text for an item as multiple lines.
virtual void activateItem(YItem *item)
Activate selected item.
virtual void setCurrentItem(YItem *item)
Set the current item, i.e.
virtual void deselectAllItems()
Deselect all items.
YItem * scrollDownToNextItem()
If the cursor is not on the first line of an item (the line with the "[x]" selector),...
std::string description(YItem *item) const
Return the desription text for an item.
virtual NCursesEvent valueChangedNotify(YItem *item)=0
Notification that a status value was just changed in the input handler and the 'notify' flag is set.
virtual NCPad * CreatePad()
Create the pad for this widget.
virtual NCursesEvent wHandleInput(wint_t key)
Handle keyboard input.
virtual void setEnabled(bool do_bv)
Enable or disable this widget.
NCItemSelector(YWidget *parent, bool enforceSingleSelection)
Constructor.
virtual ~NCItemSelector()
Destructor.
virtual bool statusChangeAllowed(int fromStatus, int toStatus)
Return 'true' if a status change (by user interaction) from status 'fromStatus' to status 'toStatus' ...
virtual NCTableTag * createTagCell(YItem *item)
Create a tag cell for an item.
virtual NCursesEvent valueChangedNotify(YItem *item)
Notification that a status value was just changed in the input handler and the 'notify' flag is set.
virtual void cycleCurrentItemStatus()
Cycle the status of the current item through its possible values.
void deselectAllItemsExcept(YItem *exceptItem)
Deselect all items except the specified one.