26 #define YUILogComponent "ui"
29 #include "YUISymbols.h"
30 #include "YMultiProgressMeter.h"
39 const vector<float> & maxValues )
41 , maxValues( maxValues )
45 currentValues = vector<float>( maxValues.size(), 0.0 );
50 vector<float> maxValues;
51 vector<float> currentValues;
59 const vector<float> & maxValues )
63 YUI_CHECK_NEW( priv );
85 return priv->dim == YD_HORIZ;
91 return priv->dim == YD_VERT;
97 return (
int) priv->maxValues.size();
103 YUI_CHECK_INDEX( segment, 0, (
int) priv->maxValues.size() );
105 return priv->maxValues[ segment ];
111 YUI_CHECK_INDEX( segment, 0, (
int) priv->currentValues.size() );
113 return priv->currentValues[ segment ];
119 YUI_CHECK_INDEX( segment, 0, (
int) priv->currentValues.size() );
127 priv->currentValues[ segment ] = value;
133 for (
int i=0; i < (int) values.size(); i++ )
152 propSet.
add(
YProperty( YUIProperty_Values, YOtherProperty ) );
165 if ( propertyName == YUIProperty_Values )
return false;
180 if ( propertyName == YUIProperty_Values )
return YPropertyValue( YOtherProperty );
float currentValue(int segment) const
Return the current value for the specified segment (counting from 0).
bool vertical() const
Return 'true' if the orientation is vertical.
int segments() const
Return the number of segments.
void setCurrentValues(const std::vector< float > &values)
Set all current values and call doUpdate().
bool horizontal() const
Return 'true' if the orientation is horizontal.
void setCurrentValue(int segment, float value)
Set the current value for the specified segment.
YUIDimension dimension() const
Return the orientation of the MultiProgressBar.
float maxValue(int segment) const
Return the maximum value for the specified segment (counting from 0).
virtual const YPropertySet & propertySet()
Return this class's property set.
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
virtual ~YMultiProgressMeter()
Destructor.
virtual void doUpdate()=0
Notification that values have been updated and the widget needs to be redisplayed.
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
YMultiProgressMeter(YWidget *parent, YUIDimension dim, const std::vector< float > &maxValues)
Constructor.
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.
YPropertyType type() const
Returns the type of this property value.
Class for widget properties.