#include "pluginserver.h"
#include "theme.h"
#include "track.h"
+#include "tracks.h"
#include "titlerwindow.h"
#include "bcfontentry.h"
TitleWindow::TitleWindow(TitleMain *client)
: PluginClientWindow(client,
- client->config.window_w, client->config.window_h, 100, 100, 1)
+ client->config.window_w, client->config.window_h,
+ xS(100), yS(100), 1)
{
//printf("TitleWindow::TitleWindow %d %d %d\n", __LINE__, client->config.window_w, client->config.window_h);
this->client = client;
drag = 0;
cur_popup = 0;
fonts_popup = 0;
+ png_popup = 0;
- color_x = color_y = 0;
- outline_color_x = outline_color_y = 0;
drag_dx = drag_dy = dragging = 0;
cur_ibeam = -1;
encoding_title = 0;
encoding = 0;
color_button = 0;
- color_thread = 0;
- outline_color_button = 0;
- outline_color_thread = 0;
+ outline_button = 0;
+ color_popup = 0;
motion_title = 0;
motion = 0;
line_pitch = 0;
void TitleWindow::done_event(int result)
{
+ color_button->close_picker();
+ outline_button->close_picker();
drag->drag_deactivate();
- color_thread->close_window();
- outline_color_thread->close_window();
- color_popup->close_window();
- png_popup->close_window();
+ delete color_popup; color_popup = 0;
+ delete png_popup; png_popup = 0;
+
}
TitleWindow::~TitleWindow()
sizes.remove_all_objects();
delete timecode_format;
- delete color_thread;
delete title_x;
delete title_y;
}
void TitleWindow::create_objects()
{
- int x = 10, y = 10;
+ int x = xS(10), y = yS(10);
int margin = client->get_theme()->widget_border;
char string[BCTEXTLEN];
-#define COLOR_W 50
-#define COLOR_H 30
+#define COLOR_W xS(50)
+#define COLOR_H yS(30)
client->build_previews(this);
sizes.append(new BC_ListBoxItem("8"));
add_subwindow(font_tumbler = new TitleFontTumble(client, this, x, y+margin));
x += font_tumbler->get_w() + margin;
- int x1 = x, y1 = y;
+ int x1 = x+xS(20), y1 = y;
add_tool(size_title = new BC_Title(x1, y1+margin, _("Size:")));
sprintf(string, "%.2f", client->config.size);
x1 += size_title->get_w() + margin;
int x2 = x1 + size->get_w(), y2 = y1 + size->get_h() + margin;
add_subwindow(size_tumbler = new TitleSizeTumble(client, this, x2, y1+margin));
- add_tool(pitch_title = new BC_Title(x-5, y2+margin, _("Pitch:")));
+ add_tool(pitch_title = new BC_Title(x-xS(16), y2+margin, _("Line Pitch:")));
pitch = new TitlePitch(client, this, x1, y2+margin, &client->config.line_pitch);
pitch->create_objects();
- int x3 = x2 + size_tumbler->get_w() + 50;
+ int x3 = x2 + size_tumbler->get_w() + xS(50);
int y3 = pitch->get_y() + pitch->get_h();
add_tool(style_title = new BC_Title(x=x3, y, _("Style:")));
- add_tool(italic = new TitleItalic(client, this, x, y + 20));
+ add_tool(italic = new TitleItalic(client, this, x, y + yS(20)));
int w1 = italic->get_w();
- add_tool(bold = new TitleBold(client, this, x, y + 50));
+ add_tool(bold = new TitleBold(client, this, x, y + yS(50)));
if( bold->get_w() > w1 ) w1 = bold->get_w();
- add_tool(drag = new TitleDrag(client, this, x, y + 80));
+ 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 ) {
eprintf("drag enabled, but compositor already grabbed\n");
}
- add_tool(alias = new TitleAlias(client, this, x, y+110));
+ add_tool(alias = new TitleAlias(client, this, x, y+yS(110)));
if( alias->get_w() > w1 ) w1 = drag->get_w();
x += w1 + margin;
- add_tool(justify_title = new BC_Title(x+50, y, _("Justify:")));
- add_tool(left = new TitleLeft(client, this, x, y + 20));
+ add_tool(justify_title = new BC_Title(x+xS(50), y, _("Justify:")));
+ add_tool(left = new TitleLeft(client, this, x, y + yS(20)));
w1 = left->get_w();
- add_tool(center = new TitleCenter(client, this, x, y + 50));
+ add_tool(center = new TitleCenter(client, this, x, y + yS(50)));
if( center->get_w() > w1 ) w1 = center->get_w();
- add_tool(right = new TitleRight(client, this, x, y + 80));
+ add_tool(right = new TitleRight(client, this, x, y + yS(80)));
if( right->get_w() > w1 ) w1 = right->get_w();
x += w1 + margin;
- add_tool(top = new TitleTop(client, this, x, y + 20));
- add_tool(mid = new TitleMid(client, this, x, y + 50));
- add_tool(bottom= new TitleBottom(client, this, x, y + 80));
+ add_tool(top = new TitleTop(client, this, x, y + yS(20)));
+ add_tool(mid = new TitleMid(client, this, x, y + yS(50)));
+ add_tool(bottom= new TitleBottom(client, this, x, y + yS(80)));
x = margin;
- y = y3+10;
+ y = y3+yS(10);
w1 = BC_Title::calculate_w(this, _("X:"));
if( (x1 = BC_Title::calculate_w(this, _("Y:"))) > w1 ) w1 = x1;
title_h->create_objects();
x1 += title_h->get_w();
- x = x1+2*margin;
+ x = x1+xS(2)*margin;
add_tool(motion_title = new BC_Title(x1=x, y, _("Motion:")));
x1 += motion_title->get_w()+margin;
motion = new TitleMotion(client, this, x1, y);
motion->create_objects();
add_tool(loop = new TitleLoop(client, this, x, y1));
- x = margin; y = y1 + loop->get_h()+20;
+ x = margin; y = y1 + loop->get_h()+yS(20);
add_tool(dropshadow_title = new BC_Title(x, y, _("Drop shadow:")));
w1 = dropshadow_title->get_w();
- dropshadow = new TitleDropShadow(client, this, x, y + 20);
+ dropshadow = new TitleDropShadow(client, this, x, y + yS(20));
dropshadow->create_objects();
if( dropshadow->get_w() > w1 ) w1 = dropshadow->get_w();
x += w1 + margin;
add_tool(fadein_title = new BC_Title(x, y, _("Fade in (sec):")));
w1 = fadein_title->get_w();
- add_tool(fade_in = new TitleFade(client, this, &client->config.fade_in, x, y + 20));
+ add_tool(fade_in = new TitleFade(client, this, &client->config.fade_in, x, y + yS(20)));
if( fade_in->get_w() > w1 ) w1 = fade_in->get_w();
x += w1 + margin;
add_tool(fadeout_title = new BC_Title(x, y, _("Fade out (sec):")));
w1 = fadeout_title->get_w();
- add_tool(fade_out = new TitleFade(client, this, &client->config.fade_out, x, y + 20));
+ add_tool(fade_out = new TitleFade(client, this, &client->config.fade_out, x, y + yS(20)));
if( fade_out->get_w() > w1 ) w1 = fade_out->get_w();
x += w1 + margin;
add_tool(speed_title = new BC_Title(x, y, _("Speed:")));
w1 = speed_title->get_w();
- y += speed_title->get_h() + 5; y1 = y;
+ y += speed_title->get_h() + yS(5); y1 = y;
speed = new TitleSpeed(client, this, x, y);
speed->create_objects();
if( speed->get_w() > w1 ) w1 = speed->get_w();
x += w1 + margin;
- y2 = y + speed->get_h() + 10;
+ y2 = y + speed->get_h() + yS(10);
- color_x = x3; color_y = y = y1;
- color_thread = new TitleColorThread(client, this, 0);
- x1 = color_x + COLOR_W + 2*margin;
- y1 = color_y + 5;
+ add_tool(color_button_title = new BC_Title(x3, y1+yS(10), _("Color:")));
+ x1 = x3 + color_button_title->get_w() + xS(30);
add_tool(color_button = new TitleColorButton(client, this, x1, y1));
- y += COLOR_H + 5;
- outline_color_x = x3; outline_color_y = y;
- outline_color_thread = new TitleColorThread(client, this, 1);
- y1 = outline_color_y + 5;
- add_tool(outline_color_button = new TitleOutlineColorButton(client, this, x1, y1));
+ y1 += color_button->get_h() + yS(10);
+ add_tool(outline_button_title = new BC_Title(x3, y1+yS(10), _("Outline:")));
+ add_tool(outline_button = new TitleOutlineColorButton(client, this, x1, y1));
- x = 10; y = y2;
+ x = yS(10); y = y2;
add_tool(outline_title = new BC_Title(x, y, _("Outline:")));
y1 = y + outline_title->get_h() + margin;
outline = new TitleOutline(client, this, x, y1);
outline->create_objects();
- x += outline->get_w() + 2*margin;
+ x += outline->get_w() + xS(2)*margin;
#ifdef USE_STROKER
add_tool(stroker_title = new BC_Title(x, y, _("Stroker:")));
stroker = new TitleStroker(client, this, x, y1);
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;
- x = 10;
+ x = xS(10);
add_tool(background = new TitleBackground(client, this, x, y));
x += background->get_w() + margin;
add_tool(background_path = new TitleBackgroundPath(client, this, x, y));
add_tool(background_browse = new BrowseButton(
client->server->mwindow->theme, this, background_path,
x, y, "", _("background media"), _("Select background media path")));
- x += background_browse->get_w() + 3*margin;
+ x += background_browse->get_w() + xS(3)*margin;
add_tool(loop_playback = new TitleLoopPlayback(client, this, x, y));
- y += loop_playback->get_h() + 10;
+ y += loop_playback->get_h() + yS(10);
- x = 10;
+ x = xS(10);
add_tool(text_title = new BC_Title(x, y, _("Text:")));
- x += text_title->get_w() + 20;
- int wid = BC_Title::calculate_w(this,"0")*10;
+ x += text_title->get_w() + xS(20);
+ int wid = BC_Title::calculate_w(this,"0")*xS(10);
add_tool(text_chars = new TitleTextChars(x,y,wid));
y += text_title->get_h() + margin;
x = margin;
- text = new TitleText(client, this, x, y, get_w()-margin - x, get_h() - y - 10);
+ text = new TitleText(client, this, x, y, get_w()-margin - x, get_h() - y - yS(10));
text->create_objects();
add_tool(cur_popup = new TitleCurPopup(client, this));
png_popup = new TitlePngPopup(client, this);
show_window(1);
- update();
+ update_gui();
}
int TitleWindow::resize_event(int w, int h)
pitch_title->reposition_window(pitch_title->get_x(), pitch_title->get_y());
pitch->reposition_window(pitch->get_x(), pitch->get_y());
+ color_button_title->reposition_window(color_button_title->get_x(), color_button_title->get_y());
color_button->reposition_window(color_button->get_x(), color_button->get_y());
- outline_color_button->reposition_window(outline_color_button->get_x(), outline_color_button->get_y());
+ outline_button_title->reposition_window(outline_button_title->get_x(), outline_button_title->get_y());
+ outline_button->reposition_window(outline_button->get_x(), outline_button->get_y());
motion_title->reposition_window(motion_title->get_x(), motion_title->get_y());
motion->reposition_window(motion->get_x(), motion->get_y());
loop->reposition_window(loop->get_x(), loop->get_y());
fade_out->reposition_window(fade_out->get_x(), fade_out->get_y());
text_title->reposition_window(text_title->get_x(), text_title->get_y());
timecode->reposition_window(timecode->get_x(), timecode->get_y());
- text->reposition_window(text->get_x(), text->get_y(), w - text->get_x() - 10,
- BC_TextBox::pixels_to_rows(this, MEDIUMFONT, h - text->get_y() - 10));
+ text->reposition_window(text->get_x(), text->get_y(), w - text->get_x() - xS(10),
+ BC_TextBox::pixels_to_rows(this, MEDIUMFONT, h - text->get_y() - yS(10)));
justify_title->reposition_window(justify_title->get_x(), justify_title->get_y());
left->reposition_window(left->get_x(), left->get_y());
center->reposition_window(center->get_x(), center->get_y());
void TitleWindow::previous_font()
{
int current_font = font->get_number();
- current_font--;
- if( current_font < 0 ) current_font = fonts.total - 1;
+ if( !fonts.total ) current_font = -1;
+ else if( --current_font < 0 ) current_font = fonts.total - 1;
+ font->set_number(current_font);
if( current_font < 0 || current_font >= fonts.total ) return;
void TitleWindow::next_font()
{
int current_font = font->get_number();
- current_font++;
- if( current_font >= fonts.total ) current_font = 0;
+ if( !fonts.total ) current_font = -1;
+ else if( ++current_font >= fonts.total ) current_font = 0;
+ font->set_number(current_font);
if( current_font < 0 || current_font >= fonts.total ) return;
{
int ibeam = cur_ibeam;
int ilen = strlen(txt)+1;
- wchar_t wtxt[ilen];
+ wchr_t wtxt[ilen];
int len = BC_Resources::encode(client->config.encoding, BC_Resources::wide_encoding,
- (char*)txt,ilen, (char *)wtxt,ilen*sizeof(wtxt[0])) / sizeof(wchar_t);
+ (char*)txt,ilen, (char *)wtxt,ilen*sizeof(wtxt[0])) / sizeof(wchr_t);
client->insert_text(wtxt, ibeam);
while( len > 0 && !wtxt[len] ) --len;
int adv = len+1 + ofs;
void TitleWindow::update_color()
{
-//printf("TitleWindow::update_color %x\n", client->config.color);
- set_color(client->config.color);
- draw_box(color_x, color_y, COLOR_W, COLOR_H);
- flash(color_x, color_y, COLOR_W, COLOR_H);
- set_color(client->config.outline_color);
- draw_box(outline_color_x, outline_color_y, COLOR_W, COLOR_H);
- set_color(BLACK);
- draw_rectangle(color_x, color_y, COLOR_W, COLOR_H);
- draw_rectangle(outline_color_x, outline_color_y, COLOR_W, COLOR_H);
- flash(outline_color_x, outline_color_y, COLOR_W, COLOR_H);
+ color_button->update_gui(client->config.color);
+ outline_button->update_gui(client->config.outline_color);
}
void TitleWindow::update_justification()
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);
fade_out->update((float)client->config.fade_out);
font->update(client->config.font);
check_style(client->config.font,0);
- text->update(client->config.wtext ? &client->config.wtext[0] : L"");
+ wchr_t wz[1] = { 0 };
+ text->update(client->config.wtext ? &client->config.wtext[0] : wz);
speed->update(client->config.pixels_per_second);
outline->update((int64_t)client->config.outline_size);
#ifdef USE_STROKER
TitleSize::TitleSize(TitleMain *client, TitleWindow *window, int x, int y, char *text)
- : BC_PopupTextBox(window, &window->sizes, text, x, y, 64, 300)
+ : BC_PopupTextBox(window, &window->sizes, text, x, y, xS(64), yS(300))
{
this->client = client;
this->window = window;
TitlePitch::
TitlePitch(TitleMain *client, TitleWindow *window, int x, int y, int *value)
- : BC_TumbleTextBox(window, *value, 0, INT_MAX, x, y, 64)
+ : BC_TumbleTextBox(window, *value, 0, INT_MAX, x, y, xS(64))
{
this->client = client;
this->window = window;
}
TitleColorButton::TitleColorButton(TitleMain *client, TitleWindow *window, int x, int y)
- : BC_GenericButton(x, y, _("Text Color..."))
+ : ColorCircleButton(_("Text Color"), x, y, COLOR_W, COLOR_H,
+ client->config.color, client->config.alpha, 1)
{
this->client = client;
this->window = window;
}
-int TitleColorButton::handle_event()
+int TitleColorButton::handle_new_color(int output, int alpha)
{
- window->color_thread->start_window(client->config.color,
- client->config.alpha);
+ client->config.color = output;
+ client->config.alpha = alpha;
+ window->send_configure_change();
return 1;
}
+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();
+ }
+}
+
TitleOutlineColorButton::TitleOutlineColorButton(TitleMain *client, TitleWindow *window, int x, int y)
- : BC_GenericButton(x, y, _("Outline color..."))
+ : ColorCircleButton(_("Outline Color"), x, y, COLOR_W, COLOR_H,
+ client->config.outline_color, client->config.outline_alpha, 1)
{
this->client = client;
this->window = window;
}
-int TitleOutlineColorButton::handle_event()
+int TitleOutlineColorButton::handle_new_color(int output, int alpha)
{
- window->outline_color_thread->start_window(client->config.outline_color,
- client->config.outline_alpha);
+ client->config.outline_color = output;
+ client->config.outline_alpha = alpha;
+ window->send_configure_change();
return 1;
}
+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();
+ }
+}
TitleMotion::TitleMotion(TitleMain *client, TitleWindow *window, int x, int y)
: BC_PopupTextBox(window, &window->paths,
client->motion_to_text(client->config.motion_strategy),
- x, y, 120, 100)
+ x, y, xS(120), yS(100))
{
this->client = client;
this->window = 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)+xS(10), text, 1)
{
this->client = client;
this->window = window;
TitleFade::TitleFade(TitleMain *client, TitleWindow *window,
double *value, int x, int y)
- : BC_TextBox(x, y, 80, 1, (float)*value)
+ : BC_TextBox(x, y, xS(80), 1, (float)*value)
{
this->client = client;
this->window = window;
int style = stroker && atof(stroker->get_text()) ? BC_FONT_OUTLINE : 0;
if( bold->get_value() ) style |= BC_FONT_BOLD;
if( italic->get_value() ) style |= BC_FONT_ITALIC;
+ if( alias->get_value() ) style |= FONT_ALIAS;
client->config.style = style;
}
}
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, xS(340), yS(300), LISTBOX_ICON_LIST)
{
this->client = client;
this->window = window;
int TitleText::handle_event()
{
window->fonts_popup->deactivate();
- const wchar_t *wtext = get_wtext();
- long wlen = wcslen(wtext);
+ const wchr_t *wtext = get_wtext();
+ long wlen = wstrlen(wtext);
client->config.demand(wlen);
- wcsncpy(client->config.wtext, wtext, client->config.wsize);
+ wstrncpy(client->config.wtext, wtext, client->config.wsize);
client->config.wlen = wlen;
window->update_stats();
window->send_configure_change();
TitleDropShadow::TitleDropShadow(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.dropshadow,
- -1000, 1000, x, y, 70)
+ -1000, 1000, x, y, xS(70))
{
this->client = client;
this->window = window;
TitleOutline::TitleOutline(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.outline_size,
- 0.f, 1000.f, x, y, 70)
+ 0.f, 1000.f, x, y, xS(70))
{
this->client = client;
this->window = window;
TitleStroker::TitleStroker(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.stroke_width,
- 0.f, 1000.f, x, y, 70)
+ 0.f, 1000.f, x, y, xS(70))
{
this->client = client;
this->window = window;
TitleX::TitleX(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.title_x,
- -32767.f, 32767.f, x, y, 50)
+ -32767.f, 32767.f, x, y, xS(50))
{
this->client = client;
this->window = window;
TitleY::TitleY(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.title_y,
- -32767.f, 32767.f, x, y, 50)
+ -32767.f, 32767.f, x, y, xS(50))
{
this->client = client;
this->window = window;
TitleW::TitleW(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.title_w,
- 0, 32767, x, y, 50)
+ 0, 32767, x, y, xS(50))
{
this->client = client;
this->window = window;
TitleH::TitleH(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.title_h,
- 0, 32767, x, y, 50)
+ 0, 32767, x, y, xS(50))
{
this->client = client;
this->window = window;
TitleSpeed::TitleSpeed(TitleMain *client, TitleWindow *window, int x, int y)
: BC_TumbleTextBox(window, client->config.pixels_per_second,
- 0.f, 1000.f, x, y, 100)
+ 0.f, 1000.f, x, y, xS(100))
{
this->client = client;
this->window = window;
return 1;
}
-
-
-TitleColorThread::TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline)
- : ColorPicker(1, is_outline? _("Outline Color") : _("Text Color"))
-{
- this->client = client;
- this->window = window;
- this->is_outline = is_outline;
-}
-
-int TitleColorThread::handle_new_color(int output, int alpha)
-{
- if( is_outline ) {
- client->config.outline_color = output;
- client->config.outline_alpha = alpha;
- }
- else {
- client->config.color = output;
- client->config.alpha = alpha;
- }
-
- window->lock_window("TitleColorThread::handle_new_color");
- window->update_color();
- window->flush();
- window->unlock_window();
-
- window->send_configure_change();
- return 1;
-}
-
TitleDrag::TitleDrag(TitleMain *client, TitleWindow *window, int x, int y)
: DragCheckBox(client->server->mwindow, x, y, _("Drag"), &client->config.drag,
client->config.title_x, client->config.title_y,
Track *TitleDrag::get_drag_track()
{
- return client->server->plugin->track;
+ PluginServer *server = client->server;
+ int plugin_id = server->plugin_id;
+ Plugin *plugin = server->edl->tracks->plugin_exists(plugin_id);
+ return !plugin ? 0 : plugin->track;
}
int64_t TitleDrag::get_drag_position()
{
}
TitleBackgroundPath::TitleBackgroundPath(TitleMain *client, TitleWindow *window, int x, int y)
- : BC_TextBox(x, y, 240, 1, client->config.background_path)
+ : BC_TextBox(x, y, xS(240), 1, client->config.background_path)
{
this->client = client;
this->window = window;
case POPUP_FONT: {
int px, py;
window->get_pop_cursor(px ,py);
- window->fonts_popup->activate(px, py, 300,200);
+ window->fonts_popup->activate(px, py, xS(300),yS(200));
return 1; }
case POPUP_COLOR: {
window->color_popup->activate();
}
void TitleColorPopup::handle_done_event(int result)
{
- if( result ) return;
- char txt[BCSTRLEN]; sprintf(txt, "<%s #%06x>", _(KW_COLOR), color_value);
- window->insert_ibeam(txt);
+ 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();
+ }
}
TitlePngPopup::TitlePngPopup(TitleMain *client, TitleWindow *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()
int x, y; mwindow->gui->get_abs_cursor(x, y);
BC_Window *gui = new BrowseButtonWindow(mwindow->theme,
- x-25, y-100, window, "", _("Png file"), _("Png path"), 0);
+ x-xS(25), y-yS(100), window, "", _("Png file"), _("Png path"), 0);
gui->create_objects();
return gui;
}