X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Ftitler%2Ftitlerwindow.C;h=9e577a9a3eb79372bb20f8a9a9e53d6d01c7fa5e;hb=e55a625a562bc3ad94deb8008c7ede2bf1768daa;hp=394d82dee327bfd197be6c07aeca29d78cba6a00;hpb=624f99bd6dccb2af28fdbef8fbb3ae41c19fcbd2;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/titler/titlerwindow.C b/cinelerra-5.1/plugins/titler/titlerwindow.C index 394d82de..9e577a9a 100644 --- a/cinelerra-5.1/plugins/titler/titlerwindow.C +++ b/cinelerra-5.1/plugins/titler/titlerwindow.C @@ -20,6 +20,7 @@ */ #include "bcdisplayinfo.h" +#include "bcdialog.h" #include "bcsignals.h" #include "browsebutton.h" #include "clip.h" @@ -116,7 +117,8 @@ TitleWindow::TitleWindow(TitleMain *client) TitleWindow::~TitleWindow() { ungrab(client->server->mwindow->cwindow->gui); - delete fonts_popup; + delete color_popup; + delete png_popup; for( int i=0; iget_icon(); @@ -367,7 +369,7 @@ void TitleWindow::create_objects() x += background_path->get_w() + margin; add_tool(background_browse = new BrowseButton( client->server->mwindow->theme, this, background_path, - x, y, 0, _("background media"), _("Select background media path"))); + x, y, "", _("background media"), _("Select background media path"))); x += background_browse->get_w() + 3*margin; add_tool(loop_playback = new TitleLoopPlayback(client, x, y)); y += loop_playback->get_h() + 10; @@ -383,6 +385,7 @@ void TitleWindow::create_objects() cur_popup->create_objects(); add_tool(fonts_popup = new TitleFontsPopup(client, this)); color_popup = new TitleColorPopup(client, this); + png_popup = new TitlePngPopup(client, this); show_window(1); update(); @@ -1437,6 +1440,10 @@ int TitleCurSubMenuItem::handle_event() window->color_popup->activate(); return 1; } + if( !strcmp(item_text, _("png file")) ) { + window->png_popup->activate(); + return 1; + } char txt[BCSTRLEN]; sprintf(txt, "<%s>", item_text); int adv = strlen(txt); @@ -1493,3 +1500,42 @@ void TitleColorPopup::handle_done_event(int result) window->insert_ibeam(txt, strlen(txt)); } +TitlePngPopup::TitlePngPopup(TitleMain *client, TitleWindow *window) + : BC_DialogThread() +{ + this->client = client; + this->window = window; +} + +TitlePngPopup::~TitlePngPopup() +{ + close_window(); +} + +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, "",path); + window->insert_ibeam(txt, strlen(txt)); +} + +BC_Window *TitlePngPopup::new_gui() +{ + BC_DisplayInfo display_info; + int x = display_info.get_abs_cursor_x(); + int y = display_info.get_abs_cursor_y(); + + BC_Window *gui = new BrowseButtonWindow(client->server->mwindow->theme, + x-25, y-100, window, "", _("Png file"), _("Png path"), 0); + gui->create_objects(); + return gui; +} + +int TitlePngPopup::activate() +{ + BC_DialogThread::start(); + return 1; +} +