-
Notifications
You must be signed in to change notification settings - Fork 1
/
SpecialSlider4.cxx
49 lines (38 loc) · 985 Bytes
/
SpecialSlider4.cxx
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
#include "SpecialSlider4.h"
/*#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Slider.H>
#include <stdio.h>
#include <string.h>*/
SpecialSlider4::SpecialSlider4(int x, int y, int w, int h, const char *label)
: Fl_Value_Slider(x, y, w, h, label) {
//end();
}
int SpecialSlider4::handle(int event)
{
int handled = 1;
switch(event) {
case FL_RELEASE:
this->value(0);
break;
case FL_PUSH:
this->max = this->maximum();
this->min = this->minimum();
this->val = this->value();
default:
// pass other events to the base class...
handled= Fl_Value_Slider::handle(event);
}
this->redraw();
return (handled); // Returning one acknowledges that we handled this event
}
int SpecialSlider4::changevalue(float newval)
{
this->delta = newval - this->value();
this->maximum(this->maximum() + this->delta);
this->minimum(this->minimum() + this->delta);
this->value(newval);
this->redraw();
return 1;
}