remove whitespace at eol
[goodguy/history.git] / cinelerra-5.1 / plugins / translate / translatewin.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 "bcdisplayinfo.h"
23 #include "clip.h"
24 #include "language.h"
25 #include "translate.h"
26 #include "translatewin.h"
27
28
29
30
31
32
33
34
35
36
37
38
39
40 TranslateWin::TranslateWin(TranslateMain *client)
41  : PluginClientWindow(client,
42         300,
43         220,
44         300,
45         220,
46         0)
47 {
48         this->client = client;
49 }
50
51 TranslateWin::~TranslateWin()
52 {
53 }
54
55 void TranslateWin::create_objects()
56 {
57         int x = 10, y = 10;
58
59         add_tool(new BC_Title(x, y, _("In X:")));
60         y += 20;
61         in_x = new TranslateCoord(this, client, x, y, &client->config.in_x);
62         in_x->create_objects();
63         y += 30;
64
65         add_tool(new BC_Title(x, y, _("In Y:")));
66         y += 20;
67         in_y = new TranslateCoord(this, client, x, y, &client->config.in_y);
68         in_y->create_objects();
69         y += 30;
70
71         add_tool(new BC_Title(x, y, _("In W:")));
72         y += 20;
73         in_w = new TranslateCoord(this, client, x, y, &client->config.in_w);
74         in_w->create_objects();
75         y += 30;
76
77         add_tool(new BC_Title(x, y, _("In H:")));
78         y += 20;
79         in_h = new TranslateCoord(this, client, x, y, &client->config.in_h);
80         in_h->create_objects();
81         y += 30;
82
83
84         x += 150;
85         y = 10;
86         add_tool(new BC_Title(x, y, _("Out X:")));
87         y += 20;
88         out_x = new TranslateCoord(this, client, x, y, &client->config.out_x);
89         out_x->create_objects();
90         y += 30;
91
92         add_tool(new BC_Title(x, y, _("Out Y:")));
93         y += 20;
94         out_y = new TranslateCoord(this, client, x, y, &client->config.out_y);
95         out_y->create_objects();
96         y += 30;
97
98         add_tool(new BC_Title(x, y, _("Out W:")));
99         y += 20;
100         out_w = new TranslateCoord(this, client, x, y, &client->config.out_w);
101         out_w->create_objects();
102         y += 30;
103
104         add_tool(new BC_Title(x, y, _("Out H:")));
105         y += 20;
106         out_h = new TranslateCoord(this, client, x, y, &client->config.out_h);
107         out_h->create_objects();
108         y += 30;
109
110
111
112         show_window();
113         flush();
114 }
115
116
117
118 TranslateCoord::TranslateCoord(TranslateWin *win,
119         TranslateMain *client,
120         int x,
121         int y,
122         float *value)
123  : BC_TumbleTextBox(win,
124         (int)*value,
125         (int)0,
126         (int)10000,
127         x,
128         y,
129         100)
130 {
131 //printf("TranslateWidth::TranslateWidth %f\n", client->config.w);
132         this->client = client;
133         this->win = win;
134         this->value = value;
135 }
136
137 TranslateCoord::~TranslateCoord()
138 {
139 }
140
141 int TranslateCoord::handle_event()
142 {
143         *value = atof(get_text());
144
145         client->send_configure_change();
146         return 1;
147 }
148
149