libyui
|
#include <YBarGraph.h>
Protected Member Functions | |
YBarGraph (YWidget *parent) | |
virtual void | doUpdate ()=0 |
![]() | |
YWidget (YWidget *parent) | |
YWidgetChildrenManager * | childrenManager () const |
void | setChildrenManager (YWidgetChildrenManager *manager) |
void | setBeingDestroyed () |
void | dumpWidget (YWidget *w, int indentationLevel) |
Friends | |
class | YBarGraphMultiUpdate |
A graph showing partitioning of a whole. The whole is divided into YBarGraphSegment each of which has a relative size, a text color, a background color, and a label.
|
protected |
Constructor.
|
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.
Perform a display update after any change to any of the segments.
Derived classes are required to implement this.
|
virtual |
|
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 | ( | ) | const |
Return the current number of segments.
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.
|
virtual |
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.
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.
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.
Return a descriptive name of this widget class for logging, debugging etc.
Reimplemented from YWidget.