Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[0a1223]: libgui / ScaleWidget.h Maximize Restore History

Download this file

ScaleWidget.h    39 lines (28 with data), 949 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef _SCALE_WIDGET_H_
#define _SCALE_WIDGET_H_ 1
#include <qwidget.h>
class QPainter;
class QSize;
class ScaleWidget : public QWidget
{
public:
ScaleWidget(QWidget *parent = 0, int = 0, int = 100, char *unittext = "%");
~ScaleWidget();
void paintText(QPainter *, int, int, int, int, char *);
void setMaxMin(int, int);
void setUnit(char *);
void setLogMode(bool);
void drawLinear(QPainter *, int, int);
void drawLog(QPainter *, int, int);
/** minimum size of the widtget, @see QWidget::minimumSize() */
virtual const QSize minimumSize();
/** optimal size for the widget, @see QWidget::sizeHint() */
virtual const QSize sizeHint();
protected:
void paintEvent(QPaintEvent *);
private:
int low, high; //range of display
bool logmode; //conditional: logarithmic mode or not
char *unittext; //string containing the name of the unit
};
#endif // SCALE_WIDGET_H