X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Feditlength.C;fp=cinelerra-5.1%2Fcinelerra%2Feditlength.C;h=188d415aacfc54b02998a08d463e7fd6ca13b30f;hp=0cd5cd7e425a68f5857d2cd105aaebd6d7ed151e;hb=0df48ad2d876409c5beeae2e21933a728ea76c33;hpb=bd570c5fa5f5473b670673368dc30356aa6c43fa diff --git a/cinelerra-5.1/cinelerra/editlength.C b/cinelerra-5.1/cinelerra/editlength.C index 0cd5cd7e..188d415a 100644 --- a/cinelerra-5.1/cinelerra/editlength.C +++ b/cinelerra-5.1/cinelerra/editlength.C @@ -89,56 +89,38 @@ void EditLengthThread::start(Edit *edit) BC_DialogThread::start(); } +#define ELW_W xS(300) +#define ELW_H yS(100) + BC_Window* EditLengthThread::new_gui() { BC_DisplayInfo display_info; - int x = display_info.get_abs_cursor_x() - 150; - int y = display_info.get_abs_cursor_y() - 50; - EditLengthDialog *gui = new EditLengthDialog(mwindow, - this, - x, - y); + int x = display_info.get_abs_cursor_x() - ELW_W/2; + int y = display_info.get_abs_cursor_y() - ELW_H/2; + EditLengthDialog *gui = new EditLengthDialog(mwindow, this, x, y); gui->create_objects(); return gui; } void EditLengthThread::handle_close_event(int result) { - if(!result) - { - if(edit) - { + if(!result) { + if(edit) { // mwindow->set_edit_length(edit, length); } - else - { + else { mwindow->set_edit_length(length); } } } - - - - - - - EditLengthDialog::EditLengthDialog(MWindow *mwindow, EditLengthThread *thread, int x, int y) - : BC_Window(_(PROGRAM_NAME ": Edit length"), - x, - y, - 300, - 100, - -1, - -1, - 0, - 0, - 1) + : BC_Window(_(PROGRAM_NAME ": Edit length"), x, y, + ELW_W, ELW_H, -1, -1, 0, 0, 1) { this->mwindow = mwindow; this->thread = thread; @@ -151,9 +133,11 @@ EditLengthDialog::~EditLengthDialog() void EditLengthDialog::create_objects() { + int xs10 = xS(10), xs100 = xS(100); + int ys10 = yS(10); lock_window("EditLengthDialog::create_objects"); - add_subwindow(new BC_Title(10, 10, _("Seconds:"))); - text = new EditLengthText(mwindow, this, 100, 10); + add_subwindow(new BC_Title(xs10, ys10, _("Seconds:"))); + text = new EditLengthText(mwindow, this, xs100, ys10); text->create_objects(); add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); @@ -168,21 +152,10 @@ int EditLengthDialog::close_event() } - - - - EditLengthText::EditLengthText(MWindow *mwindow, - EditLengthDialog *gui, - int x, - int y) - : BC_TumbleTextBox(gui, - (float)gui->thread->length, - (float)0, - (float)100, - x, - y, - 100) + EditLengthDialog *gui, int x, int y) + : BC_TumbleTextBox(gui, (float)gui->thread->length, + 0.f, 100.f, x, y, xS(100)) { this->mwindow = mwindow; this->gui = gui; @@ -199,12 +172,3 @@ int EditLengthText::handle_event() return 1; } - - - - - - - - -