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"; }
342 #endif // NCItemSelector_h
virtual void activateItem(YItem *item)
Activate selected item.
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 NCTablePad * myPad() const
Return the pad for this widget; overloaded to narrow the type.
virtual NCPad * CreatePad()
Create the pad for this widget.
virtual YItem * currentItem() const
Return the current item, i.e.
virtual void deselectAllItems()
Deselect all items.
virtual int preferredHeight()
Return the preferred height for this widget.
virtual void cycleCurrentItemStatus()
Cycle the status of the current item through its possible values.
std::vector< std::string > descriptionLines(YItem *item) const
Return the description text for an item as multiple lines.
virtual void setEnabled(bool do_bv)
Enable or disable this widget.
virtual NCTableTag * createTagCell(YItem *item)
Create a tag cell for an item.
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 void selectItem(YItem *item, bool selected)
Select or deselect an item.
virtual void cycleCurrentItemStatus()=0
Cycle the status of the current item through its possible values.
virtual ~NCItemSelector()
Destructor.
virtual void setSize(int newWidth, int newHeight)
Set the size of this widget.
virtual void setVisibleItems(int newVal)
Set the number of visible items for this widget.
virtual void addItem(YItem *item)
Add an item to this widget.
virtual bool statusChangeAllowed(int fromStatus, int toStatus)
Return 'true' if a status change (by user interaction) from status 'fromStatus' to status 'toStatus' ...
virtual NCursesEvent valueChangedNotify(YItem *item)
Notification that a status value was just changed in the input handler and the 'notify' flag is set.
YItem * scrollDownToNextItem()
If the cursor is not on the first line of an item (the line with the "[x]" selector),...
YItem * scrollUpToPreviousItem()
If the cursor is not on the first line of an item (the line with the "[x]" selector),...
virtual ~NCItemSelectorBase()
Destructor.
NCItemSelector(YWidget *parent, bool enforceSingleSelection)
Constructor.
const NCTableLine * getLine(int lineNo)
Return the text line with the specified line number.
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 NCursesEvent wHandleInput(wint_t key)
Handle keyboard input.
virtual NCTableTag * createTagCell(YItem *item)=0
Create a tag cell for an item.
void deselectAllItemsExcept(YItem *exceptItem)
Deselect all items except the specified one.
int linesCount() const
Return the number of lines in this widget.
virtual void setCurrentItem(YItem *item)
Set the current item, i.e.
virtual wsze preferredSize()
Return the preferred size for this widget.
virtual void deleteAllItems()
Delete all items.
int currentLine() const
Return number of the current line, i.e.
int findItemLine(YItem *item) const
Return the line number that contains the first line of 'item' or -1 if not found.
virtual int preferredWidth()
Return the preferred width for this widget.
virtual bool setKeyboardFocus()
Set the keyboard focus to this widget.