56 virtual const char *
widgetClass()
const {
return "YBarGraph"; }
96 void setValue(
int segmentIndex,
int newValue );
107 void setLabel(
int segmentIndex,
const std::string & newLabel );
137 virtual bool setProperty(
const std::string & propertyName,
170 void updateDisplay();
200 const std::string &
label = std::string(),
212 int value()
const {
return _value; }
217 void setValue(
int newValue ) { _value = newValue; }
223 std::string
label()
const {
return _label; }
229 void setLabel(
const std::string & newLabel ) { _label = newLabel; }
320 #endif // YBarGraph_h
int value() const
Return the current value of this segment.
bool hasSegmentColor() const
Return 'true' if this segment's background color is defined, i.e.
Helper class to describe one segment of a YBarGraph.
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
YColor segmentColor() const
Return the segment background color.
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
bool isDefined() const
Return 'true' if this color is defined.
YBarGraphSegment(int value=0, const std::string &label=std::string(), const YColor &segmentColor=YColor(), const YColor &textColor=YColor())
Constructor.
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.
void setLabel(int segmentIndex, const std::string &newLabel)
Set the label of the segment with the specified index (from 0 on).
virtual const char * widgetClass() const
Return a descriptive name of this widget class for logging, debugging etc.
Helper class to define an RGB color.
void setLabel(const std::string &newLabel)
Set the text label of this segment.
YColor textColor() const
Return this segment's text color.
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).
void setTextColor(const YColor &color)
Set this segment's text color.
bool hasTextColor() const
Return 'true' if this segment's text color is defined, i.e.
const YBarGraphSegment & segment(int segmentIndex) const
Return the segment with the specified index (from 0 on).
virtual ~YBarGraph()
Destructor.
std::string label() const
Return the current text label 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.
~YBarGraphMultiUpdate()
Destructor.
int segments()
Return the current number of segments.
void setSegmentColor(const YColor &color)
Set this segment's background color.
virtual void doUpdate()=0
Perform a display update after any change to any of the segments.
YBarGraphMultiUpdate(YBarGraph *barGraph)
Constructor.
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.