26 #define YUILogComponent "ui" 29 #include "YUISymbols.h" 30 #include "YSelectionWidget.h" 32 #include "YTreeItem.h" 37 : immediateMode(
false )
44 YTree::YTree(
YWidget * parent,
const std::string & label,
bool multiSelection,
bool recursiveSelection )
50 YUI_CHECK_NEW( priv );
66 return priv->immediateMode;
105 propSet.
add(
YProperty( YUIProperty_Value, YOtherProperty ) );
106 propSet.
add(
YProperty( YUIProperty_CurrentItem, YOtherProperty ) );
107 propSet.
add(
YProperty( YUIProperty_CurrentBranch, YOtherProperty ) );
108 propSet.
add(
YProperty( YUIProperty_Items, YOtherProperty ) );
109 propSet.
add(
YProperty( YUIProperty_OpenItems, YOtherProperty ) );
110 propSet.
add(
YProperty( YUIProperty_Label, YStringProperty ) );
111 propSet.
add(
YProperty( YUIProperty_IconPath, YStringProperty ) );
112 propSet.
add(
YProperty( YUIProperty_SelectedItems, YOtherProperty ) );
113 propSet.
add(
YProperty( YUIProperty_MultiSelection, YBoolProperty,
true ) );
127 if ( propertyName == YUIProperty_Value )
return false;
128 else if ( propertyName == YUIProperty_CurrentItem )
return false;
129 else if ( propertyName == YUIProperty_CurrentBranch )
return false;
130 else if ( propertyName == YUIProperty_Items )
return false;
131 else if ( propertyName == YUIProperty_OpenItems )
return false;
132 else if ( propertyName == YUIProperty_SelectedItems )
return false;
150 if ( propertyName == YUIProperty_Value )
return YPropertyValue( YOtherProperty );
151 else if ( propertyName == YUIProperty_CurrentItem )
return YPropertyValue( YOtherProperty );
152 else if ( propertyName == YUIProperty_CurrentBranch )
return YPropertyValue( YOtherProperty );
153 else if ( propertyName == YUIProperty_Items )
return YPropertyValue( YOtherProperty );
154 else if ( propertyName == YUIProperty_OpenItems )
return YPropertyValue( YOtherProperty );
157 else if ( propertyName == YUIProperty_SelectedItems )
return YPropertyValue( YOtherProperty );
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.
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.
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.
void check(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
YPropertyType type() const
Returns the type of this property value.