libyui  3.4.2
YBarGraphSegment Class Reference

One segment of a YBarGraph. More...

#include <YBarGraph.h>

Public Member Functions

 YBarGraphSegment (int value=0, const std::string &label=std::string(), const YColor &segmentColor=YColor(), const YColor &textColor=YColor())
 Constructor. More...
 
int value () const
 Return the current value of this segment.
 
void setValue (int newValue)
 Set the value of this segment.
 
std::string label () const
 Return the current text label of this segment. More...
 
void setLabel (const std::string &newLabel)
 Set the text label of this segment. More...
 
YColor segmentColor () const
 Return the segment background color.
 
bool hasSegmentColor () const
 Return 'true' if this segment's background color is defined, i.e. More...
 
void setSegmentColor (const YColor &color)
 Set this segment's background color.
 
YColor textColor () const
 Return this segment's text color.
 
bool hasTextColor () const
 Return 'true' if this segment's text color is defined, i.e. More...
 
void setTextColor (const YColor &color)
 Set this segment's text color.
 

Detailed Description

One segment of a YBarGraph.

It has a relative size, a label, label color and background color.

Definition at line 186 of file YBarGraph.h.

Constructor & Destructor Documentation

◆ YBarGraphSegment()

YBarGraphSegment::YBarGraphSegment ( int  value = 0,
const std::string &  label = std::string(),
const YColor segmentColor = YColor(),
const YColor textColor = YColor() 
)
inline

Constructor.

'value' is the initial value of this segment.

'label' is the label text in the segment. Use %1 as a placeholder for the current value.

'segmentColor' is the background color of this segment.

'textColor' is the color for the label text.

The YBarGraph widget will automatically assign some default colors (one of at least 5 different ones) if none are specified.

Definition at line 204 of file YBarGraph.h.

Member Function Documentation

◆ hasSegmentColor()

bool YBarGraphSegment::hasSegmentColor ( ) const
inline

Return 'true' if this segment's background color is defined, i.e.

it has a real RGB value and was not just created with the default constructor.

Definition at line 246 of file YBarGraph.h.

◆ hasTextColor()

bool YBarGraphSegment::hasTextColor ( ) const
inline

Return 'true' if this segment's text color is defined, i.e.

it has a real RGB value and was not just created with the default constructor.

Definition at line 263 of file YBarGraph.h.

◆ label()

std::string YBarGraphSegment::label ( ) const
inline

Return the current text label of this segment.

Any %1 placeholder will be returned as %1 (not expanded).

Definition at line 228 of file YBarGraph.h.

◆ setLabel()

void YBarGraphSegment::setLabel ( const std::string &  newLabel)
inline

Set the text label of this segment.

Use %1 as a placeholder for the current value.

Definition at line 234 of file YBarGraph.h.


The documentation for this class was generated from the following file: