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, 300, 180, 300, 180, 0)
29 this->plugin = plugin;
32 AgingWindow::~AgingWindow()
36 void AgingWindow::create_objects()
40 add_subwindow(title = new BC_Title(x, y, _("Aging:")));
41 y += title->get_h() + 15;
43 add_subwindow(color = new AgingCheckBox(this, x, y,
44 &plugin->config.colorage, _("Grain")));
45 y += color->get_h() + 5;
47 add_subwindow(scratches = new AgingCheckBox(this, x, y,
48 &plugin->config.scratch, _("Scratch")));
49 add_subwindow(scratch_count = new AgingISlider(this, x+100, y, 180,
50 0,SCRATCH_MAX, &plugin->config.scratch_lines));
51 y += scratches->get_h() + 5;
53 add_subwindow(pits = new AgingCheckBox(this, x, y,
54 &plugin->config.pits, _("Pits")));
55 add_subwindow(pit_count = new AgingISlider(this, x+100, y, 180,
56 0,100, &plugin->config.pits_interval));
57 y += pits->get_h() + 5;
59 add_subwindow(dust = new AgingCheckBox(this, x, y,
60 &plugin->config.dust, _("Dust")));
61 add_subwindow(dust_count = new AgingISlider(this, x+100, y, 180,
62 0,100, &plugin->config.dust_interval));
68 AgingISlider::AgingISlider(AgingWindow *win,
69 int x, int y, int w, int min, int max, int *output)
70 : BC_ISlider(x, y, 0, w, w, min, max, *output)
73 this->output = output;
76 AgingISlider::~AgingISlider()
80 int AgingISlider::handle_event()
82 int ret = BC_ISlider::handle_event();
83 win->plugin->send_configure_change();
87 AgingCheckBox::AgingCheckBox(AgingWindow *win, int x, int y,
88 int *output, const char *text)
89 : BC_CheckBox(x, y, output, text)
94 int AgingCheckBox::handle_event()
96 int ret = BC_CheckBox::handle_event();
97 win->plugin->send_configure_change();