diff --git a/src/Fl_File_Chooser.cxx b/src/Fl_File_Chooser.cxx index 21330fb89..438c36f2d 100644 --- a/src/Fl_File_Chooser.cxx +++ b/src/Fl_File_Chooser.cxx @@ -3,7 +3,7 @@ #include "../FL/Fl_File_Chooser.H" inline void Fl_File_Chooser::cb_window_i(Fl_Window*, void*) { - fileName->value(directory_); + fileName->value(""); fileList->deselect(); Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this); window->hide(); diff --git a/src/Fl_File_Chooser.fl b/src/Fl_File_Chooser.fl index 34738e680..8a35d8e6c 100644 --- a/src/Fl_File_Chooser.fl +++ b/src/Fl_File_Chooser.fl @@ -26,17 +26,17 @@ class Fl_File_Chooser {open } { Fl_Window window { label {Choose File} - callback {fileName->value(directory_); + callback {fileName->value(""); fileList->deselect(); Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this); window->hide();} open - private xywh {153 80 490 380} resizable + private xywh {153 80 490 380} hide resizable code0 {if (title) window->label(title);} code1 {\#include } code2 {\#include } - code3 {\#include } modal visible + code3 {\#include } modal } { - Fl_Group {} {open + Fl_Group {} { private xywh {65 10 415 25} } { Fl_Choice showChoice { @@ -58,7 +58,7 @@ window->hide();} open } } Fl_Tile {} { - callback {update_preview();} open + callback {update_preview();} private xywh {10 45 470 225} resizable } { Fl_File_Browser fileList { @@ -74,7 +74,7 @@ window->hide();} open Fl_Group {} {open private xywh {0 275 480 95} } { - Fl_Group {} {open + Fl_Group {} { private xywh {10 275 470 20} } { Fl_Check_Button previewButton { @@ -127,7 +127,7 @@ window->hide();} selected } } Fl_Window favWindow { - label {Manage Favorites} open + label {Manage Favorites} private xywh {580 44 355 150} hide code0 {favWindow->label(manage_favorites_label);} modal } { diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index 1e7aeb0d3..cbd5cad28 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.27 2002/11/19 16:37:34 easysw Exp $" +// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.28 2002/11/20 15:49:24 easysw Exp $" // // More Fl_File_Chooser routines. // @@ -119,6 +119,9 @@ Fl_File_Chooser::count() { // Check to see if the file name input field is blank... filename = fileName->value(); + +// printf("Fl_File_Chooser::count(): filename=\"%s\"\n", filename); + if (filename == NULL || filename[0] == '\0') return (0); @@ -413,6 +416,7 @@ Fl_File_Chooser::fileListCB() filename = pathname + strlen(pathname) - 1; if (*filename == '/') *filename = '\0'; +// puts("Setting fileName from fileListCB..."); fileName->value(pathname); // Update the preview box... @@ -448,6 +452,8 @@ Fl_File_Chooser::fileNameCB() const char *file; // File from directory +// puts("fileNameCB()"); + // Get the filename from the text field... filename = (char *)fileName->value(); @@ -785,6 +791,7 @@ Fl_File_Chooser::rescan() if (pathname[0] && pathname[strlen(pathname) - 1] != '/') { strlcat(pathname, "/", sizeof(pathname)); } +// puts("Setting fileName in rescan()"); fileName->value(pathname); if (type_ & DIRECTORY) @@ -1152,5 +1159,5 @@ unquote_pathname(char *dst, // O - Destination string // -// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.27 2002/11/19 16:37:34 easysw Exp $". +// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.28 2002/11/20 15:49:24 easysw Exp $". // diff --git a/src/Fl_File_Input.cxx b/src/Fl_File_Input.cxx index 27c99f589..8a561663b 100644 --- a/src/Fl_File_Input.cxx +++ b/src/Fl_File_Input.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_File_Input.cxx,v 1.1.2.8 2002/11/19 16:37:34 easysw Exp $" +// "$Id: Fl_File_Input.cxx,v 1.1.2.9 2002/11/20 15:49:24 easysw Exp $" // // File_Input header file for the Fast Light Tool Kit (FLTK). // @@ -153,8 +153,7 @@ Fl_File_Input::value(const char *str, // I - New string value int // O - TRUE on success Fl_File_Input::value(const char *str) { // I - New string value damage(FL_DAMAGE_BAR); - if (*str) return Fl_Input::value(str); - else return 0; + return Fl_Input::value(str); } @@ -271,5 +270,5 @@ Fl_File_Input::handle_button(int event) // I - Event // -// End of "$Id: Fl_File_Input.cxx,v 1.1.2.8 2002/11/19 16:37:34 easysw Exp $". +// End of "$Id: Fl_File_Input.cxx,v 1.1.2.9 2002/11/20 15:49:24 easysw Exp $". // diff --git a/test/file_chooser.cxx b/test/file_chooser.cxx index 22e8a73b7..3134c11e0 100644 --- a/test/file_chooser.cxx +++ b/test/file_chooser.cxx @@ -1,5 +1,5 @@ // -// "$Id: file_chooser.cxx,v 1.4.2.3.2.8 2002/07/14 18:19:00 easysw Exp $" +// "$Id: file_chooser.cxx,v 1.4.2.3.2.9 2002/11/20 15:49:24 easysw Exp $" // // File chooser test program. // @@ -323,6 +323,9 @@ show_callback(void) for (i = 1; i <= count; i ++) { + if (!fc->value(i)) + break; + fl_filename_relative(relative, sizeof(relative), fc->value(i)); files->add(relative, @@ -335,5 +338,5 @@ show_callback(void) // -// End of "$Id: file_chooser.cxx,v 1.4.2.3.2.8 2002/07/14 18:19:00 easysw Exp $". +// End of "$Id: file_chooser.cxx,v 1.4.2.3.2.9 2002/11/20 15:49:24 easysw Exp $". //