Exciting new Alt/h help key provided by sge (Georgy) with many thanks!
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / transitionpopup.C
index ff19113b5e8bca9487b28c3eb8e95878a2e87573..2a73b772f1f4c323971a1a24ee1ac3a81850fe44 100644 (file)
@@ -68,6 +68,7 @@ BC_Window* TransitionLengthThread::new_gui()
 
 void TransitionLengthThread::handle_close_event(int result)
 {
+       if( mwindow->in_destructor ) return;
        if( !result ) {
                if( transition )
                        mwindow->set_transition_length(transition, new_length);
@@ -110,14 +111,9 @@ int TransitionUnitsItem::handle_event()
 {
        TransitionUnitsPopup *units_popup = (TransitionUnitsPopup *)get_popup_menu();
        TransitionLengthDialog *gui = units_popup->gui;
-       TransitionLengthText *length_text = gui->text;
-       EDLSession *session = gui->mwindow->edl->session;
        double length = gui->thread->new_length;
-       char text[BCSTRLEN];
        units_popup->units = id;
-       Units::totext(text, length, units_popup->units, session->sample_rate,
-                       session->frame_rate, session->frames_per_foot);
-       length_text->update(text);
+       gui->update_text(length);
        units_popup->set_text(get_text());
        return 1;
 }
@@ -152,6 +148,8 @@ TransitionLengthDialog::TransitionLengthDialog(MWindow *mwindow,
 {
        this->mwindow = mwindow;
        this->thread = thread;
+// *** CONTEXT_HELP ***
+       context_help_set_keyword("Transition Plugins");
 }
 
 TransitionLengthDialog::~TransitionLengthDialog()
@@ -180,6 +178,17 @@ int TransitionLengthDialog::close_event()
        return 1;
 }
 
+void TransitionLengthDialog::update_text(double length)
+{
+       int units = units_popup->units;
+       EDLSession *session = mwindow->edl->session;
+       char string[BCSTRLEN];
+       Units::totext(string, length, units,
+               session->sample_rate, session->frame_rate,
+               session->frames_per_foot);
+       text->update(string);
+}
+
 
 TransitionLengthText::TransitionLengthText(MWindow *mwindow,
        TransitionLengthDialog *gui, int x, int y)
@@ -219,11 +228,7 @@ int TransitionLengthText::handle_up_down(int dir)
                break;
        }
        double length = gui->thread->new_length + delta * dir;
-       char text[BCSTRLEN];
-       Units::totext(text, length, units,
-               session->sample_rate, session->frame_rate,
-               session->frames_per_foot);
-       update(text);
+       gui->update_text(length);
        return gui->thread->update(length);
 }