r663: This commit was generated by cvs2svn to compensate for changes in r662,
[cinelerra_cv.git] / cinelerra / trackscroll.C
blobaa78a794226a2f515a6790eee50ad59cee677638
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();
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;