add auto zoombar/status color, fix 3 batchrender boobies, rotate plugin tweaks, add...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / puzzleobj / puzzleobjwindow.C
1 /*
2  * CINELERRA
3  * Copyright (C) 2014 Adam Williams <broadcast at earthling dot net>
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * 
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  * 
19  */
20
21 #include "bcdisplayinfo.h"
22 #include "clip.h"
23 #include "language.h"
24 #include "puzzleobj.h"
25 #include "puzzleobjwindow.h"
26 #include "theme.h"
27
28 PuzzleObjWindow::PuzzleObjWindow(PuzzleObj *plugin)
29  : PluginClientWindow(plugin, 320, 100, 320, 100, 0)
30 {
31         this->plugin = plugin; 
32         pixels = 0;
33         iterations = 0;
34         pixels_title = 0;
35         iterations_title = 0;
36 }
37
38 PuzzleObjWindow::~PuzzleObjWindow()
39 {
40 }
41
42 void PuzzleObjWindow::create_objects()
43 {
44         int x = 10, y = 10;
45         BC_Title *title = new BC_Title(x, y, _("PuzzleObj"));
46         add_subwindow(title);
47         y += title->get_h() + 10;
48         int x1 = x + 80;
49         add_subwindow(pixels_title = new BC_Title(x,y,_("Pixels:")));
50         add_subwindow(pixels = new PuzzleObjISlider(this,
51                         x1,y,180, 1,1000, &plugin->config.pixels));
52         y += pixels->get_h() + 10;
53         add_subwindow(iterations_title = new BC_Title(x,y,_("Iterations:")));
54         add_subwindow(iterations = new PuzzleObjISlider(this,
55                         x1,y,180, 0,50, &plugin->config.iterations));
56         show_window(1);
57 }
58
59 PuzzleObjISlider::PuzzleObjISlider(PuzzleObjWindow *win,
60                 int x, int y, int w, int min, int max, int *output)
61  : BC_ISlider(x, y, 0,w,w, min,max, *output)
62 {
63         this->win = win;
64         this->output = output;
65 }
66 PuzzleObjISlider::~PuzzleObjISlider()
67 {
68 }
69
70 int PuzzleObjISlider::handle_event()
71 {
72         *output = get_value();
73         win->plugin->send_configure_change();
74         return 1;
75 }
76