r999: maintainers added to README_en.
[cinelerra_cv/mob.git] / cinelerra / trackscroll.C
blob621dac538c9339d7aa249859e438b11a1a644b52
1 #include "edl.h"
2 #include "edlsession.h"
3 #include "localsession.h"
4 #include "maincursor.h"
5 #include "mwindow.h"
6 #include "mwindowgui.h"
7 #include "patchbay.h"
8 #include "mainsession.h"
9 #include "theme.h"
10 #include "trackcanvas.h"
11 #include "tracks.h"
12 #include "trackscroll.h"
14 TrackScroll::TrackScroll(MWindow *mwindow, MWindowGUI *gui, int x, int y, int h)
15  : BC_ScrollBar(x, 
16         y, 
17         SCROLL_VERT, 
18         h, 
19         0, 
20         0, 
21         0)
23         this->mwindow = mwindow;
24         this->gui = gui;
25         old_position = 0;
28 TrackScroll::~TrackScroll()
32 long TrackScroll::get_distance()
34         return get_value() - old_position;
37 int TrackScroll::update()
39         return 0;
42 int TrackScroll::resize_event()
44         reposition_window(mwindow->theme->mvscroll_x, 
45                 mwindow->theme->mvscroll_y, 
46                 mwindow->theme->mvscroll_h);
47         update();
48         return 0;
51 int TrackScroll::flip_vertical(int top, int bottom)
53         return 0;
56 int TrackScroll::handle_event()
58         mwindow->edl->local_session->track_start = get_value();
59         mwindow->edl->tracks->update_y_pixels(mwindow->theme);
60         mwindow->gui->canvas->draw();
61         mwindow->gui->cursor->draw(1);
62         mwindow->gui->patchbay->update();
63         mwindow->gui->canvas->flash();
64 // Scrollbar must be active to trap button release events
65 //      mwindow->gui->canvas->activate();
66         old_position = get_value();
67         flush();
68         return 1;