1 #include "browsebutton.h"
6 #define _(String) gettext(String)
7 #define gettext_noop(String) String
8 #define N_(String) gettext_noop (String)
12 BrowseButton::BrowseButton(MWindow *mwindow,
13 BC_WindowBase *parent_window,
21 : BC_Button(x, y, mwindow->theme->magnify_button_data), Thread()
23 this->parent_window = parent_window;
24 this->want_directory = want_directory;
26 this->caption = caption;
27 this->init_directory = init_directory;
28 this->textbox = textbox;
29 this->mwindow = mwindow;
30 set_tooltip(_("Look for file"));
33 BrowseButton::~BrowseButton()
37 int BrowseButton::handle_event()
42 void BrowseButton::run()
44 BrowseButtonWindow browsewindow(mwindow,
50 browsewindow.create_objects();
51 int result2 = browsewindow.run_window();
57 // textbox->update(browsewindow.get_directory());
61 // textbox->update(browsewindow.get_filename());
64 textbox->update(browsewindow.get_path());
65 parent_window->flush();
66 textbox->handle_event();
75 BrowseButtonWindow::BrowseButtonWindow(MWindow *mwindow,
76 BC_WindowBase *parent_window,
81 : BC_FileBox(parent_window->get_abs_cursor_x() - BC_WindowBase::get_resources()->filebox_w / 2,
82 parent_window->get_abs_cursor_y() - BC_WindowBase::get_resources()->filebox_h / 2,
86 // Set to 1 to get hidden files.
88 // Want only directories
91 mwindow->theme->browse_pad)
95 BrowseButtonWindow::~BrowseButtonWindow()