remove whitespace at eol
[goodguy/history.git] / cinelerra-5.1 / cinelerra / resizetrackthread.C
index 8ffd680a4a364de6fba4a8c76047e5e279dc1ee5..1c2eadc841c0ecd02f089a7b40f81e7469037301 100644 (file)
@@ -2,21 +2,21 @@
 /*
  * CINELERRA
  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- * 
+ *
  */
 
 #include "asset.h"
@@ -69,8 +69,8 @@ void ResizeVTrackThread::start_window(int w, int h, int w1, int h1)
 
 void ResizeVTrackThread::run()
 {
-       ResizeVTrackWindow *window = this->window = 
-               new ResizeVTrackWindow(mwindow, 
+       ResizeVTrackWindow *window = this->window =
+               new ResizeVTrackWindow(mwindow,
                        this,
                        mwindow->gui->get_abs_cursor_x(1),
                        mwindow->gui->get_abs_cursor_y(1));
@@ -85,8 +85,8 @@ void ResizeVTrackThread::run()
                update();
        }
 
-       if(((w % 4) || 
-               (h % 4)) && 
+       if(((w % 4) ||
+               (h % 4)) &&
                mwindow->edl->session->playback_config->vconfig->driver == PLAYBACK_X11_GL)
        {
                MainError::show_error(
@@ -98,20 +98,15 @@ void ResizeVTrackThread::run()
 
 
 
-ResizeVTrackWindow::ResizeVTrackWindow(MWindow *mwindow, 
+ResizeVTrackWindow::ResizeVTrackWindow(MWindow *mwindow,
        ResizeVTrackThread *thread,
        int x,
        int y)
- : BC_Window(_(PROGRAM_NAME ": Resize Track"), 
-                               x - 320 / 2,
-                               y - get_resources()->ok_images[0]->get_h() + 100 / 2,
-                               340, 
-                               get_resources()->ok_images[0]->get_h() + 100, 
-                               340, 
-                               get_resources()->ok_images[0]->get_h() + 100, 
-                               0,
-                               0, 
-                               1)
+ : BC_Window(_(PROGRAM_NAME ": Resize Track"),
+                               x - 320 / 2, y - get_resources()->ok_images[0]->get_h() + 100 / 2,
+                               400, get_resources()->ok_images[0]->get_h() + 100,
+                               400, get_resources()->ok_images[0]->get_h() + 100,
+                               0, 0, 1)
 {
        this->mwindow = mwindow;
        this->thread = thread;
@@ -126,45 +121,30 @@ void ResizeVTrackWindow::create_objects()
        int x = 10, y = 10;
 
        lock_window("ResizeVTrackWindow::create_objects");
-       add_subwindow(new BC_Title(x, y, _("Size:")));
-       x += 50;
-       add_subwindow(w = new ResizeVTrackWidth(this, 
-               thread,
-               x,
-               y));
-       x += w->get_w() + 10;
-       add_subwindow(new BC_Title(x, y, _("x")));
-       x += 15;
-       add_subwindow(h = new ResizeVTrackHeight(this, 
-               thread,
-               x,
-               y));
-       x += h->get_w() + 5;
+       BC_Title *size_title = new BC_Title(x, y, _("Size:"));
+       add_subwindow(size_title);
+       int x1 = x + size_title->get_w();
+       int y1 = y + size_title->get_h() + 10;
+       BC_Title *scale_title = new BC_Title(x, y1, _("Scale:"));
+       add_subwindow(scale_title);
+       int x2 = x + scale_title->get_w();
+       if( x2 > x1 ) x1 = x2;
+       x1 += 10;
+       add_subwindow(w = new ResizeVTrackWidth(this, thread, x1, y));
+       x2 = x1 + w->get_w() + 5;
+       BC_Title *xy = new BC_Title(x2, y, _("x"));
+       add_subwindow(xy);
+       int x3 = x2 + xy->get_w() + 5;
+       add_subwindow(h = new ResizeVTrackHeight(this, thread, x3, y));
+       x = x3 + h->get_w() + 5;
        FrameSizePulldown *pulldown;
-       add_subwindow(pulldown = new FrameSizePulldown(mwindow->theme, 
-               w, 
-               h, 
-               x, 
-               y));
+       add_subwindow(pulldown = new FrameSizePulldown(mwindow->theme, w, h, x, y));
        x += pulldown->get_w() + 5;
        add_subwindow(new ResizeVTrackSwap(this, thread, x, y));
 
-
-       y += 30;
-       x = 10;
-       add_subwindow(new BC_Title(x, y, _("Scale:")));
-       x += 50;
-       add_subwindow(w_scale = new ResizeVTrackScaleW(this, 
-               thread,
-               x,
-               y));
-       x += 100;
-       add_subwindow(new BC_Title(x, y, _("x")));
-       x += 15;
-       add_subwindow(h_scale = new ResizeVTrackScaleH(this, 
-               thread,
-               x,
-               y));
+       add_subwindow(w_scale = new ResizeVTrackScaleW(this, thread, x1, y1));
+       add_subwindow(new BC_Title(x2, y1, _("x")));
+       add_subwindow(h_scale = new ResizeVTrackScaleH(this, thread, x3, y1));
 
        add_subwindow(new BC_OKButton(this));
        add_subwindow(new BC_CancelButton(this));
@@ -174,8 +154,8 @@ void ResizeVTrackWindow::create_objects()
        unlock_window();
 }
 
-void ResizeVTrackWindow::update(int changed_scale, 
-       int changed_size, 
+void ResizeVTrackWindow::update(int changed_scale,
+       int changed_size,
        int changed_all)
 {
 //printf("ResizeVTrackWindow::update %d %d %d\n", changed_scale, changed_size, changed_all);
@@ -201,9 +181,9 @@ void ResizeVTrackWindow::update(int changed_scale,
 
 
 
-ResizeVTrackSwap::ResizeVTrackSwap(ResizeVTrackWindow *gui, 
-       ResizeVTrackThread *thread, 
-       int x, 
+ResizeVTrackSwap::ResizeVTrackSwap(ResizeVTrackWindow *gui,
+       ResizeVTrackThread *thread,
+       int x,
        int y)
  : BC_Button(x, y, thread->mwindow->theme->get_image_set("swap_extents"))
 {
@@ -229,7 +209,7 @@ int ResizeVTrackSwap::handle_event()
 
 
 
-ResizeVTrackWidth::ResizeVTrackWidth(ResizeVTrackWindow *gui, 
+ResizeVTrackWidth::ResizeVTrackWidth(ResizeVTrackWindow *gui,
        ResizeVTrackThread *thread,
        int x,
        int y)
@@ -245,7 +225,7 @@ int ResizeVTrackWidth::handle_event()
        return 1;
 }
 
-ResizeVTrackHeight::ResizeVTrackHeight(ResizeVTrackWindow *gui, 
+ResizeVTrackHeight::ResizeVTrackHeight(ResizeVTrackWindow *gui,
        ResizeVTrackThread *thread,
        int x,
        int y)
@@ -262,7 +242,7 @@ int ResizeVTrackHeight::handle_event()
 }
 
 
-ResizeVTrackScaleW::ResizeVTrackScaleW(ResizeVTrackWindow *gui, 
+ResizeVTrackScaleW::ResizeVTrackScaleW(ResizeVTrackWindow *gui,
        ResizeVTrackThread *thread,
        int x,
        int y)
@@ -278,7 +258,7 @@ int ResizeVTrackScaleW::handle_event()
        return 1;
 }
 
-ResizeVTrackScaleH::ResizeVTrackScaleH(ResizeVTrackWindow *gui, 
+ResizeVTrackScaleH::ResizeVTrackScaleH(ResizeVTrackWindow *gui,
        ResizeVTrackThread *thread,
        int x,
        int y)