libyui
Public Member Functions | Protected Member Functions | Friends

YBarGraph Class Reference

Inheritance diagram for YBarGraph:
YWidget

List of all members.

Public Member Functions

virtual ~YBarGraph ()
virtual const char * widgetClass () const
void addSegment (const YBarGraphSegment &segment)
void deleteAllSegments ()
int segments ()
const YBarGraphSegmentsegment (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 YPropertySetpropertySet ()

Protected Member Functions

 YBarGraph (YWidget *parent)
virtual void doUpdate ()=0

Friends

class YBarGraphMultiUpdate

Constructor & Destructor Documentation

YBarGraph::YBarGraph ( YWidget parent) [protected]

Constructor.

YBarGraph::~YBarGraph ( ) [virtual]

Destructor.


Member Function Documentation

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]

Get a property. Reimplemented from YWidget.

This method may throw YUIPropertyExceptions.

Reimplemented from YWidget.

const YPropertySet & YBarGraph::propertySet ( ) [virtual]

Return this class's property set. This also initializes the property upon the first call.

Reimplemented from YWidget.

Reimplemented from YWidget.

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]

Set a property. Reimplemented from YWidget.

This function may throw YUIPropertyExceptions.

This function returns 'true' if the value was successfully set and 'false' if that value requires special handling (not in error cases: those are covered by exceptions).

Reimplemented from YWidget.

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.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Friends