60 virtual const char *
widgetClass()
const {
return "YBarGraph"; }
100 void setValue(
int segmentIndex,
int newValue );
111 void setLabel(
int segmentIndex,
const std::string & newLabel );
141 virtual bool setProperty(
const std::string & propertyName,
174 void updateDisplay();
205 const std::string & label = std::string(),
210 , _segmentColor( segmentColor )
211 , _textColor( textColor )
217 int value()
const {
return _value; }
222 void setValue(
int newValue ) { _value = newValue; }
228 std::string
label()
const {
return _label; }
234 void setLabel(
const std::string & newLabel ) { _label = newLabel; }
325 #endif // YBarGraph_h One segment of a YBarGraph.
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
YBarGraphSegment(int value=0, const std::string &label=std::string(), const YColor &segmentColor=YColor(), const YColor &textColor=YColor())
Constructor.
YColor textColor() const
Return this segment's text color.
Transport class for the value of simple properties.
virtual const YPropertySet & propertySet()
Return this class's property set.
A set of properties to check names and types against.
A graph showing partitioning of a whole.
void setLabel(int segmentIndex, const std::string &newLabel)
Set the label of the segment with the specified index (from 0 on).
Helper class to define an RGB color.
void setLabel(const std::string &newLabel)
Set the text label of this segment.
void setSegmentColor(int segmentIndex, const YColor &color)
Set the background color of the segment with the specified index (from 0 on).
void deleteAllSegments()
Delete all segments.
void setTextColor(int segmentIndex, const YColor &color)
Set the text color of the segment with the specified index (from 0 on).
std::string label() const
Return the current text label of this segment.
bool hasSegmentColor() const
Return 'true' if this segment's background color is defined, i.e.
void setTextColor(const YColor &color)
Set this segment's text color.
YColor segmentColor() const
Return the segment background color.
virtual ~YBarGraph()
Destructor.
int value() const
Return the current value of this segment.
void setValue(int segmentIndex, int newValue)
Set the value of the segment with the specifie index (from 0 on).
YBarGraph(YWidget *parent)
Constructor.
void addSegment(const YBarGraphSegment &segment)
Add one segment.
int segments()
Return the current number of segments.
void setSegmentColor(const YColor &color)
Set this segment's background color.
bool hasTextColor() const
Return 'true' if this segment's text color is defined, i.e.
virtual const char * widgetClass() const
Return a descriptive name of this widget class for logging, debugging etc.
const YBarGraphSegment & segment(int segmentIndex) const
Return the segment with the specified index (from 0 on).
virtual void doUpdate()=0
Perform a display update after any change to any of the segments.
Helper class for multiple updates to a YBarGraph widget: This will hold back display updates until th...
void setValue(int newValue)
Set the value of this segment.