X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fgwindowgui.C;h=e0506c7853cec929456c5fc3905a7c98301d76b7;hp=81520f018ac0fe1e23ce3eebb2c48c2a2a86ed47;hb=refs%2Fheads%2Fmaster;hpb=258d9cb69d560f40961acdd20866e12e940c2f93 diff --git a/cinelerra-5.1/cinelerra/gwindowgui.C b/cinelerra-5.1/cinelerra/gwindowgui.C index 81520f01..e0506c78 100644 --- a/cinelerra-5.1/cinelerra/gwindowgui.C +++ b/cinelerra-5.1/cinelerra/gwindowgui.C @@ -51,6 +51,8 @@ GWindowGUI::GWindowGUI(MWindow *mwindow, int w, int h) this->mwindow = mwindow; camera_xyz = 0; projector_xyz = 0; +// *** CONTEXT_HELP *** + context_help_set_keyword("Show Overlays"); } GWindowGUI::~GWindowGUI() @@ -63,6 +65,7 @@ const char *GWindowGUI::non_auto_text[NON_AUTOMATION_TOTAL] = N_("Titles"), N_("Transitions"), N_("Plugin Keyframes"), + N_("Hard Edges") }; const char *GWindowGUI::auto_text[AUTOMATION_TOTAL] = @@ -81,6 +84,31 @@ const char *GWindowGUI::auto_text[AUTOMATION_TOTAL] = N_("Speed") }; +const char *GWindowGUI::non_auto_help[NON_AUTOMATION_TOTAL] = +{ + "Video and Audio Tracks and Navigation", + "Video and Audio Tracks and Navigation", + "Transition Plugins", + "Edit Params", + "Cut and Paste Editing" +}; + +const char *GWindowGUI::auto_help[AUTOMATION_TOTAL] = +{ + "The Patchbay", + "Camera and Projector", + "Camera and Projector", + "Camera and Projector", + "Camera and Projector", + "Camera and Projector", + "Camera and Projector", + "The Patchbay", + "The Patchbay", + "Overlays", + "Masks", + "Fade Automation Usage and Auto Gang" +}; + int GWindowGUI::auto_colors[AUTOMATION_TOTAL] = { PINK, @@ -91,9 +119,9 @@ int GWindowGUI::auto_colors[AUTOMATION_TOTAL] = LTGREEN, LTBLUE, LTPURPLE, - 0, - 0, - 0, + -1, + -1, + -1, ORANGE, }; @@ -138,6 +166,7 @@ static toggleinfo toggle_order[] = {1, AUTOMATION_MODE}, {1, AUTOMATION_PAN}, {1, AUTOMATION_MASK}, + {-1, NON_AUTOMATION_HARD_EDGES}, {0, -1}, // bar {1, AUTOMATION_CAMERA_X}, {1, AUTOMATION_CAMERA_Y}, @@ -154,21 +183,43 @@ const char *GWindowGUI::toggle_text(toggleinfo *tp) { if( tp->isauto > 0 ) return _(auto_text[tp->ref]); if( !tp->isauto ) return _(non_auto_text[tp->ref]); - return _("XYZ"); + switch( tp->ref ) { + case NONAUTOTOGGLES_CAMERA_XYZ: + case NONAUTOTOGGLES_PROJECTOR_XYZ: + return _("XYZ"); + case NON_AUTOMATION_HARD_EDGES: + return _("Hard Edges"); + } + return "()"; +} + +const char *GWindowGUI::toggle_help(toggleinfo *tp) +{ + if( tp->isauto > 0 ) return auto_help[tp->ref]; + if( !tp->isauto ) return non_auto_help[tp->ref]; + switch( tp->ref ) { + case NONAUTOTOGGLES_CAMERA_XYZ: + case NONAUTOTOGGLES_PROJECTOR_XYZ: + return "Camera and Projector"; + case NON_AUTOMATION_HARD_EDGES: + return "Cut and Paste Editing"; + } + return "Show Overlays"; } void GWindowGUI::calculate_extents(BC_WindowBase *gui, int *w, int *h) { int temp1, temp2, temp3, temp4, temp5, temp6, temp7; int current_w, current_h; - *w = 10; - *h = 10; + int ys5 = yS(5), ys10 = yS(10); + *w = xS(10); + *h = ys10; for( int i=0; i<(int)(sizeof(toggle_order)/sizeof(toggle_order[0])); ++i ) { toggleinfo *tp = &toggle_order[i]; int ref = tp->ref; if( ref < 0 ) { - *h += get_resources()->bar_data->get_h() + 5; + *h += get_resources()->bar_data->get_h() + ys5; continue; } BC_Toggle::calculate_extents(gui, @@ -178,11 +229,11 @@ void GWindowGUI::calculate_extents(BC_WindowBase *gui, int *w, int *h) toggle_text(tp), MEDIUMFONT); current_w += current_h; *w = MAX(current_w, *w); - *h += current_h + 5; + *h += current_h + ys5; } - *h += 10; - *w += 20; + *h += ys10; + *w += xS(20); } GWindowColorButton::GWindowColorButton(GWindowToggle *auto_toggle, @@ -200,7 +251,6 @@ GWindowColorButton::~GWindowColorButton() int GWindowColorButton::handle_new_color(int color, int alpha) { this->color = color; - color_thread->update_lock->unlock(); return 1; } @@ -229,21 +279,25 @@ void GWindowColorButton::handle_done_event(int result) void GWindowGUI::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10); + int x = xs10, y = ys10; lock_window("GWindowGUI::create_objects"); for( int i=0; i<(int)(sizeof(toggle_order)/sizeof(toggle_order[0])); ++i ) { toggleinfo *tp = &toggle_order[i]; int ref = tp->ref; if( ref < 0 ) { - BC_Bar *bar = new BC_Bar(x,y,get_w()-x-10); + BC_Bar *bar = new BC_Bar(x,y,get_w()-x-xs10); add_tool(bar); toggles[i] = 0; - y += bar->get_h() + 5; + y += bar->get_h() + ys5; continue; } const char *label = toggle_text(tp); - int color = tp->isauto > 0 ? auto_colors[tp->ref] : WHITE; + int color = tp->isauto > 0 ? + auto_colors[tp->ref] : + get_resources()->text_default ; GWindowToggle *toggle = new GWindowToggle(this, x, y, label, color, tp); add_tool(toggles[i] = toggle); if( tp->isauto > 0 ) { @@ -254,16 +308,18 @@ void GWindowGUI::create_objects() case AUTOMATION_MASK: vframe = mwindow->theme->maskkeyframe_data; break; } if( !vframe ) { - int wh = toggle->get_h() - 4; + int wh = toggle->get_h() - yS(4); + if( wh < 1 ) wh = 1; GWindowColorButton *color_button = - new GWindowColorButton(toggle, get_w()-wh-10, y+2, wh, color); + new GWindowColorButton(toggle, get_w()-wh-ys10, y+yS(2), wh, color); add_tool(color_button); color_button->create_objects(); + color_button->context_help_set_keyword(toggle_help(tp)); } else - draw_vframe(vframe, get_w()-vframe->get_w()-10, y); + draw_vframe(vframe, get_w()-vframe->get_w()-xs10, y); } - else if( tp->isauto < 0 ) { + else { const char *accel = 0; switch( ref ) { case NONAUTOTOGGLES_CAMERA_XYZ: @@ -274,13 +330,19 @@ void GWindowGUI::create_objects() projector_xyz = toggle; accel = _("Shift-F2"); break; + case NON_AUTOMATION_HARD_EDGES: + VFrame *vframe = mwindow->theme->hardedge_data; + draw_vframe(vframe, get_w()-vframe->get_w()-xs10, y); + hard_edges = toggle; + break; } - if( accel ) { - int x1 = get_w() - BC_Title::calculate_w(this, accel) - 10; + if( accel ) { + int x1 = get_w() - BC_Title::calculate_w(this, accel) - xs10; add_subwindow(new BC_Title(x1, y, accel)); } } - y += toggles[i]->get_h() + 5; + toggle->context_help_set_keyword(toggle_help(tp)); + y += toggles[i]->get_h() + ys5; } update_toggles(0); unlock_window(); @@ -389,7 +451,7 @@ int GWindowGUI::keypress_event() } break; } - return 0; + return context_help_check_and_show(); } int GWindowGUI::check_xyz(int group) @@ -412,13 +474,12 @@ int* GWindowGUI::get_main_value(toggleinfo *info) { if( info->isauto > 0 ) return &mwindow->edl->session->auto_conf->autos[info->ref]; - if( !info->isauto ) { - switch( info->ref ) { - case NON_AUTOMATION_ASSETS: return &mwindow->edl->session->show_assets; - case NON_AUTOMATION_TITLES: return &mwindow->edl->session->show_titles; - case NON_AUTOMATION_TRANSITIONS: return &mwindow->edl->session->auto_conf->transitions; - case NON_AUTOMATION_PLUGIN_AUTOS: return &mwindow->edl->session->auto_conf->plugins; - } + switch( info->ref ) { + case NON_AUTOMATION_ASSETS: return &mwindow->edl->session->show_assets; + case NON_AUTOMATION_TITLES: return &mwindow->edl->session->show_titles; + case NON_AUTOMATION_TRANSITIONS: return &mwindow->edl->session->auto_conf->transitions; + case NON_AUTOMATION_PLUGIN_AUTOS: return &mwindow->edl->session->auto_conf->plugins; + case NON_AUTOMATION_HARD_EDGES: return &mwindow->edl->session->auto_conf->hard_edges; } return 0; } @@ -477,6 +538,7 @@ int GWindowToggle::handle_event() switch( info->ref ) { case NONAUTOTOGGLES_CAMERA_XYZ: group = AUTOMATION_CAMERA_X; break; case NONAUTOTOGGLES_PROJECTOR_XYZ: group = AUTOMATION_PROJECTOR_X; break; + case NON_AUTOMATION_HARD_EDGES: *gui->get_main_value(info) = value; break; } if( group >= 0 ) { gui->xyz_check(group, value);