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(),
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; }
Helper class for multiple updates to a YBarGraph widget: This will hold back display updates until th...
~YBarGraphMultiUpdate()
Destructor.
YBarGraphMultiUpdate(YBarGraph *barGraph)
Constructor.
One segment of a YBarGraph.
YBarGraphSegment(int value=0, const std::string &label=std::string(), const YColor &segmentColor=YColor(), const YColor &textColor=YColor())
Constructor.
bool hasSegmentColor() const
Return 'true' if this segment's background color is defined, i.e.
YColor segmentColor() const
Return the segment background color.
void setValue(int newValue)
Set the value of this segment.
std::string label() const
Return the current text label of this segment.
void setLabel(const std::string &newLabel)
Set the text label of this segment.
YColor textColor() const
Return this segment's text color.
void setSegmentColor(const YColor &color)
Set this segment's background color.
int value() const
Return the current value of this segment.
bool hasTextColor() const
Return 'true' if this segment's text color is defined, i.e.
void setTextColor(const YColor &color)
Set this segment's text color.
A graph showing partitioning of a whole.
virtual const YPropertySet & propertySet()
Return this class's property set.
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
const YBarGraphSegment & segment(int segmentIndex) const
Return the segment with the specified index (from 0 on).
void setValue(int segmentIndex, int newValue)
Set the value of the segment with the specifie index (from 0 on).
virtual void doUpdate()=0
Perform a display update after any change to any of the segments.
virtual ~YBarGraph()
Destructor.
void addSegment(const YBarGraphSegment &segment)
Add one segment.
int segments()
Return the current number of segments.
void setTextColor(int segmentIndex, const YColor &color)
Set the text color of the segment with the specified index (from 0 on).
void deleteAllSegments()
Delete all segments.
YBarGraph(YWidget *parent)
Constructor.
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
void setSegmentColor(int segmentIndex, const YColor &color)
Set the background color of the segment with the specified index (from 0 on).
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.
bool isDefined() const
Return 'true' if this color is defined.
A set of properties to check names and types against.
Transport class for the value of simple properties.