|
|
|
@ -25,84 +25,84 @@
|
|
|
|
|
#include <tqframe.h>
|
|
|
|
|
#include <tqrangecontrol.h>
|
|
|
|
|
|
|
|
|
|
class CStatusBarProgress : public TQFrame, public TQRangeControl
|
|
|
|
|
class CStatusBarProgress : public TQFrame, public TQRangeControl
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* Possible values for orientation
|
|
|
|
|
/**
|
|
|
|
|
* Possible values for orientation
|
|
|
|
|
*/
|
|
|
|
|
enum Orientation { Horizontal, Vertical };
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Possible values for bar style.
|
|
|
|
|
/**
|
|
|
|
|
* Possible values for bar style.
|
|
|
|
|
*
|
|
|
|
|
* Solid means one continuous progress bar, Blocked means a
|
|
|
|
|
* progress bar made up of several blocks.
|
|
|
|
|
*/
|
|
|
|
|
* Solid means one continuous progress bar, Blocked means a
|
|
|
|
|
* progress bar made up of several blocks.
|
|
|
|
|
*/
|
|
|
|
|
enum BarStyle { Solid, Blocked };
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Construct a default progress bar. Orientation is horizontal.
|
|
|
|
|
/**
|
|
|
|
|
* Construct a default progress bar. Orientation is horizontal.
|
|
|
|
|
*/
|
|
|
|
|
CStatusBarProgress(TQWidget *parent=0, const char *name=0);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Construct a KProgress bar with an orientation.
|
|
|
|
|
/**
|
|
|
|
|
* Construct a KProgress bar with an orientation.
|
|
|
|
|
*/
|
|
|
|
|
CStatusBarProgress(Orientation, TQWidget *parent=0, const char *name=0);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Construct a KProgress bar with minimum, maximum and initial value.
|
|
|
|
|
/**
|
|
|
|
|
* Construct a KProgress bar with minimum, maximum and initial value.
|
|
|
|
|
*/
|
|
|
|
|
CStatusBarProgress(int minValue, int maxValue, int value, Orientation,
|
|
|
|
|
CStatusBarProgress(int minValue, int maxValue, int value, Orientation,
|
|
|
|
|
TQWidget *parent=0, const char *name=0);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Destructor
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Destructor
|
|
|
|
|
*/
|
|
|
|
|
~CStatusBarProgress( void );
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the progress bar style. Allowed values are Solid and Blocked.
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the progress bar style. Allowed values are Solid and Blocked.
|
|
|
|
|
*/
|
|
|
|
|
void setBarStyle(BarStyle style);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the color of the progress bar.
|
|
|
|
|
void setBarStyle(BarStyle style);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the color of the progress bar.
|
|
|
|
|
*/
|
|
|
|
|
void setBarColor(const TQColor &);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set a pixmap to be shown in the progress bar.
|
|
|
|
|
void setBarColor(const TQColor &);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set a pixmap to be shown in the progress bar.
|
|
|
|
|
*/
|
|
|
|
|
void setBarPixmap(const TQPixmap &);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the orientation of the progress bar.
|
|
|
|
|
* Allowed values are Horizonzal andQt::Vertical.
|
|
|
|
|
/**
|
|
|
|
|
* Set the orientation of the progress bar.
|
|
|
|
|
* Allowed values are Horizonzal and Vertical.
|
|
|
|
|
*/
|
|
|
|
|
void setOrientation(Orientation);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieve the bar style.
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieve the bar style.
|
|
|
|
|
*/
|
|
|
|
|
BarStyle barStyle() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieve the bar color.
|
|
|
|
|
/**
|
|
|
|
|
* Retrieve the bar color.
|
|
|
|
|
*/
|
|
|
|
|
const TQColor &barColor() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieve the bar pixmap.
|
|
|
|
|
/**
|
|
|
|
|
* Retrieve the bar pixmap.
|
|
|
|
|
*/
|
|
|
|
|
const TQPixmap *barPixmap() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieve the orientation.
|
|
|
|
|
/**
|
|
|
|
|
* Retrieve the orientation.
|
|
|
|
|
*/
|
|
|
|
|
Orientation orientation() const;
|
|
|
|
|
|
|
|
|
@ -116,19 +116,19 @@ class CStatusBarProgress : public TQFrame, public TQRangeControl
|
|
|
|
|
* the recommended height for vertical progress bars
|
|
|
|
|
*/
|
|
|
|
|
virtual TQSize sizeHint() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
void setValue( int );
|
|
|
|
|
void setValue( int, int);
|
|
|
|
|
void setValue( int, int);
|
|
|
|
|
void advance( int );
|
|
|
|
|
void setTextEnabled( bool state );
|
|
|
|
|
void setText( const TQString &msg );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void percentageChanged(int);
|
|
|
|
|
void pressed( void );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void valueChange();
|
|
|
|
|
void rangeChange();
|
|
|
|
@ -136,7 +136,7 @@ class CStatusBarProgress : public TQFrame, public TQRangeControl
|
|
|
|
|
void paletteChange( const TQPalette & );
|
|
|
|
|
void drawContents( TQPainter * );
|
|
|
|
|
void mousePressEvent( TQMouseEvent *e );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
TQPixmap *mBarPixmap;
|
|
|
|
|
TQColor mBarColor;
|
|
|
|
|