-
Notifications
You must be signed in to change notification settings - Fork 0
/
arnMSSliderItem.h
145 lines (111 loc) · 4.83 KB
/
arnMSSliderItem.h
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/***************************************************************************
arnMSSliderItem.h - description
-------------------
begin : gio Feb 9 2006
copyright : (C) 2006 by Aurion s.r.l.
email : fabio.giovagnini@aurion-tech.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef ArnMSSliderItemH
#define ArnMSSliderItemH
#include <qframe.h>
#include <qslider.h>
#include <qlayout.h>
#include <QMenu>
#include <qaction.h>
#include "arnqlabel.h"
#include "arnqslider.h"
class arnMSSliderItem : public QFrame {
Q_OBJECT
private:
void init(void);
private slots:
void doValueChange(int val) {emit valueChanged(val);}
void Nascondi_Hndl(void);
void Connetti_Hndl(bool tg);
protected:
QLabel* Name;
arnQLabel* Value;
arnQSlider* Slider;
QHBoxLayout *pHLayout;
QMenu *pPopUp;
virtual void mousePressEvent(QMouseEvent *e);
public:
QAction *Nascondi;
QAction *Connetti;
/*! \brief constructor in QT style \n
*
*/
arnMSSliderItem(QWidget *parent = 0, const char* name = 0, Qt::WFlags f = 0);
/*! \brief constructor in QT style \n
*
*/
arnMSSliderItem(const QString& label = "", QWidget *parent = 0, const char* name = 0, Qt::WFlags f = 0);
/*! \brief constructor in QT style \n
*
*/
arnMSSliderItem(const QString& label = "", const QString& value = "0", QWidget *parent = 0, const char* name = 0, Qt::WFlags f = 0);
/*! \brief constructor in QT style \n
*
*/
arnMSSliderItem(const QString& label = "", int value = 0, QWidget *parent = 0, const char* name = 0, Qt::WFlags f = 0);
/*! \brief default destructor\n
*
*/
~arnMSSliderItem(void);
signals:
void valueChanged(int val);
public slots:
/*! \brief overloaded function : set the value for the channel of a fixed index\n
*
* @param index is the index in the list of the channels\n
* @param val is the value to set\n
*
* This function does the direct setting of the index channel\n
* it is an optimized function to reduce the access time to the list.
*
* Ex:\n
* ...\n
*/
inline QString name(void) {return Name->text();}
/*! \brief overloaded function : set the value for the channel of a fixed index\n
*
* @param index is the index in the list of the channels\n
* @param val is the value to set\n
*
* This function does the direct setting of the index channel\n
* it is an optimized function to reduce the access time to the list.
*
* Ex:\n
* ...\n
*/
inline void setName(const QString& name) {return Name->setText(name);}
inline void setSliderMin(int min) {Slider->setMinValue(min);}
inline void setSliderMax(int max) {Slider->setMaxValue(max); }
inline int SliderMin(void) {return Slider->minValue();}
inline int SliderMax(void) {return Slider->maxValue();}
inline void setSliderValue(int val) {Slider->setValue(val);}
inline double sliderValue(void) {return ((double) (Slider->value()));}
inline void setValueSize(NumericFixedFormat_t sz, char f = 'f' ,int pr = 3) {Value->setSize(sz,f,pr);}
inline void setValueMin( double min) {Value->setMin(min);}
inline void setValueMax( double max) {Value->setMax(max);}
inline double ValueMin( void ) {return Value->Min();}
inline double ValueMax( void ) {return Value->Max();}
double value(void);
inline QString text(void) {return Value->text();}
inline bool isConnected(void) {return ((Connetti != 0) ? Connetti->isOn(): false);}
inline void setMulSelKeyUP(Qt::Key K) {Slider->setMulSelKeyUP(K);}
inline void setMulSelKeyDOWN(Qt::Key K) {Slider->setMulSelKeyDOWN(K);}
inline Qt::Key getMulSelKeyUP(void) {return Slider->getMulSelKeyUP();}
inline Qt::Key getMulSelKeyDOWN(void) {return Slider->getMulSelKeyDOWN();}
inline int lineStep(void) {return Slider->lineStep();}
inline int pageStep(void) {return Slider->pageStep();}
};
#endif