libyui
Public Member Functions | Protected Member Functions

YMultiProgressMeter Class Reference

#include <YMultiProgressMeter.h>

Inheritance diagram for YMultiProgressMeter:
YWidget

List of all members.

Public Member Functions

virtual ~YMultiProgressMeter ()
virtual const char * widgetClass () const
YUIDimension dimension () const
bool horizontal () const
bool vertical () const
int segments () const
float maxValue (int segment) const
float currentValue (int segment) const
void setCurrentValue (int segment, float value)
void setCurrentValues (const vector< float > &values)
virtual bool setProperty (const string &propertyName, const YPropertyValue &val)
virtual YPropertyValue getProperty (const string &propertyName)
virtual const YPropertySetpropertySet ()
virtual void doUpdate ()=0

Protected Member Functions

 YMultiProgressMeter (YWidget *parent, YUIDimension dim, const vector< float > &maxValues)

Detailed Description

MultiProgressMeter: Progress bar with several segments that can indicate progress individually. This is useful to display progress of several activities that might not necessarily all be done in sequence.

A common example is installing packages from several CDs: Each CD would get a separate segment. Each segment's size would be proportional to the amount of data to be installed from that CD. This visualizes at the same time (a) how many CDs are involved (b) how much in proportion is to be expected from each CD (c) whether or not a specific CD is finished.

Visual example (horizontal MultiProgressMeter):

[=============...] [===] [......] [.]

This corresponds to 4 CDs:

CD #1: A lot of packages are to be installed from this CD, and a fair amount of those are already installed, but some are still missing. CD #2: Some packages were installed from this, but this CD is finished. CD #3: Quite some packages are to be installed from this CD. CD #4: Very few packages are to be installed from this CD.

As can be seen from this simple example, this widget can visualize a lot of complex information at the same time in a very natural way.

This is an optional widget, i.e. not all UIs support it.


Constructor & Destructor Documentation

YMultiProgressMeter::YMultiProgressMeter ( YWidget parent,
YUIDimension  dim,
const vector< float > &  maxValues 
) [protected]

Constructor

YMultiProgressMeter::~YMultiProgressMeter ( ) [virtual]

Destructor.


Member Function Documentation

float YMultiProgressMeter::currentValue ( int  segment) const

Return the current value for the specified segment (counting from 0). If no value has been set yet, -1 is returned.

YUIDimension YMultiProgressMeter::dimension ( ) const

Return the orientation of the MultiProgressBar.

virtual void YMultiProgressMeter::doUpdate ( ) [pure virtual]

Notification that values have been updated and the widget needs to be redisplayed. Derived classes need to reimplement this.

YPropertyValue YMultiProgressMeter::getProperty ( const string &  propertyName) [virtual]

Get a property. Reimplemented from YWidget.

This method may throw YUIPropertyExceptions.

Reimplemented from YWidget.

bool YMultiProgressMeter::horizontal ( ) const

Return 'true' if the orientation is horizontal.

float YMultiProgressMeter::maxValue ( int  segment) const

Return the maximum value for the specified segment (counting from 0).

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

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

Reimplemented from YWidget.

Reimplemented from YWidget.

int YMultiProgressMeter::segments ( ) const

Return the number of segments.

void YMultiProgressMeter::setCurrentValue ( int  segment,
float  value 
)

Set the current value for the specified segment. This must be in the range 0..maxValue( segment ).

Remember to call doUpdate() after all changed values are set!

void YMultiProgressMeter::setCurrentValues ( const vector< float > &  values)

Set all current values and call doUpdate().

bool YMultiProgressMeter::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.

bool YMultiProgressMeter::vertical ( ) const

Return 'true' if the orientation is vertical.

virtual const char* YMultiProgressMeter::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