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 )
virtual YItemIterator childrenEnd()
Return an iterator that points after the last child item of this item.
std::string label() const
Return this item's label.
bool isEmpty() const
Returns 'true' if this property set does not contain anything.
bool immediateMode() const
Deliver even more events than with notify() set.
Transport class for the value of simple properties.
std::vector< YItem * > YItemCollection
Collection of pointers to YItem.
void setImmediateMode(bool on=true)
Set immediateMode() on or off.
void add(const YProperty &prop)
Add a property to this property set.
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
A set of properties to check names and types against.
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...
YTree(YWidget *parent, const std::string &label, bool multiSelection, bool recursiveSelection)
Constructor.
virtual void addItems(const YItemCollection &itemCollection)
Add multiple items.
std::string stringVal() const
Methods to get the value of this property.
Class for widget properties.
YItemCollection::const_iterator YItemConstIterator
Const iterator over YItemCollection.
virtual ~YTree()
Destructor.
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
virtual void rebuildTree()=0
Rebuild the displayed tree from the internally stored YTreeItems.
virtual const YPropertySet & propertySet()
Return this class's property set.
bool hasMultiSelection() const
Return 'true' if the user can select multiple items at the same time.
virtual YItemIterator childrenBegin()
Return an iterator that points to the first child item of this item.
void check(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
Item class for tree items.
YPropertyType type() const
Returns the type of this property value.