X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fnbodycuda%2Fnbodywindow.C;h=12c1fd9f06a3604ebd4d2d29ff9a81618bfd3438;hb=6bc0a304ee802c8d05bf9faadd17229696fec5d3;hp=c5c7766e442eb0b37527cd528088811c3d76be6a;hpb=b1649fe7b38cfb4bbec58b19fb8dda2daa0ce520;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/nbodycuda/nbodywindow.C b/cinelerra-5.1/plugins/nbodycuda/nbodywindow.C index c5c7766e..12c1fd9f 100644 --- a/cinelerra-5.1/plugins/nbodycuda/nbodywindow.C +++ b/cinelerra-5.1/plugins/nbodycuda/nbodywindow.C @@ -38,7 +38,7 @@ static const char *display_modes[] = { 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; @@ -52,8 +52,8 @@ N_BodyWindow::~N_BodyWindow() 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; @@ -179,10 +179,9 @@ N_BodyDrag::N_BodyDrag(N_BodyWindow *gui, int x, int y) 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); } } @@ -190,9 +189,16 @@ int N_BodyDrag::handle_event() 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; } @@ -215,7 +221,7 @@ int N_BodySetMode::handle_event() 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; } @@ -240,7 +246,7 @@ int N_BodySetDemo::handle_event() } 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; }