26 #define YUILogComponent "ui"
29 #include "YUISymbols.h"
30 #include "YMultiProgressMeter.h"
36 const std::vector<float> & maxValues )
38 , maxValues( maxValues )
42 currentValues = std::vector<float>( maxValues.size(), 0.0 );
47 std::vector<float> maxValues;
48 std::vector<float> currentValues;
56 const std::vector<float> & maxValues )
60 YUI_CHECK_NEW( priv );
82 return priv->dim == YD_HORIZ;
88 return priv->dim == YD_VERT;
94 return (
int) priv->maxValues.size();
100 YUI_CHECK_INDEX( segment, 0, (
int) priv->maxValues.size() );
102 return priv->maxValues[ segment ];
108 YUI_CHECK_INDEX( segment, 0, (
int) priv->currentValues.size() );
110 return priv->currentValues[ segment ];
116 YUI_CHECK_INDEX( segment, 0, (
int) priv->currentValues.size() );
124 priv->currentValues[ segment ] = value;
130 for (
int i=0; i < (int) values.size(); i++ )
149 propSet.
add(
YProperty( YUIProperty_Values, YOtherProperty ) );
162 if ( propertyName == YUIProperty_Values )
return false;
177 if ( propertyName == YUIProperty_Values )
return YPropertyValue( YOtherProperty );
float currentValue(int segment) const
Return the current value for the specified segment (counting from 0).
virtual ~YMultiProgressMeter()
Destructor.
Transport class for the value of simple properties.
void setCurrentValue(int segment, float value)
Set the current value for the specified segment.
void check(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
void add(const YProperty &prop)
Add a property to this property set.
A set of properties to check names and types against.
virtual const YPropertySet & propertySet()
Return this class's property set.
int segments() const
Return the number of segments.
virtual void doUpdate()=0
Notification that values have been updated and the widget needs to be redisplayed.
bool horizontal() const
Return 'true' if the orientation is horizontal.
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
bool isEmpty() const
Returns 'true' if this property set does not contain anything.
bool vertical() const
Return 'true' if the orientation is vertical.
Class for widget properties.
void setCurrentValues(const std::vector< float > &values)
Set all current values and call doUpdate().
YMultiProgressMeter(YWidget *parent, YUIDimension dim, const std::vector< float > &maxValues)
Constructor.
float maxValue(int segment) const
Return the maximum value for the specified segment (counting from 0).
YUIDimension dimension() const
Return the orientation of the MultiProgressBar.
YPropertyType type() const
Returns the type of this property value.
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.