26 #define YUILogComponent "ui"
29 #include "YUISymbols.h"
30 #include "YSelectionWidget.h"
32 #include "YTreeItem.h"
40 : immediateMode(
false )
53 YUI_CHECK_NEW( priv );
69 return priv->immediateMode;
108 propSet.
add(
YProperty( YUIProperty_Value, YOtherProperty ) );
109 propSet.
add(
YProperty( YUIProperty_CurrentItem, YOtherProperty ) );
110 propSet.
add(
YProperty( YUIProperty_CurrentBranch, YOtherProperty ) );
111 propSet.
add(
YProperty( YUIProperty_Items, YOtherProperty ) );
112 propSet.
add(
YProperty( YUIProperty_OpenItems, YOtherProperty ) );
113 propSet.
add(
YProperty( YUIProperty_Label, YStringProperty ) );
114 propSet.
add(
YProperty( YUIProperty_IconPath, YStringProperty ) );
115 propSet.
add(
YProperty( YUIProperty_SelectedItems, YOtherProperty ) );
116 propSet.
add(
YProperty( YUIProperty_MultiSelection, YBoolProperty,
true ) );
130 if ( propertyName == YUIProperty_Value )
return false;
131 else if ( propertyName == YUIProperty_CurrentItem )
return false;
132 else if ( propertyName == YUIProperty_CurrentBranch )
return false;
133 else if ( propertyName == YUIProperty_Items )
return false;
134 else if ( propertyName == YUIProperty_OpenItems )
return false;
135 else if ( propertyName == YUIProperty_SelectedItems )
return false;
153 if ( propertyName == YUIProperty_Value )
return YPropertyValue( YOtherProperty );
154 else if ( propertyName == YUIProperty_CurrentItem )
return YPropertyValue( YOtherProperty );
155 else if ( propertyName == YUIProperty_CurrentBranch )
return YPropertyValue( YOtherProperty );
156 else if ( propertyName == YUIProperty_Items )
return YPropertyValue( YOtherProperty );
157 else if ( propertyName == YUIProperty_OpenItems )
return YPropertyValue( YOtherProperty );
160 else if ( propertyName == YUIProperty_SelectedItems )
return YPropertyValue( YOtherProperty );
183 std::vector<std::string>::iterator path_end,
194 if( item->
label() == *path_begin )
196 if ( std::next(path_begin) == path_end )
YItemCollection::const_iterator YItemConstIterator
Const iterator over YItemCollection.
std::vector< YItem * > YItemCollection
Collection of pointers to YItem.
std::string label() const
Return this item's label.
A set of properties to check names and types against.
void check(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
bool isEmpty() const
Returns 'true' if this property set does not contain anything.
void add(const YProperty &prop)
Add a property to this property set.
Transport class for the value of simple properties.
std::string stringVal() const
Methods to get the value of this property.
YPropertyType type() const
Returns the type of this property value.
Class for widget properties.
Item class for tree items.
virtual YItemIterator childrenBegin()
Return an iterator that points to the first child item of this item.
virtual YItemIterator childrenEnd()
Return an iterator that points after the last child item of this item.
bool hasMultiSelection() const
Return 'true' if the user can select multiple items at the same time.
virtual ~YTree()
Destructor.
virtual void addItems(const YItemCollection &itemCollection)
Add multiple items.
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
YTree(YWidget *parent, const std::string &label, bool multiSelection, bool recursiveSelection)
Constructor.
virtual void rebuildTree()=0
Rebuild the displayed tree from the internally stored YTreeItems.
bool immediateMode() const
Deliver even more events than with notify() set.
YTreeItem * findItem(std::vector< std::string >::iterator path_begin, std::vector< std::string >::iterator path_end, YItemConstIterator begin, YItemConstIterator end) const
Recursively looks for the first item in the tree of the menu items using depth first search.
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
virtual const YPropertySet & propertySet()
Return this class's property set.
void setImmediateMode(bool on=true)
Set immediateMode() on or off.