}
+BC_FileBoxSearchText::BC_FileBoxSearchText(int x, int y, BC_FileBox *filebox)
+ : BC_TextBox(x, y, filebox->get_w() - x - 40, 1, "")
+{
+ this->filebox = filebox;
+}
+
+int BC_FileBoxSearchText::handle_event()
+{
+ filebox->refresh();
+ return 1;
+}
+
+
BC_FileBoxFilterText::BC_FileBoxFilterText(int x, int y, BC_FileBox *filebox)
: BC_TextBox(x, y, filebox->get_w() - x - 50, 1, filebox->get_resources()->filebox_filter)
{
x = 10;
y += directory_title->get_h() + 5;
+ BC_Title *search_title;
+ add_subwindow(search_title = new BC_Title(x, y, _("Search:")));
+ x += search_title->get_w() + 10;
+ add_subwindow(search_text = new BC_FileBoxSearchText(x, y, this));
+
+ x = 10;
+ y += search_text->get_h() + 5;
+
int newest_id = 0, newest = -1;
for(int i = 0; i < FILEBOX_HISTORY_SIZE; i++) {
if( !resources->filebox_history[i].path[0] ) continue;
directory_title->get_y(),
directory_title->get_w() + recent_popup->get_w(),
recent_popup->get_h());
+ search_text->reposition_window(
+ search_text->get_x(),
+ search_text->get_y(),
+ get_w() - search_text->get_x() - 40,
+ 1);
textbox->reposition_window(textbox->get_x(),
h - (get_h() - textbox->get_y()),
w - (get_w() - textbox->get_w()),
int BC_FileBox::create_tables(int select_all)
{
+ int preload_textbox = select_all;
delete_tables();
char string[BCTEXTLEN];
BC_ListBoxItem *new_item;
for(int i = 0; i < fs->total_files(); i++)
{
FileItem *file_item = fs->get_entry(i);
+ const char *text = search_text->get_text();
+ if( text && text[0] && !bstrcasestr(file_item->name, text) )
+ continue;
int is_dir = file_item->is_dir;
BC_Pixmap* icon = get_icon(file_item->name, is_dir);
// {
if(!is_dir)
{
+ if( preload_textbox ) {
+ preload_textbox = 0;
+ textbox->update(new_item->get_text());
+ }
int64_t size = file_item->size;
if( (size_format == FILEBOX_SIZE_1000 && size >= 1000) ||
(size_format == FILEBOX_SIZE_1024 && size >= 1024) ) {