-
Notifications
You must be signed in to change notification settings - Fork 1
/
SpecialRoller2.cxx
55 lines (46 loc) · 1.23 KB
/
SpecialRoller2.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
50
51
52
53
54
55
#include "SpecialRoller2.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>*/
SpecialRoller2::SpecialRoller2(int x,int y,int w,int h,const char* label)
: Fl_Roller(x, y, w, h, label) {
//end();
}
int SpecialRoller2::handle(int event)
{
int handled = 1;
Fl_Group* Pointeur0 = (Fl_Group*)(this->parent());
Fl_Group* Pointeur1 = (Fl_Group*)(Pointeur0->parent());
MeshTools* Pointeur = (MeshTools*)(Pointeur1->child(0));
switch(event) {
case FL_RELEASE:
Pointeur->rollinit_camera();
Pointeur->rollinit_objects();
//this->maximum(this->max);
//this->minimum(this->min);
this->value(0);
break;
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_Roller::handle(event);
}
this->redraw();
return (handled); // Returning one acknowledges that we handled this event
}
int SpecialRoller2::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;
}