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
23 #include "oilwindow.h"
25 OilThread::OilThread(OilMain *client)
28 this->client = client;
29 synchronous = 1; // make thread wait for join
33 OilThread::~OilThread()
39 window = new OilWindow(client);
40 window->create_objects();
51 OilWindow::OilWindow(OilMain *client)
52 : BC_Window("", MEGREY, client->gui_string, 150, 130, 150, 130, 0, !client->show_initially)
53 { this->client = client; }
55 OilWindow::~OilWindow()
60 int OilWindow::create_objects()
63 add_tool(new BC_Title(x, y, _("Oil Painting")));
65 add_tool(radius = new OilRadius(client, x, y));
67 add_tool(new BC_Title(x, y, _("Radius")));
70 add_tool(use_intensity = new OilIntensity(client, x, y));
73 int OilWindow::close_event()
76 client->send_hide_gui();
79 OilRadius::OilRadius(OilMain *client, int x, int y)
80 : BC_IPot(x, y, 35, 35, client->radius, 1, 45, DKGREY, BLACK)
82 this->client = client;
84 OilRadius::~OilRadius()
87 int OilRadius::handle_event()
89 client->radius = get_value();
90 client->send_configure_change();
94 OilIntensity::OilIntensity(OilMain *client, int x, int y)
95 : BC_CheckBox(x, y, 16, 16, client->use_intensity, _("Use Intensity"))
97 this->client = client;
99 OilIntensity::~OilIntensity()
102 int OilIntensity::handle_event()
104 client->use_intensity = get_value();
105 client->send_configure_change();