X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcfilebox.C;fp=cinelerra-5.1%2Fguicast%2Fbcfilebox.C;h=9b3b6c89cafcffd0fa79701b92bcb654f37be2ba;hp=54e6bbf5de5c6d65c88cf43a37b3e9b4c76573a4;hb=04293346a5ef49683cfa6ca3a98ef6cbfcdf7732;hpb=033efab12586e8086014c814a5360f211d228ac3 diff --git a/cinelerra-5.1/guicast/bcfilebox.C b/cinelerra-5.1/guicast/bcfilebox.C index 54e6bbf5..9b3b6c89 100644 --- a/cinelerra-5.1/guicast/bcfilebox.C +++ b/cinelerra-5.1/guicast/bcfilebox.C @@ -90,14 +90,8 @@ int BC_FileBoxListBox::selection_changed() filebox->column_of_type(FILEBOX_NAME), 0); if(item) { - char path[BCTEXTLEN]; - strcpy(path, item->get_text()); - filebox->textbox->update(path); - filebox->fs->extract_dir(filebox->directory, path); - filebox->fs->extract_name(filebox->filename, path); - filebox->fs->complete_path(path); - strcpy(filebox->current_path, path); - strcpy(filebox->submitted_path, path); + filebox->textbox->update(item->get_text()); + filebox->update_paths(item->get_text()); } return 1; } @@ -172,11 +166,11 @@ BC_FileBoxTextBox::~BC_FileBoxTextBox() int BC_FileBoxTextBox::handle_event() { - int result = 0; - if(get_keypress() != RETURN) - { + int key = get_keypress(), result = 1; + if( !key || key == RETURN ) // not a text update + filebox->update_paths(filebox->textbox->get_text()); + else result = calculate_suggestions(&filebox->list_column[0]); - } return result; } @@ -1017,6 +1011,17 @@ int BC_FileBox::update_filter(const char *filter) } +void BC_FileBox::update_paths(const char *text) +{ + char path[BCTEXTLEN]; + strncpy(path, text, sizeof(path)-1); + fs->extract_dir(directory, path); + fs->extract_name(filename, path); + fs->complete_path(path); + strcpy(current_path, path); + strcpy(submitted_path, path); +} + void BC_FileBox::move_column(int src, int dst) { if(src != dst)