void NudgePatch::set_value(int64_t value)
{
- mwindow->undo->update_undo_before(_("nudge"), this);
+ mwindow->undo->update_undo_before(_("nudge."), this);
patch->track->nudge = value;
if(patch->track->gang && patch->track->record)
patch->patchbay->synchronize_nudge(patch->track->nudge, patch->track);
- mwindow->undo->update_undo_after(_("nudge"), LOAD_PATCHES);
+ mwindow->undo->update_undo_after(_("nudge."), LOAD_PATCHES);
mwindow->gui->unlock_window();
if(patch->track->data_type == TRACK_VIDEO)
result = submenu->dispatch_button_press();
}
- if(!result && top_level->event_win == menu_popup->get_popup()->win)
+ if(!result && menu_popup->get_popup()->is_event_win())
{
if(top_level->cursor_x >= 0 && top_level->cursor_x < menu_popup->get_w() &&
top_level->cursor_y >= y && top_level->cursor_y < y + h)
int BC_MenuItem::dispatch_button_release(int &redraw)
{
int result = 0;
- int cursor_x, cursor_y;
- Window tempwin;
if(!strcmp(text, "-")) return 0;
result = submenu->dispatch_button_release();
}
- if(!result)
- {
- XTranslateCoordinates(top_level->display,
- top_level->event_win,
- menu_popup->get_popup()->win,
- top_level->cursor_x,
- top_level->cursor_y,
- &cursor_x,
- &cursor_y,
- &tempwin);
-
- if(cursor_x >= 0 && cursor_x < menu_popup->get_w() &&
- cursor_y >= y && cursor_y < y + h)
- {
+ if( !result && menu_popup->cursor_inside() ) {
+ int cursor_x, cursor_y;
+ menu_popup->get_popup()->get_relative_cursor_xy(cursor_x, cursor_y);
+ if( cursor_x >= 0 && cursor_x < menu_popup->get_w() &&
+ cursor_y >= y && cursor_y < y + h ) {
if(menu_bar)
menu_bar->deactivate();
else
int BC_MenuItem::dispatch_motion_event(int &redraw)
{
int result = 0;
- int cursor_x, cursor_y;
if(submenu)
{
result = submenu->dispatch_motion_event();
}
- top_level->translate_coordinates(top_level->event_win,
- menu_popup->get_popup()->win,
- top_level->cursor_x,
- top_level->cursor_y,
- &cursor_x,
- &cursor_y);
-
- if(cursor_x >= 0 && cursor_x < menu_popup->get_w() &&
- cursor_y >= y && cursor_y < y + h)
- {
+ if( !result && menu_popup->cursor_inside() ) {
+ int cursor_x, cursor_y;
+ menu_popup->get_popup()->get_relative_cursor_xy(cursor_x, cursor_y);
+ if( cursor_x >= 0 && cursor_x < menu_popup->get_w() &&
+ cursor_y >= y && cursor_y < y + h) {
// Highlight the item
- if(!highlighted)
- {
+ if(!highlighted)
+ {
// Deactivate submenus in the parent menu excluding this one.
- menu_popup->deactivate_submenus(submenu);
- highlighted = 1;
- if(submenu) activate_submenu();
+ menu_popup->deactivate_submenus(submenu);
+ highlighted = 1;
+ if(submenu) activate_submenu();
+ redraw = 1;
+ }
+ result = 1;
+ }
+ else
+ if(highlighted)
+ {
+ highlighted = 0;
+ result = 1;
redraw = 1;
}
- result = 1;
- }
- else
- if(highlighted)
- {
- highlighted = 0;
- result = 1;
- redraw = 1;
}
return result;
}
result = submenu->dispatch_cursor_leave();
}
- if(!result && highlighted && top_level->event_win == menu_popup->get_popup()->win)
+ if(!result && highlighted && menu_popup->get_popup()->is_event_win())
{
highlighted = 0;
return 1;
BC_PopupMenu::~BC_PopupMenu()
{
- if(menu_popup) delete menu_popup;
+ use_title = 0;
+ deactivate();
for(int i = 0; i < TOTAL_IMAGES; i++)
{
if(images[i]) delete images[i];
int result = 0;
// This menu is down.
- if(popup_down)
- {
+ if(popup_down) {
result = menu_popup->dispatch_motion_event();
}
- if(!result && use_title && top_level->event_win == win)
- {
- if(highlighted)
- {
- if(!cursor_inside())
- {
+ if(!result && use_title && is_event_win()) {
+ if(highlighted) {
+ if(!cursor_inside()) {
highlighted = 0;
draw_title(1);
}
}
- else
- {
- if(cursor_inside())
- {
+ else {
+ if(cursor_inside()) {
highlighted = 1;
draw_title(1);
result = 1;
draw_border();
flash(1);
}
- if( !suggestions_popup && !get_buttonpress() &&
+ if( !suggestions_popup && !get_button_down() &&
!(top_level->get_resources()->textbox_focus_policy & CLICK_DEACTIVATE) )
deactivate();
return 0;
{
// stop event input
XSelectInput(top_level->display, this->win, 0);
- motion_events = resize_events = translation_events = 0;
+ XSync(top_level->display,0);
#ifndef SINGLE_THREAD
top_level->dequeue_events(win);
#endif
+// drop active window refs to this
if(top_level->active_grab == this) top_level->active_grab = 0;
if(top_level->active_menubar == this) top_level->active_menubar = 0;
if(top_level->active_popup_menu == this) top_level->active_popup_menu = 0;
if(top_level->active_subwindow == this) top_level->active_subwindow = 0;
+// drop motion window refs to this
+ if(top_level->motion_events && top_level->last_motion_win == this->win)
+ top_level->motion_events = 0;
+
// Remove pointer from parent window to this
parent_window->subwindows->remove(this);
}
#endif
}
-int BC_WindowBase::get_relative_cursor_x()
+void BC_WindowBase::get_relative_cursor_xy(int &x, int &y, int lock_window)
{
- int abs_x, abs_y, x, y, win_x, win_y;
+ int abs_x, abs_y, win_x, win_y;
unsigned int temp_mask;
Window temp_win;
+ if(lock_window) this->lock_window("BC_WindowBase::get_relative_cursor_xy");
XQueryPointer(top_level->display, top_level->win,
&temp_win, &temp_win, &abs_x, &abs_y, &win_x, &win_y,
&temp_mask);
XTranslateCoordinates(top_level->display, top_level->rootwin,
win, abs_x, abs_y, &x, &y, &temp_win);
-
+ if(lock_window) this->unlock_window();
+}
+int BC_WindowBase::get_relative_cursor_x(int lock_window)
+{
+ int x, y;
+ get_relative_cursor_xy(x, y, lock_window);
return x;
}
-
-int BC_WindowBase::get_relative_cursor_y()
+int BC_WindowBase::get_relative_cursor_y(int lock_window)
{
- int abs_x, abs_y, x, y, win_x, win_y;
- unsigned int temp_mask;
- Window temp_win;
-
- XQueryPointer(top_level->display, top_level->win,
- &temp_win, &temp_win, &abs_x, &abs_y, &win_x, &win_y,
- &temp_mask);
-
- XTranslateCoordinates(top_level->display,
- top_level->rootwin, win, abs_x, abs_y, &x, &y, &temp_win);
-
+ int x, y;
+ get_relative_cursor_xy(x, y, lock_window);
return y;
}
-int BC_WindowBase::get_abs_cursor_x(int lock_window)
+void BC_WindowBase::get_abs_cursor_xy(int &abs_x, int &abs_y, int lock_window)
{
- int abs_x, abs_y, win_x, win_y;
+ int win_x, win_y;
unsigned int temp_mask;
Window temp_win;
- if(lock_window) this->lock_window("BC_WindowBase::get_abs_cursor_x");
+ if(lock_window) this->lock_window("BC_WindowBase::get_abs_cursor_xy");
XQueryPointer(top_level->display, top_level->win,
&temp_win, &temp_win, &abs_x, &abs_y, &win_x, &win_y,
&temp_mask);
if(lock_window) this->unlock_window();
+}
+int BC_WindowBase::get_abs_cursor_x(int lock_window)
+{
+ int abs_x, abs_y;
+ get_abs_cursor_xy(abs_x, abs_y, lock_window);
return abs_x;
}
-
int BC_WindowBase::get_abs_cursor_y(int lock_window)
{
- int abs_x, abs_y, win_x, win_y;
- unsigned int temp_mask;
- Window temp_win;
-
- if(lock_window) this->lock_window("BC_WindowBase::get_abs_cursor_y");
- XQueryPointer(top_level->display, top_level->win,
- &temp_win, &temp_win, &abs_x, &abs_y, &win_x, &win_y,
- &temp_mask);
- if(lock_window) this->unlock_window();
+ int abs_x, abs_y;
+ get_abs_cursor_xy(abs_x, abs_y, lock_window);
return abs_y;
}
-int BC_WindowBase::get_pop_cursor_x(int lock_window)
+void BC_WindowBase::get_pop_cursor_xy(int &px, int &py, int lock_window)
{
int margin = 100;
- int px = get_abs_cursor_x(lock_window);
+ get_abs_cursor_xy(px, py, lock_window);
if( px < margin ) px = margin;
+ if( py < margin ) py = margin;
int wd = get_screen_w(lock_window,-1) - margin;
if( px > wd ) px = wd;
+ int ht = get_screen_h(lock_window,-1) - margin;
+ if( py > ht ) py = ht;
+}
+int BC_WindowBase::get_pop_cursor_x(int lock_window)
+{
+ int px, py;
+ get_pop_cursor_xy(px, py, lock_window);
return px;
}
-
int BC_WindowBase::get_pop_cursor_y(int lock_window)
{
- int margin = 100;
- int py = get_abs_cursor_y(lock_window);
- if( py < margin ) py = margin;
- int ht = get_screen_h(lock_window,-1) - margin;
- if( py > ht ) py = ht;
+ int px, py;
+ get_pop_cursor_xy(px, py, lock_window);
return py;
}
int BC_WindowBase::cursor_above()
{
- int rx = get_relative_cursor_x();
- if( rx < 0 || rx >= get_w() ) return 0;
- int ry = get_relative_cursor_y();
- if( ry < 0 || ry >= get_h() ) return 0;
- return 1;
+ int rx, ry;
+ get_relative_cursor_xy(rx, ry);
+ return rx < 0 || rx >= get_w() ||
+ ry < 0 || ry >= get_h() ? 0 : 1;
}
int BC_WindowBase::get_drag_x()
int get_screen_x(int lock_display, int screen);
int get_screen_y(int lock_display, int screen);
// Get current position
- int get_abs_cursor_x(int lock_window);
- int get_abs_cursor_y(int lock_window);
- int get_pop_cursor_x(int lock_window);
- int get_pop_cursor_y(int lock_window);
- int get_relative_cursor_x();
- int get_relative_cursor_y();
+ void get_abs_cursor_xy(int &abs_x, int &abs_y, int lock_window=0);
+ int get_abs_cursor_x(int lock_window=0);
+ int get_abs_cursor_y(int lock_window=0);
+ void get_pop_cursor_xy(int &px, int &py, int lock_window=0);
+ int get_pop_cursor_x(int lock_window=0);
+ int get_pop_cursor_y(int lock_window=0);
+ void get_relative_cursor_xy(int &x, int &y, int lock_window=0);
+ int get_relative_cursor_x(int lock_window=0);
+ int get_relative_cursor_y(int lock_window=0);
void get_root_coordinates(int x, int y, int *abs_x, int *abs_y);
void get_win_coordinates(int abs_x, int abs_y, int *x, int *y);
// Return 1 if cursor is over an unobscured part of this window.
strcpy(background_path, "");
outline_size = 0;
- window_w = 720;
+ window_w = 800;
window_h = 460;
next_keyframe_position = 0;
prev_keyframe_position = 0;
#include "bcdisplayinfo.h"
#include "bcsignals.h"
+#include "browsebutton.h"
#include "clip.h"
#include "cstrdup.h"
#include "automation.h"
add_tool(background = new TitleBackground(client, this, x, y));
x += background->get_w() + margin;
add_tool(background_path = new TitleBackgroundPath(client, this, x, y));
- x += background_path->get_w() + 2*margin;
+ 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 += background_browse->get_w() + 3*margin;
add_tool(loop_playback = new TitleLoopPlayback(client, x, y));
y += loop_playback->get_h() + 10;
TitleCurSubMenu *sub_menu;
add_item(cur_item = new TitleCurItem(this, _("nudge")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("nudge")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("nudge dx,dy")));
sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("/nudge")));
add_item(cur_item = new TitleCurItem(this, _("color")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("color")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("color #")));
sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("/color")));
add_item(cur_item = new TitleCurItem(this, _("alpha")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("alpha")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("alpha ")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("alpha 0.")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("alpha .5")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("alpha 1.")));
sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("/alpha")));
add_item(cur_item = new TitleCurItem(this, _("font")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("font")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("font name")));
sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("/font")));
add_item(cur_item = new TitleCurItem(this, _("size")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("size")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("size +")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("size -")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("size ")));
sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("/size")));
add_item(cur_item = new TitleCurItem(this, _("bold")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("bold")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("bold 1")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("bold 0")));
sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("/bold")));
add_item(cur_item = new TitleCurItem(this, _("italic")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("italic")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("italic 1")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("italic 0")));
sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("/italic")));
add_item(cur_item = new TitleCurItem(this, _("caps")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("caps")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("caps 1")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("caps 0")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("caps -1")));
sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("/caps")));
add_item(cur_item = new TitleCurItem(this, _("ul")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("ul")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("ul 1")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("ul 0")));
sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("/ul")));
add_item(cur_item = new TitleCurItem(this, _("blink")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("blink")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("blink 1")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("blink -1")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("blink ")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("blink 0")));
sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("/blink")));
add_item(cur_item = new TitleCurItem(this, _("fixed")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("fixed")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("fixed ")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("fixed 20")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("fixed 10")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("fixed 0")));
sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("/fixed")));
add_item(cur_item = new TitleCurItem(this, _("sup")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("sup")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("sup 1")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("sup 0")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("sup -1")));
sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("/sup")));
add_item(cur_item = new TitleCurItem(this, _("png")));
cur_item->add_submenu(sub_menu = new TitleCurSubMenu(cur_item));
- sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("png")));
+ sub_menu->add_submenuitem(new TitleCurSubMenuItem(sub_menu,_("png file")));
}
TitleCurItem::TitleCurItem(TitleCurPopup *popup, const char *text)
TitleTimecodeFormat *timecode_format;
TitleBackground *background;
TitleBackgroundPath *background_path;
+ BrowseButton *background_browse;
TitleLoopPlayback *loop_playback;
// Color preview
msgstr "Смещение начала/конца дорожки"
#: cinelerra//patchgui.C:716 cinelerra//patchgui.C:722
-msgid "nudge"
-msgstr "cмещ-е нач./конца дорожки"
+msgid "nudge."
+msgstr "cмещ-е нач./конца дорожки."
#: cinelerra//performanceprefs.C:83
msgid "Cache size (MB):"