X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Ftitler%2Ftitlerwindow.C;h=21cfdea22d811bce2411196a15b84fc8806a9685;hb=8cad02a7b02e4a8543bc5514892b51aed877a193;hp=04f1ef69f3b4bad3cbc2e6bfeaad8028ea44fcb7;hpb=258d9cb69d560f40961acdd20866e12e940c2f93;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/titler/titlerwindow.C b/cinelerra-5.1/plugins/titler/titlerwindow.C index 04f1ef69..21cfdea2 100644 --- a/cinelerra-5.1/plugins/titler/titlerwindow.C +++ b/cinelerra-5.1/plugins/titler/titlerwindow.C @@ -118,6 +118,8 @@ TitleWindow::TitleWindow(TitleMain *client) void TitleWindow::done_event(int result) { + color_button->close_picker(); + outline_button->close_picker(); drag->drag_deactivate(); delete color_popup; color_popup = 0; delete png_popup; png_popup = 0; @@ -365,10 +367,16 @@ void TitleWindow::create_objects() stroker->create_objects(); x += stroker->get_w() + margin; #endif - y += outline_title->get_h() + margin; - add_tool(timecode = new TitleTimecode(client, this, x1=x, y)); - x += timecode->get_w() + margin; - add_tool(timecode_format = new TitleTimecodeFormat(client, this, x, y, + add_tool(timecode = new TitleTimecode(client, this, x, y)); + y += timecode->get_h() + margin; + int tw = 0; + for( int i=0; iconfig.timecode_format, string))); timecode_format->create_objects(); y += timecode_format->get_h() + margin; @@ -403,7 +411,7 @@ void TitleWindow::create_objects() png_popup = new TitlePngPopup(client, this); show_window(1); - update(); + update_gui(); } int TitleWindow::resize_event(int w, int h) @@ -554,7 +562,7 @@ void TitleWindow::update_stats() text_chars->update(client->config.wlen); } -void TitleWindow::update() +void TitleWindow::update_gui() { title_x->update((int64_t)client->config.title_x); title_y->update((int64_t)client->config.title_y); @@ -780,7 +788,9 @@ void TitleColorButton::handle_done_event(int result) { if( result ) { handle_new_color(orig_color, orig_alpha); + window->lock_window("TitleColorButton::handle_done_event"); update_gui(orig_color); + window->unlock_window(); } } @@ -802,7 +812,9 @@ void TitleOutlineColorButton::handle_done_event(int result) { if( result ) { handle_new_color(orig_color, orig_alpha); + window->lock_window("TitleColorButton::handle_done_event"); update_gui(orig_color); + window->unlock_window(); } } @@ -848,8 +860,8 @@ int TitleTimecode::handle_event() } TitleTimecodeFormat::TitleTimecodeFormat(TitleMain *client, TitleWindow *window, - int x, int y, const char *text) - : BC_PopupMenu(x, y, 100, text, 1) + int x, int y, int tw, const char *text) + : BC_PopupMenu(x, y, BC_PopupMenu::calculate_w(tw)+10, text, 1) { this->client = client; this->window = window; @@ -934,7 +946,7 @@ void TitleWindow::check_style(const char *font_name, int update) TitleFont::TitleFont(TitleMain *client, TitleWindow *window, int x, int y) : BC_PopupTextBox(window, &window->fonts, client->config.font, - x, y, 240, 300, LISTBOX_ICON_LIST) + x, y, 340, 300, LISTBOX_ICON_LIST) { this->client = client; this->window = window; @@ -1220,7 +1232,8 @@ TitleDrag::TitleDrag(TitleMain *client, TitleWindow *window, int x, int y) Track *TitleDrag::get_drag_track() { - return client->server->plugin->track; + return !client->server->plugin ? 0 : + client->server->plugin->track; } int64_t TitleDrag::get_drag_position() { @@ -1505,7 +1518,9 @@ void TitleColorPopup::handle_done_event(int result) { if( !result ) { char txt[BCSTRLEN]; sprintf(txt, "<%s #%06x>", _(KW_COLOR), color_value); + window->lock_window("TitleColorPopup::handle_done_event"); window->insert_ibeam(txt); + window->unlock_window(); } } @@ -1527,7 +1542,9 @@ void TitlePngPopup::handle_done_event(int result) BrowseButtonWindow *gui = (BrowseButtonWindow *)get_gui(); const char *path = gui->get_submitted_path(); char txt[BCSTRLEN]; sprintf(txt, "<%s %s>", _(KW_PNG), path); + window->lock_window("TitlePngPopup::handle_done_event"); window->insert_ibeam(txt); + window->unlock_window(); } BC_Window *TitlePngPopup::new_gui()