Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / wwindow.C
index 4f522f3179f099de3ee2622836771b6a3534a6eb..5dfa3586020b56cefe0b7bc1c13c53f557cb63a2 100644 (file)
@@ -32,6 +32,7 @@ WWindow::WWindow(MWindow *mwindow)
 {
        this->mwindow = mwindow;
        this->result = 0;
+       this->gui = 0;
 }
 
 WWindow::~WWindow()
@@ -59,7 +60,7 @@ BC_Window* WWindow::new_gui()
        BC_DisplayInfo display_info;
        int x = display_info.get_abs_cursor_x();
        int y = display_info.get_abs_cursor_y();
-       WWindowGUI *gui = new WWindowGUI(this, x, y);
+       gui = new WWindowGUI(this, x, y);
        gui->create_objects();
        return gui;
 }
@@ -72,7 +73,8 @@ int WWindow::wait_result()
 }
 
 WWindowGUI::WWindowGUI(WWindow *thread, int x, int y)
- : BC_Window(_(PROGRAM_NAME ": Warning"), x, y, 640, 100, 640, 100, 0, 0, 1)
+ : BC_Window(_(PROGRAM_NAME ": Warning"), x, y,
+               xS(640), yS(100), xS(640), yS(100), 0, 0, 1)
 {
        this->thread = thread;
 }
@@ -80,14 +82,16 @@ WWindowGUI::WWindowGUI(WWindow *thread, int x, int y)
 void WWindowGUI::create_objects()
 {
        lock_window("WWindowGUI::create_objects");
-       int x = 10, y = 10;
-       add_subwindow(new BC_TextBox(x, y, get_w()-50, 3, thread->warn_text));
-       y = get_h() - 30;
-       add_subwindow(new WDisable(this, x, y));
-       y = get_h() - BC_CancelButton::calculate_h() - 10;
-       x = get_w() - BC_CancelButton::calculate_w() - 10;
+       int x = xS(10), y = yS(10);
+       add_subwindow(new BC_TextBox(x, y, get_w()-xS(50), 3, thread->warn_text));
+       y = get_h() - yS(30);
+       if( thread->do_warning )
+               add_subwindow(new WDisable(this, x, y));
+       y = get_h() - BC_CancelButton::calculate_h() - yS(10);
+       x = get_w() - BC_CancelButton::calculate_w() - xS(10);
        add_subwindow(new BC_CancelButton(x, y));
        show_window();
+       raise_window();
        unlock_window();
 }