1 #include "polarwindow.h"
4 #define _(String) gettext(String)
5 #define gettext_noop(String) String
6 #define N_(String) gettext_noop (String)
9 PLUGIN_THREAD_OBJECT(PolarMain, PolarThread, PolarWindow)
17 PolarWindow::PolarWindow(PolarMain *client)
26 !client->show_initially)
28 this->client = client;
31 PolarWindow::~PolarWindow()
39 int PolarWindow::create_objects()
42 add_tool(new BC_Title(x, y, _("Depth")));
43 add_tool(automation[0] = new AutomatedFn(client, this, x + 80, y, 0));
45 add_tool(depth_slider = new DepthSlider(client, x, y));
47 add_tool(new BC_Title(x, y, _("Angle")));
48 add_tool(automation[1] = new AutomatedFn(client, this, x + 80, y, 1));
50 add_tool(angle_slider = new AngleSlider(client, x, y));
53 int PolarWindow::close_event()
55 client->save_defaults();
57 client->send_hide_gui();
60 DepthSlider::DepthSlider(PolarMain *client, int x, int y)
61 : BC_ISlider(x, y, 190, 30, 200, client->depth, 0, MAXDEPTH, DKGREY, BLACK, 1)
63 this->client = client;
65 DepthSlider::~DepthSlider()
68 int DepthSlider::handle_event()
70 client->depth = get_value();
71 client->send_configure_change();
74 AngleSlider::AngleSlider(PolarMain *client, int x, int y)
75 : BC_ISlider(x, y, 190, 30, 200, client->angle, 0, MAXANGLE, DKGREY, BLACK, 1)
77 this->client = client;
79 AngleSlider::~AngleSlider()
82 int AngleSlider::handle_event()
84 client->angle = get_value();
85 client->send_configure_change();
88 AutomatedFn::AutomatedFn(PolarMain *client, PolarWindow *window, int x, int y, int number)
89 : BC_CheckBox(x, y, 16, 16, client->automated_function == number, _("Automate"))
91 this->client = client;
92 this->window = window;
93 this->number = number;
96 AutomatedFn::~AutomatedFn()
100 int AutomatedFn::handle_event()
102 for(int i = 0; i < 2; i++)
104 if(i != number) window->automation[i]->update(0);
107 client->automated_function = number;
108 client->send_configure_change();