1 #include "browsebutton.h"
10 BrowseButton::BrowseButton(MWindow *mwindow,
11 BC_WindowBase *parent_window,
19 : BC_Button(x, y, mwindow->theme->magnify_button_data),
22 this->parent_window = parent_window;
23 this->want_directory = want_directory;
25 this->caption = caption;
26 this->init_directory = init_directory;
27 this->textbox = textbox;
28 this->mwindow = mwindow;
29 set_tooltip("Look for file");
31 startup_lock = new Mutex;
34 BrowseButton::~BrowseButton()
43 startup_lock->unlock();
48 int BrowseButton::handle_event()
61 x = parent_window->get_abs_cursor_x();
62 y = parent_window->get_abs_cursor_y();
67 startup_lock->unlock();
71 void BrowseButton::run()
73 BrowseButtonWindow browsewindow(mwindow,
81 startup_lock->unlock();
82 browsewindow.create_objects();
83 int result2 = browsewindow.run_window();
89 // textbox->update(browsewindow.get_directory());
93 // textbox->update(browsewindow.get_filename());
96 textbox->update(browsewindow.get_submitted_path());
97 parent_window->flush();
98 textbox->handle_event();
100 startup_lock->lock();
102 startup_lock->unlock();
110 BrowseButtonWindow::BrowseButtonWindow(MWindow *mwindow,
111 BrowseButton *button,
112 BC_WindowBase *parent_window,
113 char *init_directory,
117 : BC_FileBox(button->x -
118 BC_WindowBase::get_resources()->filebox_w / 2,
120 BC_WindowBase::get_resources()->filebox_h / 2,
124 // Set to 1 to get hidden files.
126 // Want only directories
129 mwindow->theme->browse_pad)
133 BrowseButtonWindow::~BrowseButtonWindow()