X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcfilebox.C;h=803f2fc465542afec39b9179c744f0de2e44cd08;hb=72a88d4704507f72e05b380d9604d9eb3e7d5a89;hp=fa2f8b24401483dc332e28db2a8cd5ace6419d20;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/bcfilebox.C b/cinelerra-5.1/guicast/bcfilebox.C index fa2f8b24..803f2fc4 100644 --- a/cinelerra-5.1/guicast/bcfilebox.C +++ b/cinelerra-5.1/guicast/bcfilebox.C @@ -51,6 +51,7 @@ BC_FileBoxRecent::BC_FileBoxRecent(BC_FileBox *filebox, int x, int y) 0, 0, 1, 0, 1) { this->filebox = filebox; + set_tooltip(_("Recent paths")); } int BC_FileBoxRecent::handle_event() @@ -173,7 +174,7 @@ int BC_FileBoxListBox::evaluate_query(char *string) BC_FileBoxTextBox::BC_FileBoxTextBox(int x, int y, BC_FileBox *filebox) - : BC_TextBox(x, y, filebox->get_w() - 20, 1, + : BC_TextBox(x, y, filebox->get_w() - x - 20, 1, filebox->want_directory ? filebox->directory : filebox->filename) { this->filebox = filebox; @@ -194,8 +195,8 @@ int BC_FileBoxTextBox::handle_event() } -BC_FileBoxDirectoryText::BC_FileBoxDirectoryText(int x, int y, BC_FileBox *filebox) - : BC_TextBox(x, y, filebox->get_w() - 40, 1, filebox->fs->get_current_dir()) +BC_FileBoxDirectoryText::BC_FileBoxDirectoryText(int x, int y, int w, BC_FileBox *filebox) + : BC_TextBox(x, y, w, 1, filebox->fs->get_current_dir()) { this->filebox = filebox; } @@ -545,6 +546,7 @@ BC_FileBox::BC_FileBox(int x, int y, const char *init_path, this->h_padding = h_padding; delete_thread = new BC_DeleteThread(this); rename_thread = 0; + y_margin = 0; } BC_FileBox::~BC_FileBox() @@ -624,10 +626,12 @@ void BC_FileBox::create_objects() y += directory_title_margin + 3; add_subwindow(recent_popup = new BC_FileBoxRecent(this, x, y)); - add_subwindow(directory_title = new BC_FileBoxDirectoryText(x, y, this)); - directory_title->reposition_window(x, y, get_w() - recent_popup->get_w() - 20, 1); - x += directory_title->get_w() + 8; - recent_popup->reposition_window(x, y, directory_title->get_w(), 200); + BC_Title *dir_title; + add_subwindow(dir_title = new BC_Title(x, y, _("Directory:"))); + int x1 = x + dir_title->get_w() + 10, w1 = get_w()-x1 - recent_popup->get_w()-20; + add_subwindow(directory_title = new BC_FileBoxDirectoryText(x1, y, w1, this)); + x1 += directory_title->get_w() + 8; + recent_popup->reposition_window(x1, y, directory_title->get_w(), 200); x = 10; y += directory_title->get_h() + 5; @@ -665,7 +669,9 @@ void BC_FileBox::create_objects() listbox = 0; create_listbox(x, y, get_display_mode()); y += listbox->get_h() + 10; - add_subwindow(textbox = new BC_FileBoxTextBox(x, y, this)); + add_subwindow(file_title = new BC_Title(x, y, _("File:"))); + x1 = x + file_title->get_w() + 10; + add_subwindow(textbox = new BC_FileBoxTextBox(x1, y, this)); y += textbox->get_h() + 10; if(!want_directory) { @@ -674,7 +680,9 @@ void BC_FileBox::create_objects() add_subwindow(filter_text = new BC_FileBoxFilterText(x1, y, this)); add_subwindow(filter_popup = new BC_FileBoxFilterMenu(x1 + filter_text->get_w(), y, this)); + y += filter_text->get_h() + 10; } + y_margin = y; // listbox has to be active because refresh might be called from newfolder_thread listbox->activate(); @@ -684,6 +692,7 @@ void BC_FileBox::create_objects() refresh(); show_window(); + raise_window(); unlock_window(); } @@ -741,20 +750,19 @@ int BC_FileBox::resize_event(int w, int h) w - (get_w() - filter_text->get_w()), 1); directory_title->reposition_window( - directory_title->get_x(), - directory_title->get_y(), - get_w() - recent_popup->get_w() - 20, - 1); + directory_title->get_x(), directory_title->get_y(), + get_w()-directory_title->get_x() - recent_popup->get_w()-20, 1); recent_popup->reposition_window( directory_title->get_x() + directory_title->get_w() + 8, directory_title->get_y(), - directory_title->get_w() + recent_popup->get_w(), - recent_popup->get_h()); + directory_title->get_w() + recent_popup->get_w(), 200); search_text->reposition_window( search_text->get_x(), search_text->get_y(), get_w() - search_text->get_x() - 40, 1); + file_title->reposition_window(file_title->get_x(), + h - (get_h() - file_title->get_y())); textbox->reposition_window(textbox->get_x(), h - (get_h() - textbox->get_y()), w - (get_w() - textbox->get_w()), @@ -776,6 +784,9 @@ int BC_FileBox::resize_event(int w, int h) set_w(w); set_h(h); get_resources()->filebox_w = get_w(); get_resources()->filebox_h = get_h(); + y_margin = filter_text ? + filter_text->get_y() + filter_text->get_h() + 10 : + textbox->get_y() + textbox->get_h() + 10 ; flush(); return 1; } @@ -1319,6 +1330,11 @@ void BC_FileBox::create_listbox(int x, int y, int mode) add_subwindow(listbox = new BC_FileBoxListBox(x, y, this)); } +int BC_FileBox::get_y_margin() +{ + return y_margin; +} + char* BC_FileBox::get_path(int selection) { if(selection == 0)