X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Ftitler%2Ftitlerwindow.C;h=f8705dfd6d8fe2763767de452ad377b2d73b8fb8;hp=644cd67d1220bd3b75570f1f882830b798a7aab2;hb=9303c74f396d12f0fb48639ff6a835824cbc5987;hpb=12d4e343f31707c899e6e4daa10c68b172433cff diff --git a/cinelerra-5.1/plugins/titler/titlerwindow.C b/cinelerra-5.1/plugins/titler/titlerwindow.C index 644cd67d..f8705dfd 100644 --- a/cinelerra-5.1/plugins/titler/titlerwindow.C +++ b/cinelerra-5.1/plugins/titler/titlerwindow.C @@ -139,6 +139,8 @@ TitleWindow::~TitleWindow() delete timecode_format; delete title_x; delete title_y; + delete title_w; + delete title_h; } void TitleWindow::create_objects() @@ -259,13 +261,13 @@ void TitleWindow::create_objects() add_tool(bold = new TitleBold(client, this, x, y + yS(50))); if( bold->get_w() > w1 ) w1 = bold->get_w(); + if( client->drag && drag->drag_activate() ) { + eprintf("drag enabled, but compositor already grabbed\n"); + client->drag = 0; + } add_tool(drag = new TitleDrag(client, this, x, y + yS(80))); drag->create_objects(); if( drag->get_w() > w1 ) w1 = drag->get_w(); - if( client->config.drag ) { - if( drag->drag_activate() ) - eprintf("drag enabled, but compositor already grabbed\n"); - } add_tool(alias = new TitleAlias(client, this, x, y+yS(110))); if( alias->get_w() > w1 ) w1 = drag->get_w(); @@ -572,6 +574,10 @@ void TitleWindow::update_gui() title_y->update((int64_t)client->config.title_y); title_w->update((int64_t)client->config.title_w); title_h->update((int64_t)client->config.title_h); + drag->drag_x = client->config.title_x; + drag->drag_y = client->config.title_y; + drag->drag_w = client->config.title_w; + drag->drag_h = client->config.title_h; italic->update(client->config.style & BC_FONT_ITALIC); bold->update(client->config.style & BC_FONT_BOLD); alias->update(client->config.style & FONT_ALIAS); @@ -1228,7 +1234,7 @@ int TitleBottom::handle_event() } TitleDrag::TitleDrag(TitleMain *client, TitleWindow *window, int x, int y) - : DragCheckBox(client->server->mwindow, x, y, _("Drag"), &client->config.drag, + : DragCheckBox(client->server->mwindow, x, y, _("Drag"), &client->drag, client->config.title_x, client->config.title_y, client->config.title_w, client->config.title_h) { @@ -1250,7 +1256,7 @@ int64_t TitleDrag::get_drag_position() void TitleDrag::update_gui() { - client->config.drag = get_value(); + client->drag = get_value(); client->config.title_x = drag_x; client->config.title_y = drag_y; client->config.title_w = drag_w+0.5; @@ -1265,6 +1271,7 @@ void TitleDrag::update_gui() int TitleDrag::handle_event() { int ret = DragCheckBox::handle_event(); + client->drag = get_value(); window->send_configure_change(); return ret; } @@ -1549,7 +1556,7 @@ void TitlePngPopup::handle_done_event(int result) if( result ) return; BrowseButtonWindow *gui = (BrowseButtonWindow *)get_gui(); const char *path = gui->get_submitted_path(); - char txt[BCSTRLEN]; sprintf(txt, "<%s %s>", _(KW_PNG), path); + char txt[BCTEXTLEN]; sprintf(txt, "<%s %s>", _(KW_PNG), path); window->lock_window("TitlePngPopup::handle_done_event"); window->insert_ibeam(txt); window->unlock_window();