opencv lib path fix, ub18 fixes
[goodguy/history.git] / cinelerra-5.1 / cinelerra / browsebutton.C
index 4d2e69b29554d8baf4f897fc4b18280bcfba2204..fae5758b94d7eb35fa31afd364f6493cfd846cf2 100644 (file)
  *
  */
 
+#include "bcsignals.h"
 #include "browsebutton.h"
 #include "language.h"
 #include "mutex.h"
-#include "mwindow.h"
 #include "theme.h"
 
 
-
-
-BrowseButton::BrowseButton(MWindow *mwindow,
+BrowseButton::BrowseButton(Theme *theme,
        BC_WindowBase *parent_window,
        BC_TextBox *textbox,
        int x,
@@ -37,7 +35,7 @@ BrowseButton::BrowseButton(MWindow *mwindow,
        const char *title,
        const char *caption,
        int want_directory)
- : BC_Button(x, y, mwindow->theme->get_image_set("magnify_button")),
+ : BC_Button(x, y, theme->get_image_set("magnify_button")),
    Thread(1, 0, 0)
 {
        this->parent_window = parent_window;
@@ -46,7 +44,7 @@ BrowseButton::BrowseButton(MWindow *mwindow,
        this->caption = caption;
        this->init_directory = init_directory;
        this->textbox = textbox;
-       this->mwindow = mwindow;
+       this->theme = theme;
        set_tooltip(_("Look for file"));
        gui = 0;
        startup_lock = new Mutex("BrowseButton::startup_lock");
@@ -91,8 +89,9 @@ int BrowseButton::handle_event()
 
 void BrowseButton::run()
 {
-       BrowseButtonWindow browsewindow(mwindow,
-               this,
+       BrowseButtonWindow browsewindow(theme,
+               get_x() - BC_WindowBase::get_resources()->filebox_w / 2,
+               get_y() - BC_WindowBase::get_resources()->filebox_h / 2,
                parent_window,
                textbox->get_text(),
                title,
@@ -129,20 +128,13 @@ void BrowseButton::run()
        startup_lock->unlock();
 }
 
-
-BrowseButtonWindow::BrowseButtonWindow(MWindow *mwindow,
-       BrowseButton *button,
-       BC_WindowBase *parent_window,
-       const char *init_directory,
-       const char *title,
-       const char *caption,
-       int want_directory)
- : BC_FileBox(button->x - BC_WindowBase::get_resources()->filebox_w / 2,
-       button->y - BC_WindowBase::get_resources()->filebox_h / 2,
-       init_directory, title, caption,
+BrowseButtonWindow::BrowseButtonWindow(Theme *theme, int x, int y,
+       BC_WindowBase *parent_window, const char *init_directory,
+       const char *title, const char *caption, int want_directory)
+ : BC_FileBox(x, y, init_directory, title, caption,
        want_directory, // Set to 1 to get hidden files.
        want_directory, // Want only directories
-       0, mwindow->theme->browse_pad)
+       0, theme->browse_pad)
 {
 }