libyui
|
Public Member Functions | |
virtual | ~YBarGraph () |
virtual const char * | widgetClass () const |
void | addSegment (const YBarGraphSegment &segment) |
void | deleteAllSegments () |
int | segments () |
const YBarGraphSegment & | segment (int segmentIndex) const |
void | setValue (int segmentIndex, int newValue) |
void | setLabel (int segmentIndex, const string &newLabel) |
void | setSegmentColor (int segmentIndex, const YColor &color) |
void | setTextColor (int segmentIndex, const YColor &color) |
virtual bool | setProperty (const string &propertyName, const YPropertyValue &val) |
virtual YPropertyValue | getProperty (const string &propertyName) |
virtual const YPropertySet & | propertySet () |
Protected Member Functions | |
YBarGraph (YWidget *parent) | |
virtual void | doUpdate ()=0 |
Friends | |
class | YBarGraphMultiUpdate |
YBarGraph::YBarGraph | ( | YWidget * | parent | ) | [protected] |
Constructor.
YBarGraph::~YBarGraph | ( | ) | [virtual] |
Destructor.
void YBarGraph::addSegment | ( | const YBarGraphSegment & | segment | ) |
Add one segment.
If the segment's background and text colors are not explicitly specified, the YBarGraph widget will assign them from a list of (at least 5 different) color sets.
When adding multiple segments, use a YBarGraphMultiUpdate object for improved performance to hold back display updates until all segments are added.
void YBarGraph::deleteAllSegments | ( | ) |
Delete all segments.
virtual void YBarGraph::doUpdate | ( | ) | [protected, pure virtual] |
Perform a display update after any change to any of the segments.
Derived classes are required to implement this.
YPropertyValue YBarGraph::getProperty | ( | const string & | propertyName | ) | [virtual] |
const YPropertySet & YBarGraph::propertySet | ( | ) | [virtual] |
const YBarGraphSegment & YBarGraph::segment | ( | int | segmentIndex | ) | const |
Return the segment with the specified index (from 0 on).
This will throw an exception if there are not this many segments.
int YBarGraph::segments | ( | ) |
Return the current number of segments.
void YBarGraph::setLabel | ( | int | segmentIndex, |
const string & | newLabel | ||
) |
Set the label of the segment with the specified index (from 0 on). Use 1 as a placeholder for the current value.
This will throw an exception if there are not this many segments.
Note: Use a YBarGraphMultiUpdate object for improved performance when doing multiple changes at the same time.
bool YBarGraph::setProperty | ( | const string & | propertyName, |
const YPropertyValue & | val | ||
) | [virtual] |
void YBarGraph::setSegmentColor | ( | int | segmentIndex, |
const YColor & | color | ||
) |
Set the background color of the segment with the specified index (from 0 on).
This will throw an exception if there are not this many segments or if the color is undefined.
void YBarGraph::setTextColor | ( | int | segmentIndex, |
const YColor & | color | ||
) |
Set the text color of the segment with the specified index (from 0 on).
This will throw an exception if there are not this many segments or if the color is undefined.
void YBarGraph::setValue | ( | int | segmentIndex, |
int | newValue | ||
) |
Set the value of the segment with the specifie index (from 0 on).
This will throw an exception if there are not this many segments.
Note: Use a YBarGraphMultiUpdate object for improved performance when doing multiple changes at the same time.
virtual const char* YBarGraph::widgetClass | ( | ) | const [inline, virtual] |
Return a descriptive name of this widget class for logging, debugging etc.
Reimplemented from YWidget.