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

Download this file

OverViewWidget.h    79 lines (64 with data), 2.1 kB

 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef _OVER_VIEW_WIDGET_H_
#define _OVER_VIEW_WIDGET_H_ 1
#include <qpushbt.h>
#include <qwidget.h>
#include <qcombo.h>
#include <qpixmap.h>
#include <qtimer.h>
#include <qframe.h>
#include <kselect.h>
//#include <ktopwidget.h>
#include <kbuttonbox.h>
#include <kbutton.h>
//class MainWidget;
//***********************************************************
//OverviewWidget is the scrollbar in the main window
//QScrollbar has proven to be unstable with high numbers.
//this one also features a small overview of the part of the sample being
//unseen
class OverViewWidget : public QWidget
{
Q_OBJECT
public:
OverViewWidget(QWidget *parent = 0, const char *name = 0);
// OverViewWidget(MainWidget *parent = 0, const char *name = 0);
~OverViewWidget();
void mousePressEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
void setSignal(char *);
void setValue(int);
void refresh();
/** minimum size of the widtget, @see QWidget::minimumSize() */
virtual const QSize minimumSize();
/** optimal size for the widget, @see QWidget::sizeHint() */
virtual const QSize sizeHint();
public slots:
/*
* Sets new range parameters of the slider, using a scale that is calculated
* out of the slider's maximum position.
* @param new_val position of the slider (left or top of the bar)
* @param new_width width of the slider (bar)
* @param new_length size of the slider's area
*/
void setRange(int new_pos, int new_width, int new_length);
void increase();
signals:
void valueChanged (int);
protected:
void paintEvent(QPaintEvent *);
private:
int width, height;
bool grabbed;
int slider_width;
int slider_length;
int slider_pos;
int dir; //addup for direction...
bool redraw; //flag for redrawing pixmap
// MainWidget *mparent;
QWidget *parent;
QTimer *timer; //to spare user repeated pressing of the widget...
QPixmap *pixmap; //pixmap to be blitted to screen
}
;
#endif // _OVER_VIEW_WIDGET_H_