static const int num_display_modes = sizeof(display_modes)/sizeof(*display_modes);
N_BodyWindow::N_BodyWindow(N_BodyMain *plugin)
- : PluginClientWindow(plugin, 240, 200, 240, 200, 0)
+ : PluginClientWindow(plugin, xS(240), yS(200), xS(240), yS(200), 0)
{
this->plugin = plugin;
press_x = press_y = 0;
void N_BodyWindow::create_objects()
{
- int x = 10, y = 10, pad = 5;
- int x1 = 100;
+ int x = xS(10), y = yS(10), pad = xS(5);
+ int x1 = xS(100);
BC_Title *title;
add_subwindow(title = new BC_Title(x,y, _("NBody"), MEDIUMFONT, YELLOW));
y += title->get_h() + 2*pad;
int N_BodyDrag::handle_event()
{
CWindowGUI *cwindow_gui = gui->plugin->server->mwindow->cwindow->gui;
- int value = get_value();
- if( value ) {
+ if( get_value() ) {
if( !gui->grab(cwindow_gui) ) {
- update(value = 0);
+ update(*value = 0);
flicker(10,50);
}
}
gui->ungrab(cwindow_gui);
return 1;
}
+int N_BodyDrag::handle_ungrab()
+{
+ CWindowGUI *cwindow_gui = gui->plugin->server->mwindow->cwindow->gui;
+ int ret = gui->ungrab(cwindow_gui);
+ if( ret ) update(*value = 0);
+ return ret;
+}
N_BodySetMode::N_BodySetMode(N_BodyWindow *gui, int x, int y, const char *text)
- : BC_PopupTextBox(gui, 0, text, x, y, 100, 160)
+ : BC_PopupTextBox(gui, 0, text, x, y, xS(100), yS(160))
{
this->gui = gui;
}
N_BodySetDemo::N_BodySetDemo(N_BodyWindow *gui, int x, int y, const char *text)
- : BC_PopupTextBox(gui, 0, text, x, y, 100, 160)
+ : BC_PopupTextBox(gui, 0, text, x, y, xS(100), yS(160))
{
this->gui = gui;
}
}
N_BodyNumBodies::N_BodyNumBodies(N_BodyWindow *gui, int x, int y, const char *text)
- : BC_PopupTextBox(gui, 0, text, x, y, 100, 160)
+ : BC_PopupTextBox(gui, 0, text, x, y, xS(100), yS(160))
{
this->gui = gui;
}