ODIN
floatedit.h
1 /***************************************************************************
2  floatedit.h - description
3  -------------------
4  begin : Sun Aug 27 2000
5  copyright : (C) 2000-2021 by Thies Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef FLOATEDIT_H
19 #define FLOATEDIT_H
20 
21 #include <qgroupbox.h>
22 
23 #include "odinqt.h"
24 
29 class floatLineEdit : public QObject {
30  Q_OBJECT
31 
32  public:
33  floatLineEdit(float minValue, float maxValue, float value, int digits, QWidget *parent, const char *name, int width, int height );
34  ~floatLineEdit();
35 
36  QWidget* get_widget() {return gle->get_widget();}
37 
38  // required public for range slider
39  void set_value(float value);
40  float get_value() const {return value_cache;}
41 
42  public slots:
43  void setfloatLineEditValue( float value);
44 
45  private slots:
46  void emitSignal();
47 
48  signals:
49  void floatLineEditValueChanged(float value);
50 
51  private:
52 
53  int digits_cache;
54  float value_cache;
55 
56  GuiLineEdit* gle;
57 };
58 
59 
61 
66 class floatSlider : public QObject {
67  Q_OBJECT
68 
69  public:
70  floatSlider(float minValue, float maxValue, float step, float value, QWidget *parent, const char *name );
71  ~floatSlider();
72 
73  QWidget* get_widget();
74 
75  public slots:
76  void setfloatSliderValue( float value);
77 
78  private slots:
79  void emitSignal( int discrete_value);
80 
81  signals:
82  void floatSliderValueChanged( float newvalue);
83 
84 
85  private:
86  GuiSlider* gs;
87  float minValue_cache;
88  float step_cache;
89  int oldPosition;
90 };
91 
92 
94 
95 
100 class floatLineBox : public QGroupBox {
101  Q_OBJECT
102 
103  public:
104  floatLineBox(float value, int digits, QWidget *parent, const char *name);
105  ~floatLineBox();
106 
107  public slots:
108  void setfloatLineBoxValue( float value );
109 
110 
111  private slots:
112  void emitSignal( float value );
113 
114 
115  signals:
116  void floatLineBoxValueChanged( float value );
117 
118  private:
119  GuiGridLayout* grid;
120  floatLineEdit *le;
121 };
122 
123 
125 
130 class floatScientSlider : public QGroupBox {
131  Q_OBJECT
132 
133  public:
134  floatScientSlider(float minValue, float maxValue, float Step, float value, int digits, QWidget *parent, const char *name);
136 
137  public slots:
138  void setfloatScientSliderValue( float value );
139 
140  private slots:
141  void emitSignal( float value );
142 
143  signals:
144  void floatScientSliderValueChanged( float value );
145 
146  private:
147  float value;
148  floatSlider* slider;
149  GuiGridLayout* grid;
150  floatLineEdit *le;
151 
152 
153 };
154 
156 
161 class floatLineBox3D : public QGroupBox {
162  Q_OBJECT
163 
164  public:
165  floatLineBox3D(float xval, float yval, float zval, int digits, QWidget *parent, const char *name);
166  ~floatLineBox3D();
167 
168  public slots:
169  void setfloatLineBox3DValue( float xval, float yval, float zval );
170 
171  private slots:
172  void emitSignal_x( float newval );
173  void emitSignal_y( float newval );
174  void emitSignal_z( float newval );
175 
176  signals:
177  void floatLineBox3DValueChanged( float xval, float yval, float zval );
178  void SignalToChild_x( float );
179  void SignalToChild_y( float );
180  void SignalToChild_z( float );
181 
182  private:
183  GuiGridLayout* grid;
184  floatLineEdit *lex;
185  floatLineEdit *ley;
186  floatLineEdit *lez;
187  float xcache;
188  float ycache;
189  float zcache;
190 };
191 
192 
193 #endif