2015-09-25 21:37:19 +02:00
|
|
|
// File: fprogressbar.h
|
|
|
|
// Provides: class FProgressbar
|
|
|
|
//
|
|
|
|
// Inheritance diagram
|
|
|
|
// ═══════════════════
|
|
|
|
//
|
|
|
|
// ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏
|
|
|
|
// ▕ FObject ▏ ▕ FTerm ▏
|
|
|
|
// ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏
|
|
|
|
// ▲ ▲
|
|
|
|
// │ │
|
|
|
|
// └─────┬─────┘
|
|
|
|
// │
|
2016-10-11 04:57:36 +02:00
|
|
|
// ▕▔▔▔▔▔▔▔▔▏
|
|
|
|
// ▕ FVTerm ▏
|
|
|
|
// ▕▁▁▁▁▁▁▁▁▏
|
|
|
|
// ▲
|
|
|
|
// │
|
2015-09-25 21:37:19 +02:00
|
|
|
// ▕▔▔▔▔▔▔▔▔▔▏
|
|
|
|
// ▕ FWidget ▏
|
|
|
|
// ▕▁▁▁▁▁▁▁▁▁▏
|
|
|
|
// ▲
|
|
|
|
// │
|
|
|
|
// ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
|
|
|
|
// ▕ FProgressbar ▏
|
|
|
|
// ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
|
2015-05-23 13:35:12 +02:00
|
|
|
|
2017-04-09 20:08:53 +02:00
|
|
|
#ifndef FPROGRESSBAR_H
|
|
|
|
#define FPROGRESSBAR_H
|
2015-05-23 13:35:12 +02:00
|
|
|
|
2017-09-17 21:32:46 +02:00
|
|
|
#include "final/fwidget.h"
|
2015-05-23 13:35:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// class FProgressbar
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
|
|
|
|
|
|
|
class FProgressbar : public FWidget
|
|
|
|
{
|
2017-09-11 03:06:02 +02:00
|
|
|
public:
|
|
|
|
// Using-declarations
|
|
|
|
using FWidget::setGeometry;
|
|
|
|
|
|
|
|
// Constructor
|
|
|
|
explicit FProgressbar(FWidget* = 0);
|
|
|
|
|
|
|
|
// Destructor
|
|
|
|
virtual ~FProgressbar();
|
|
|
|
|
|
|
|
// Accessors
|
|
|
|
const char* getClassName() const;
|
|
|
|
int getPercentage();
|
|
|
|
|
|
|
|
// Mutators
|
|
|
|
void setPercentage (int);
|
|
|
|
void setGeometry (int, int, int, int, bool = true);
|
|
|
|
bool setShadow (bool);
|
|
|
|
bool setShadow();
|
|
|
|
bool unsetShadow();
|
|
|
|
|
|
|
|
// Inquiries
|
|
|
|
bool hasShadow();
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
void hide();
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Methods
|
|
|
|
virtual void draw();
|
|
|
|
void drawPercentage();
|
|
|
|
void drawBar();
|
|
|
|
|
|
|
|
// Data Members
|
|
|
|
int percentage;
|
|
|
|
int bar_length;
|
2015-05-23 13:35:12 +02:00
|
|
|
};
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
|
|
|
|
|
|
// FProgressbar inline functions
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline const char* FProgressbar::getClassName() const
|
|
|
|
{ return "FProgressbar"; }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline int FProgressbar::getPercentage()
|
|
|
|
{ return percentage; }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FProgressbar::setShadow()
|
|
|
|
{ return setShadow(true); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FProgressbar::unsetShadow()
|
|
|
|
{ return setShadow(false); }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
inline bool FProgressbar::hasShadow()
|
2016-01-24 14:53:09 +01:00
|
|
|
{ return ((flags & fc::shadow) != 0); }
|
2015-05-23 13:35:12 +02:00
|
|
|
|
|
|
|
|
2017-04-09 20:08:53 +02:00
|
|
|
#endif // FPROGRESSBAR_H
|