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, 320, 100, 320, 100, 0)
31 this->plugin = plugin;
38 PuzzleObjWindow::~PuzzleObjWindow()
42 void PuzzleObjWindow::create_objects()
45 BC_Title *title = new BC_Title(x, y, _("PuzzleObj"));
47 y += title->get_h() + 10;
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));
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)
64 this->output = output;
66 PuzzleObjISlider::~PuzzleObjISlider()
70 int PuzzleObjISlider::handle_event()
72 *output = get_value();
73 win->plugin->send_configure_change();