class WhirlEffect;
class WhirlWindow;
class WhirlEngine;
+class WhirlReset;
#define MAXRADIUS 100
#define MAXPINCH 100
{
public:
WhirlConfig();
+ void reset();
void copy_from(WhirlConfig &src);
int equivalent(WhirlConfig &src);
WhirlEffect *plugin;
};
+
+class WhirlReset : public BC_GenericButton
+{
+public:
+ WhirlReset(WhirlEffect *plugin, WhirlWindow *window, int x, int y);
+ ~WhirlReset();
+ int handle_event();
+ WhirlEffect *plugin;
+ WhirlWindow *window;
+};
+
+
class WhirlWindow : public PluginClientWindow
{
public:
WhirlWindow(WhirlEffect *plugin);
void create_objects();
+ void update();
WhirlEffect *plugin;
WhirlRadius *radius;
WhirlPinch *pinch;
WhirlAngle *angle;
+ WhirlReset *reset;
};
-
-
WhirlConfig::WhirlConfig()
{
- angle = 0.0;
- pinch = 0.0;
- radius = 0.0;
+ reset();
+}
+
+void WhirlConfig::reset()
+{
+ angle = 180.0; // 0.0;
+ pinch = 10.0; // 0.0;
+ radius = 50.0; // 0.0;
}
void WhirlConfig::copy_from(WhirlConfig &src)
WhirlWindow::WhirlWindow(WhirlEffect *plugin)
: PluginClientWindow(plugin,
220,
- 200,
+ 195,
220,
- 200,
+ 195,
0)
{
this->plugin = plugin;
add_subwindow(new BC_Title(x, y, _("Radius")));
y += 20;
add_subwindow(radius = new WhirlRadius(plugin, x, y));
- y += 40;
+ y += 30;
add_subwindow(new BC_Title(x, y, _("Pinch")));
y += 20;
add_subwindow(pinch = new WhirlPinch(plugin, x, y));
- y += 40;
+ y += 30;
add_subwindow(new BC_Title(x, y, _("Angle")));
y += 20;
add_subwindow(angle = new WhirlAngle(plugin, x, y));
+ y += 35;
+ add_subwindow(reset = new WhirlReset(plugin, this, x, y));
show_window();
flush();
}
-
+// for Reset button
+void WhirlWindow::update()
+{
+ radius->update(plugin->config.radius);
+ pinch->update(plugin->config.pinch);
+ angle->update(plugin->config.angle);
+}
+WhirlReset::WhirlReset(WhirlEffect *plugin, WhirlWindow *window, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->window = window;
+}
+WhirlReset::~WhirlReset()
+{
+}
+int WhirlReset::handle_event()
+{
+ plugin->config.reset();
+ window->update();
+ plugin->send_configure_change();
+ return 1;
+}
+