prevent popup deactivation while button_down
[goodguy/history.git] / cinelerra-5.0 / cinelerra / apanel.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * 
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  */
21
22 #include "apanel.h"
23 #include "cwindowgui.h"
24 #include "language.h"
25
26
27 APanel::APanel(MWindow *mwindow, CWindowGUI *subwindow, int x, int y, int w, int h)
28 {
29         this->mwindow = mwindow;
30         this->subwindow = subwindow;
31         this->x = x;
32         this->y = y;
33         this->w = w;
34         this->h = h;
35 }
36
37 APanel::~APanel()
38 {
39 }
40
41 int APanel::create_objects()
42 {
43         int x = this->x + 5, y = this->y + 10;
44         char string[BCTEXTLEN];
45         int x1 = x;
46
47         subwindow->add_subwindow(new BC_Title(x, y, _("Automation")));
48         y += 20;
49         for(int i = 0; i < PLUGINS; i++)
50         {
51                 sprintf(string, _("Plugin %d"), i + 1);
52                 subwindow->add_subwindow(new BC_Title(x, y, string, SMALLFONT));
53                 subwindow->add_subwindow(plugin_autos[i] = new APanelPluginAuto(mwindow, this, x, y + 20));
54                 if(x == x1)
55                 {
56                         x += plugin_autos[i]->get_w();
57                 }
58                 else
59                 {
60                         x = x1;
61                         y += plugin_autos[i]->get_h() + 20;
62                 }
63         }
64         
65         subwindow->add_subwindow(mute = new APanelMute(mwindow, this, x, y));
66         y += mute->get_h();
67         subwindow->add_subwindow(play = new APanelPlay(mwindow, this, x, y));
68         return 0;
69 }
70
71
72
73
74 APanelPluginAuto::APanelPluginAuto(MWindow *mwindow, APanel *gui, int x, int y)
75  : BC_FPot(x, 
76                 y, 
77                 0, 
78                 -1, 
79                 1)
80 {
81         this->mwindow = mwindow;
82         this->gui = gui;
83 }
84 int APanelPluginAuto::handle_event()
85 {
86         return 1;
87 }
88
89 APanelMute::APanelMute(MWindow *mwindow, APanel *gui, int x, int y)
90  : BC_CheckBox(x, y, 0, _("Mute"))
91 {
92         this->mwindow = mwindow;
93         this->gui = gui;
94 }
95 int APanelMute::handle_event()
96 {
97         return 1;
98 }
99
100
101 APanelPlay::APanelPlay(MWindow *mwindow, APanel *gui, int x, int y)
102  : BC_CheckBox(x, y, 1, _("Play"))
103 {
104         this->mwindow = mwindow;
105         this->gui = gui;
106 }
107 int APanelPlay::handle_event()
108 {
109         return 1;
110 }
111
112