}
-
-
-
-
-
-
+#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;
}
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));
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();
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;
}
-
-
-
-
-