3 * Copyright (C) 2014 Adam Williams <broadcast at earthling dot net>
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.
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.
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
21 #include "bcdisplayinfo.h"
24 #include "puzzleobj.h"
25 #include "puzzleobjwindow.h"
28 PuzzleObjWindow::PuzzleObjWindow(PuzzleObj *plugin)
29 : PluginClientWindow(plugin, xS(320), yS(100), xS(320), yS(100), 0)
31 this->plugin = plugin;
38 PuzzleObjWindow::~PuzzleObjWindow()
42 void PuzzleObjWindow::create_objects()
44 int xs10 = xS(10), xs50 = xS(50), xs80 = xS(80), xs180 = xS(180);
46 int x = xs10, y = ys10;
47 BC_Title *title = new BC_Title(x, y, _("PuzzleObj"));
49 y += title->get_h() + ys10;
51 add_subwindow(pixels_title = new BC_Title(x,y,_("Pixels:")));
52 add_subwindow(pixels = new PuzzleObjISlider(this,
53 x1,y,xs180, 1,1000, &plugin->config.pixels));
54 y += pixels->get_h() + ys10;
55 add_subwindow(iterations_title = new BC_Title(x,y,_("Iterations:")));
56 add_subwindow(iterations = new PuzzleObjISlider(this,
57 x1,y,xs180, 0,50, &plugin->config.iterations));
61 PuzzleObjISlider::PuzzleObjISlider(PuzzleObjWindow *win,
62 int x, int y, int w, int min, int max, int *output)
63 : BC_ISlider(x, y, 0,w,w, min,max, *output)
66 this->output = output;
68 PuzzleObjISlider::~PuzzleObjISlider()
72 int PuzzleObjISlider::handle_event()
74 *output = get_value();
75 win->plugin->send_configure_change();