fix segv for plugin render_gui when plugin moved up/dn, opencv build fixes, opts...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / confirmsave.C
index 3542a049d5f0be63886eb4654f36523bf33d1049..02fa7bbcb13e9c1a6a10c4887b6b8c78c9e5d648 100644 (file)
@@ -84,20 +84,15 @@ int ConfirmSave::test_files(MWindow *mwindow, ArrayList<char*> *paths)
 }
 
 
-
-
-
-
-
-
+#define CSW_W xS(400)
+#define CSW_H yS(150)
 
 ConfirmSaveWindow::ConfirmSaveWindow(MWindow *mwindow,
        ArrayList<BC_ListBoxItem*> *list)
  : BC_Window(_(PROGRAM_NAME ": File Exists"),
-               mwindow->gui->get_abs_cursor_x(1) - 160,
-               mwindow->gui->get_abs_cursor_y(1) - 120,
-               320,
-               320)
+               mwindow->gui->get_abs_cursor_x(1) - CSW_W/2,
+               mwindow->gui->get_abs_cursor_y(1) - CSW_H/2,
+               CSW_W, CSW_H)
 {
        this->list = list;
 }
@@ -109,7 +104,9 @@ ConfirmSaveWindow::~ConfirmSaveWindow()
 
 void ConfirmSaveWindow::create_objects()
 {
-       int x = 10, y = 10;
+       int xs10 = xS(10);
+       int ys10 = yS(10), ys30 = yS(30);
+       int x = xs10, y = ys10;
        lock_window("ConfirmSaveWindow::create_objects");
        add_subwindow(new BC_OKButton(this));
        add_subwindow(new BC_CancelButton(this));
@@ -117,16 +114,13 @@ void ConfirmSaveWindow::create_objects()
        add_subwindow(title = new BC_Title(x,
                y,
                _("The following files exist.  Overwrite them?")));
-       y += 30;
-       add_subwindow(listbox = new BC_ListBox(x,
-               y,
-               get_w() - x - 10,
-               get_h() - y - BC_OKButton::calculate_h() - 10,
+       y += ys30;
+       add_subwindow(listbox = new BC_ListBox(x, y,
+               get_w() - x - xs10,
+               get_h() - y - BC_OKButton::calculate_h() - ys10,
                LISTBOX_TEXT,
                list));
-       y = get_h() - 40;
        add_subwindow(new BC_OKButton(this));
-       x = get_w() - 100;
        add_subwindow(new BC_CancelButton(this));
        show_window(1);
        unlock_window();
@@ -134,18 +128,14 @@ void ConfirmSaveWindow::create_objects()
 
 int ConfirmSaveWindow::resize_event(int w, int h)
 {
-       int x = 10, y = 10;
+       int xs10 = xS(10);
+       int ys10 = yS(10), ys30 = yS(30);
+       int x = xs10, y = ys10;
        title->reposition_window(x, y);
-       y += 30;
-       listbox->reposition_window(x,
-               y,
-               w - x - 10,
-               h - y - 50);
+       y += ys30;
+       listbox->reposition_window(x, y,
+               w - x - xs10,
+               h - y - BC_OKButton::calculate_h() - ys10);
        return 1;
 }
 
-
-
-
-
-