26 #define YUILogComponent "ui"
29 #include "YUISymbols.h"
30 #include "YSelectionWidget.h"
32 #include "YTreeItem.h"
41 : immediateMode(
false )
51 bool recursiveSelection )
57 YUI_CHECK_NEW( priv );
73 return priv->immediateMode;
116 propSet.
add(
YProperty( YUIProperty_Value, YOtherProperty ) );
117 propSet.
add(
YProperty( YUIProperty_CurrentItem, YOtherProperty ) );
118 propSet.
add(
YProperty( YUIProperty_CurrentBranch, YOtherProperty ) );
119 propSet.
add(
YProperty( YUIProperty_Items, YOtherProperty ) );
120 propSet.
add(
YProperty( YUIProperty_Label, YStringProperty ) );
121 propSet.
add(
YProperty( YUIProperty_IconPath, YStringProperty ) );
122 propSet.
add(
YProperty( YUIProperty_SelectedItems, YOtherProperty ) );
123 propSet.
add(
YProperty( YUIProperty_MultiSelection, YBoolProperty,
true ) );
124 propSet.
add(
YProperty( YUIProperty_OpenItems, YOtherProperty,
true ) );
137 if ( propertyName == YUIProperty_Value )
return false;
138 else if ( propertyName == YUIProperty_CurrentItem )
return false;
139 else if ( propertyName == YUIProperty_CurrentBranch )
return false;
140 else if ( propertyName == YUIProperty_Items )
return false;
141 else if ( propertyName == YUIProperty_SelectedItems )
return false;
159 if ( propertyName == YUIProperty_Value )
return YPropertyValue( YOtherProperty );
160 else if ( propertyName == YUIProperty_CurrentItem )
return YPropertyValue( YOtherProperty );
161 else if ( propertyName == YUIProperty_CurrentBranch )
return YPropertyValue( YOtherProperty );
162 else if ( propertyName == YUIProperty_Items )
return YPropertyValue( YOtherProperty );
165 else if ( propertyName == YUIProperty_SelectedItems )
return YPropertyValue( YOtherProperty );
167 else if ( propertyName == YUIProperty_OpenItems )
return YPropertyValue( YOtherProperty );
184 return findItem( path.begin(), path.end(),
191 vector<string>::const_iterator path_end,
202 if ( item->
label() == *path_begin )
204 if ( std::next( path_begin ) == path_end )
Item class for tree items.
std::string label() const
Return this item's label.
void add(const YProperty &prop)
Add a property to this property set.
void setImmediateMode(bool on=true)
Set immediateMode() on or off.
std::vector< YItem * > YItemCollection
Collection of pointers to YItem.
bool immediateMode() const
Deliver even more events than with notify() set.
A set of properties to check names and types against.
YTree(YWidget *parent, const std::string &label, bool multiSelection, bool recursiveSelection)
Constructor.
bool isEmpty() const
Returns 'true' if this property set does not contain anything.
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
std::string stringVal() const
Methods to get the value of this property.
virtual YItemIterator childrenBegin()
Return an iterator that points to the first child item of this item.
YPropertyType type() const
Returns the type of this property value.
virtual YItemIterator childrenEnd()
Return an iterator that points after the last child item of this item.
YTreeItem * findItem(const std::vector< std::string > &path) const
Return the item in the tree that matches path of labels or 0 if not found.
Class for widget properties.
virtual ~YTree()
Destructor.
virtual void addItems(const YItemCollection &itemCollection)
Add multiple items.
void check(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
bool hasMultiSelection() const
Return 'true' if the user can select multiple items at the same time.
virtual void rebuildTree()=0
Rebuild the displayed tree from the internally stored YTreeItems.
Transport class for the value of simple properties.
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
virtual const YPropertySet & propertySet()
Return this class's property set.
YItemCollection::const_iterator YItemConstIterator
Const iterator over YItemCollection.