translation fixes, pref wdw min width, xfer mode ops
[goodguy/history.git] / cinelerra-5.1 / cinelerra / zoombar.C
index 81a523dbdbd1706560fb75e10ecce1aea921c3d5..47dc15d538ce5e4a29b209da9866b33b773ab5a7 100644 (file)
@@ -88,7 +88,12 @@ void ZoomBar::create_objects()
        track_zoom->zoom_tumbler->set_tooltip(_("Height of tracks in the timeline"));
        x += track_zoom->get_w() + 10;
 
-       add_subwindow(auto_type = new AutoTypeMenu(mwindow, this, x, y));
+       int wid = 120;
+       for( int i=AUTOGROUPTYPE_AUDIO_FADE; i<=AUTOGROUPTYPE_Y; ++i ) {
+               int ww = BC_GenericButton::calculate_w(this, AutoTypeMenu::to_text(i));
+               if( ww > wid ) wid = ww;
+       }
+       add_subwindow(auto_type = new AutoTypeMenu(mwindow, this, x, y, wid));
        auto_type->create_objects();
        x += auto_type->get_w() + 10;
 #define DEFAULT_TEXT "000.00 to 000.00"
@@ -171,27 +176,30 @@ int ZoomBar::draw()
 void ZoomBar::update_autozoom()
 {
        char string[BCTEXTLEN];
-       switch (mwindow->edl->local_session->zoombar_showautotype) {
+       int autogroup_type = mwindow->edl->local_session->zoombar_showautotype;
+       switch( autogroup_type ) {
        case AUTOGROUPTYPE_AUDIO_FADE:
        case AUTOGROUPTYPE_VIDEO_FADE:
                sprintf(string, "%0.01f to %0.01f\n", 
-                       mwindow->edl->local_session->automation_mins[mwindow->edl->local_session->zoombar_showautotype],
-                       mwindow->edl->local_session->automation_maxs[mwindow->edl->local_session->zoombar_showautotype]);
+                       mwindow->edl->local_session->automation_mins[autogroup_type],
+                       mwindow->edl->local_session->automation_maxs[autogroup_type]);
                break;
        case AUTOGROUPTYPE_ZOOM:
        case AUTOGROUPTYPE_SPEED:
                sprintf(string, "%0.03f to %0.03f\n", 
-                       mwindow->edl->local_session->automation_mins[mwindow->edl->local_session->zoombar_showautotype],
-                       mwindow->edl->local_session->automation_maxs[mwindow->edl->local_session->zoombar_showautotype]);
+                       mwindow->edl->local_session->automation_mins[autogroup_type],
+                       mwindow->edl->local_session->automation_maxs[autogroup_type]);
                break;
        case AUTOGROUPTYPE_X:
        case AUTOGROUPTYPE_Y:
                sprintf(string, "%0.0f to %.0f\n", 
-                       mwindow->edl->local_session->automation_mins[mwindow->edl->local_session->zoombar_showautotype],
-                       mwindow->edl->local_session->automation_maxs[mwindow->edl->local_session->zoombar_showautotype]);
+                       mwindow->edl->local_session->automation_mins[autogroup_type],
+                       mwindow->edl->local_session->automation_maxs[autogroup_type]);
                break;
        }
        auto_zoom_text->update(string);
+       const char *group_name = AutoTypeMenu::to_text(autogroup_type);
+       auto_type->set_text(group_name);
 }
 
 int ZoomBar::update()
@@ -448,8 +456,8 @@ int AutoZoom::handle_down_event()
 
 
 
-AutoTypeMenu::AutoTypeMenu(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
-       : BC_PopupMenu(x, y, 120,to_text(mwindow->edl->local_session->zoombar_showautotype), 1)
+AutoTypeMenu::AutoTypeMenu(MWindow *mwindow, ZoomBar *zoombar, int x, int y, int wid)
+       : BC_PopupMenu(x, y, wid, to_text(mwindow->edl->local_session->zoombar_showautotype), 1)
 {
        this->mwindow = mwindow;
        this->zoombar = zoombar;