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