r1014: Enable horizontal scrolling with the mouse wheel by pressing Ctrl.
[cinelerra_cv/ct.git] / cinelerra / viewmenu.C
blobd37a4e3aefb17149add8554f61abba0b22da581d
1 #include "autoconf.h"
2 #include "edl.h"
3 #include "edlsession.h"
4 #include "gwindow.h"
5 #include "gwindowgui.h"
6 #include "language.h"
7 #include "mainmenu.h"
8 #include "mwindow.h"
9 #include "mwindowgui.h"
10 #include "viewmenu.h"
11 #include "trackcanvas.h"
17 ShowAssets::ShowAssets(MWindow *mwindow, char *hotkey)
18  : BC_MenuItem(_("Show assets"), hotkey, hotkey[0])
20         this->mwindow = mwindow; 
21         set_checked(mwindow->edl->session->show_assets); 
24 int ShowAssets::handle_event()
26         set_checked(get_checked() ^ 1);
27         mwindow->edl->session->show_assets = get_checked();
28         mwindow->gui->update(1,
29                 1,
30                 0,
31                 0,
32                 1, 
33                 0,
34                 0);
35         mwindow->gui->unlock_window();
36         mwindow->gwindow->gui->update_toggles(1);
37         mwindow->gui->lock_window("ShowAssets::handle_event");
38         return 1;
44 ShowTitles::ShowTitles(MWindow *mwindow, char *hotkey)
45  : BC_MenuItem(_("Show titles"), hotkey, hotkey[0])
47         this->mwindow = mwindow; 
48         set_checked(mwindow->edl->session->show_titles); 
51 int ShowTitles::handle_event()
53         set_checked(get_checked() ^ 1);
54         mwindow->edl->session->show_titles = get_checked();
55         mwindow->gui->update(1,
56                 1,
57                 0,
58                 0,
59                 1, 
60                 0,
61                 0);
62         mwindow->gui->unlock_window();
63         mwindow->gwindow->gui->update_toggles(1);
64         mwindow->gui->lock_window("ShowTitles::handle_event");
65         return 1;
70 ShowTransitions::ShowTransitions(MWindow *mwindow, char *hotkey)
71  : BC_MenuItem(_("Show transitions"), hotkey, hotkey[0])
72
73         this->mwindow = mwindow; 
74         set_checked(mwindow->edl->session->auto_conf->transitions); 
76 int ShowTransitions::handle_event()
78         set_checked(get_checked() ^ 1);
79         mwindow->edl->session->auto_conf->transitions = get_checked();
80         mwindow->gui->canvas->draw_overlays();
81         mwindow->gui->canvas->flash();
82 //      mwindow->gui->mainmenu->draw_items();
83         mwindow->gui->unlock_window();
84         mwindow->gwindow->gui->update_toggles(1);
85         mwindow->gui->lock_window("ShowTransitions::handle_event");
86         return 1;
93 ShowAutomation::ShowAutomation(MWindow *mwindow, 
94         char *text,
95         char *hotkey,
96         int subscript)
97  : BC_MenuItem(text, hotkey, hotkey[0])
99         this->mwindow = mwindow;
100         this->subscript = subscript;
101         set_checked(mwindow->edl->session->auto_conf->autos[subscript]); 
104 int ShowAutomation::handle_event()
106         set_checked(get_checked() ^ 1);
107         mwindow->edl->session->auto_conf->autos[subscript] = get_checked();
108         mwindow->gui->canvas->draw_overlays();
109         mwindow->gui->canvas->flash();
110 //      mwindow->gui->mainmenu->draw_items();
111         mwindow->gui->unlock_window();
112         mwindow->gwindow->gui->update_toggles(1);
113         mwindow->gui->lock_window("ShowAutomation::handle_event");
114         return 1;
117 void ShowAutomation::update_toggle()
119         set_checked(mwindow->edl->session->auto_conf->autos[subscript]);
124 PluginAutomation::PluginAutomation(MWindow *mwindow, char *hotkey)
125  : BC_MenuItem(_("Plugin Autos"), hotkey, hotkey[0]) 
127         this->mwindow = mwindow; 
130 int PluginAutomation::handle_event()
132         set_checked(!get_checked());
133         mwindow->edl->session->auto_conf->plugins = get_checked();
134         mwindow->gui->canvas->draw_overlays();
135         mwindow->gui->canvas->flash();
136 //      mwindow->gui->mainmenu->draw_items();
137         mwindow->gui->unlock_window();
138         mwindow->gwindow->gui->update_toggles(1);
139         mwindow->gui->lock_window("PluginAutomation::handle_event");
140         return 1;