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;
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; i<lengthof(timeunit_formats); ++i ) {
+ char text[BCSTRLEN];
+ Units::print_time_format(timeunit_formats[i], text);
+ int w = get_text_width(MEDIUMFONT, text);
+ if( tw < w ) tw = w;
+ }
+ add_tool(timecode_format = new TitleTimecodeFormat(client, this, x, y, tw,
Units::print_time_format(client->config.timecode_format, string)));
timecode_format->create_objects();
y += timecode_format->get_h() + margin;
png_popup = new TitlePngPopup(client, this);
show_window(1);
- update();
+ update_gui();
}
int TitleWindow::resize_event(int w, int h)
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);
{
if( result ) {
handle_new_color(orig_color, orig_alpha);
+ window->lock_window("TitleColorButton::handle_done_event");
update_gui(orig_color);
+ window->unlock_window();
}
}
{
if( result ) {
handle_new_color(orig_color, orig_alpha);
+ window->lock_window("TitleColorButton::handle_done_event");
update_gui(orig_color);
+ window->unlock_window();
}
}
}
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;
TitleFont::TitleFont(TitleMain *client, TitleWindow *window, int x, int y)
: BC_PopupTextBox(window, &window->fonts, client->config.font,
- x, y, 300, 300, LISTBOX_ICON_LIST)
+ x, y, 340, 300, LISTBOX_ICON_LIST)
{
this->client = client;
this->window = window;
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()
{
{
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();
}
}
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()