libyui
Loading...
Searching...
No Matches
YBarGraph Class Referenceabstract

#include <YBarGraph.h>

Inheritance diagram for YBarGraph:
Collaboration diagram for YBarGraph:

Public Member Functions

virtual ~YBarGraph ()
virtual const char * widgetClass () const
void addSegment (const YBarGraphSegment &segment)
void deleteAllSegments ()
int segments () const
const YBarGraphSegmentsegment (int segmentIndex) const
void setValue (int segmentIndex, int newValue)
void setLabel (int segmentIndex, const std::string &newLabel)
void setSegmentColor (int segmentIndex, const YColor &color)
void setTextColor (int segmentIndex, const YColor &color)
virtual bool setProperty (const std::string &propertyName, const YPropertyValue &val)
virtual YPropertyValue getProperty (const std::string &propertyName)
virtual const YPropertySetpropertySet ()
Public Member Functions inherited from YWidget
virtual ~YWidget ()
virtual std::string debugLabel () const
std::string helpText () const
void setHelpText (const std::string &helpText)
bool hasChildren () const
YWidgetfirstChild () const
YWidgetlastChild () const
YWidgetListIterator childrenBegin () const
YWidgetListIterator childrenEnd () const
YWidgetListConstIterator childrenConstBegin () const
YWidgetListConstIterator childrenConstEnd () const
YWidgetListIterator begin ()
YWidgetListIterator end ()
int childrenCount () const
bool contains (YWidget *child) const
virtual void addChild (YWidget *child)
virtual void removeChild (YWidget *child)
void deleteChildren ()
YWidgetparent () const
bool hasParent () const
void setParent (YWidget *newParent)
YDialogfindDialog ()
YWidgetfindWidget (YWidgetID *id, bool doThrow=true) const
virtual int preferredWidth ()=0
virtual int preferredHeight ()=0
virtual int preferredSize (YUIDimension dim)
virtual void setSize (int newWidth, int newHeight)=0
bool isValid () const
bool beingDestroyed () const
void * widgetRep () const
void setWidgetRep (void *toolkitWidgetRep)
bool hasId () const
YWidgetIDid () const
void setId (YWidgetID *newId_disown)
virtual void setEnabled (bool enabled=true)
void setDisabled ()
virtual bool isEnabled () const
virtual bool stretchable (YUIDimension dim) const
void setStretchable (YUIDimension dim, bool newStretch)
void setDefaultStretchable (YUIDimension dim, bool newStretch)
virtual int weight (YUIDimension dim)
bool hasWeight (YUIDimension dim)
void setWeight (YUIDimension dim, int weight)
void setNotify (bool notify=true)
bool notify () const
void setNotifyContextMenu (bool notifyContextMenu=true)
bool notifyContextMenu () const
bool sendKeyEvents () const
void setSendKeyEvents (bool doSend)
bool autoShortcut () const
void setAutoShortcut (bool _newAutoShortcut)
int functionKey () const
bool hasFunctionKey () const
virtual void setFunctionKey (int fkey_no)
virtual bool setKeyboardFocus ()
virtual std::string shortcutString () const
virtual void setShortcutString (const std::string &str)
virtual const char * userInputProperty ()
void dumpWidgetTree (int indentationLevel=0)
void dumpDialogWidgetTree ()
void setChildrenEnabled (bool enabled)
virtual void saveUserInput (YMacroRecorder *macroRecorder)
void * operator new (size_t size)
void operator delete (void *ptr) noexcept
virtual void startMultipleChanges ()
virtual void doneMultipleChanges ()

Protected Member Functions

 YBarGraph (YWidget *parent)
virtual void doUpdate ()=0
Protected Member Functions inherited from YWidget
 YWidget (YWidget *parent)
YWidgetChildrenManager * childrenManager () const
void setChildrenManager (YWidgetChildrenManager *manager)
void setBeingDestroyed ()
void dumpWidget (YWidget *w, int indentationLevel)

Friends

class YBarGraphMultiUpdate

Detailed Description

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.

Constructor & Destructor Documentation

◆ YBarGraph()

YBarGraph::YBarGraph ( YWidget * parent)
protected

Constructor.

◆ ~YBarGraph()

YBarGraph::~YBarGraph ( )
virtual

Destructor.

Member Function Documentation

◆ addSegment()

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.

◆ deleteAllSegments()

void YBarGraph::deleteAllSegments ( )

Delete all segments.

◆ doUpdate()

virtual void YBarGraph::doUpdate ( )
protectedpure virtual

Perform a display update after any change to any of the segments.

Derived classes are required to implement this.

◆ getProperty()

YPropertyValue YBarGraph::getProperty ( const std::string & propertyName)
virtual

Get a property. Reimplemented from YWidget.

This method may throw YUIPropertyExceptions.

Reimplemented from YWidget.

◆ propertySet()

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.

◆ segment()

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.

◆ segments()

int YBarGraph::segments ( ) const

Return the current number of segments.

◆ setLabel()

void YBarGraph::setLabel ( int segmentIndex,
const std::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.

◆ setProperty()

bool YBarGraph::setProperty ( const std::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.

◆ setSegmentColor()

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.

◆ setTextColor()

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.

◆ setValue()

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.

◆ widgetClass()

virtual const char * YBarGraph::widgetClass ( ) const
inlinevirtual

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:
  • /builddir/build/BUILD/libyui-4.6.2-build/libyui-4.6.2/libyui/src/YBarGraph.h
  • /builddir/build/BUILD/libyui-4.6.2-build/libyui-4.6.2/libyui/src/YBarGraph.cc