67 , _iconName( iconName )
82 std::string
label()
const {
return _label; }
87 void setLabel(
const std::string & newLabel ) { _label = newLabel; }
92 std::string
iconName()
const {
return _iconName; }
102 void setIconName(
const std::string & newIconName ) { _iconName = newIconName; }
124 int index()
const {
return _index; }
134 void setData(
void * newData ) { _data = newData; }
139 void *
data()
const {
return _data; }
195 std::string _iconName;
YItemCollection::iterator YItemIterator
Mutable iterator over YItemCollection.
virtual YItem * parent() const
Returns this item's parent item or 0 if it is a toplevel item.
void setIndex(int index)
Set this item's index.
virtual YItemIterator childrenBegin()
Return an iterator that points to the first child item of this item.
std::vector< YItem * > YItemCollection
Collection of pointers to YItem.
YItem(const std::string &label, bool selected=false)
Constructor with just the label and optionally the selected state.
void setSelected(bool sel=true)
Select or unselect this item.
void setIconName(const std::string &newIconName)
Set this item's icon name.
void * data() const
Return the opaque data pointer.
int index() const
Return the index of this item (as set with setIndex() ).
Simple item class for SelectionBox, ComboBox, MultiSelectionBox etc.
void setLabel(const std::string &newLabel)
Set this item's label.
YItemCollection::const_iterator YItemConstIterator
Const iterator over YItemCollection.
virtual YItemIterator childrenEnd()
Return an iterator that points after the last child item of this item.
virtual bool hasChildren() const
Return 'true' if this item has any child items.
bool selected() const
Return 'true' if this item is currently selected.
virtual ~YItem()
Destructor.
std::string iconName() const
Return this item's icon name.
void setData(void *newData)
Set the opaque data pointer for application use.
YItem(const std::string &label, const std::string &iconName, bool selected=false)
Constructor with label and icon name and optionally the selected state.
std::string label() const
Return this item's label.
bool hasIconName() const
Return 'true' if this item has an icon name.