4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #include "bcdisplayinfo.h"
23 #include "agingwindow.h"
26 AgingWindow::AgingWindow(AgingMain *plugin)
27 : PluginClientWindow(plugin, xS(300), yS(180), xS(300), yS(180), 0)
29 this->plugin = plugin;
32 AgingWindow::~AgingWindow()
36 void AgingWindow::create_objects()
39 int ys5 = yS(5), ys15 = yS(15), ys180 = yS(180);
40 int x = xS(10), y = yS(10);
42 add_subwindow(title = new BC_Title(x, y, _("Aging:")));
43 y += title->get_h() + ys15;
45 add_subwindow(color = new AgingCheckBox(this, x, y,
46 &plugin->config.colorage, _("Grain")));
47 y += color->get_h() + ys5;
49 add_subwindow(scratches = new AgingCheckBox(this, x, y,
50 &plugin->config.scratch, _("Scratch")));
51 add_subwindow(scratch_count = new AgingISlider(this, x+xs100, y, ys180,
52 0,SCRATCH_MAX, &plugin->config.scratch_lines));
53 y += scratches->get_h() + ys5;
55 add_subwindow(pits = new AgingCheckBox(this, x, y,
56 &plugin->config.pits, _("Pits")));
57 add_subwindow(pit_count = new AgingISlider(this, x+xs100, y, ys180,
58 0,100, &plugin->config.pits_interval));
59 y += pits->get_h() + ys5;
61 add_subwindow(dust = new AgingCheckBox(this, x, y,
62 &plugin->config.dust, _("Dust")));
63 add_subwindow(dust_count = new AgingISlider(this, x+xs100, y, ys180,
64 0,100, &plugin->config.dust_interval));
70 AgingISlider::AgingISlider(AgingWindow *win,
71 int x, int y, int w, int min, int max, int *output)
72 : BC_ISlider(x, y, 0, w, w, min, max, *output)
75 this->output = output;
78 AgingISlider::~AgingISlider()
82 int AgingISlider::handle_event()
84 int ret = BC_ISlider::handle_event();
85 *output = get_value();
86 win->plugin->send_configure_change();
90 AgingCheckBox::AgingCheckBox(AgingWindow *win, int x, int y,
91 int *output, const char *text)
92 : BC_CheckBox(x, y, output, text)
97 int AgingCheckBox::handle_event()
99 int ret = BC_CheckBox::handle_event();
100 win->plugin->send_configure_change();