File: ValueSlider.h

package info (click to toggle)
quickplot 0.8.6-1.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,548 kB
  • ctags: 1,019
  • sloc: cpp: 10,052; sh: 7,597; makefile: 176
file content (105 lines) | stat: -rw-r--r-- 1,887 bytes parent folder | download | duplicates (3)
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
/* Copyright (c) 1998, 1999, 2003, 2004  Lance Arsenault, (GNU GPL (v2+))
 */


class ValueSlider : public Frame
{
public:
  ValueSlider(int min, int max, int maxmax, const Glib::ustring& label_text);

  inline int getValue(void) { return value; }
  void setValue(int val);
  
private:
  HBox hBox;
  Adjustment adjustment;
  HScale scale;
  Entry entry;

  int value;
  double maxmax;

public:
  SigC::Signal0<void> signal_valueChanged();

private:
  SigC::Signal0<void> m_signal_valueChanged;

  bool setScaleToEntry(void);

  bool setEntryToScale(void);

  void on_adjustmentValueChanged(void);
  void on_entryValueChanged(void);

  bool inSettingValues;
};


class DoubleValueSlider : public Frame
{
public:
  DoubleValueSlider(double min, double max, double maxmax, const Glib::ustring& label_text);

  inline double getValue(void) { return value; }
  void setValue(double val);
  
private:
  HBox hBox;
  Adjustment adjustment;
  HScale scale;
  Entry entry;

  double value, maxmax;

public:
  SigC::Signal0<void> signal_valueChanged();

private:
  SigC::Signal0<void> m_signal_valueChanged;

  bool setScaleToEntry(void);

  bool setEntryToScale(void);

  void on_adjustmentValueChanged(void);
  void on_entryValueChanged(void);

  bool inSettingValues;
};


// Like ValueSlider with a logarithmically changing scale.
class LogValueSlider : public Frame
{
public:
  LogValueSlider(int min, int max, const Glib::ustring& label_text);

  int getValue(void);
  void setValue(int val);
  
private:
  HBox hBox;
  Adjustment adjustment;
  HScale scale;
  Entry entry;

  // log of getValue()
  double value;

public:
  SigC::Signal0<void> signal_valueChanged();

private:
  SigC::Signal0<void> m_signal_valueChanged;

  bool setScaleToEntry(void);

  bool setEntryToScale(void);

  void on_adjustmentValueChanged(void);
  void on_entryValueChanged(void);

  bool inSettingValues;
};