mirror of https://github.com/fltk/fltk
Multiple selections of files was cleared before the user had a chance to extract filenames. It was impossible to extract a multiple selection of directory names even though it was possible to select them in Fl_File_Chooser.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@6092 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
3c499836f1
commit
3724e507cc
2
CHANGES
2
CHANGES
|
@ -1,5 +1,7 @@
|
|||
CHANGES IN FLTK 1.1.9
|
||||
|
||||
- Fixed multiple selction of files and directories in
|
||||
Fl_File_Chooser
|
||||
- Fixed MSWindows crash when selecting umlauts
|
||||
in Fl_Help_View
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char
|
|||
fileName->callback((Fl_Callback*)cb_fileName);
|
||||
fileName->when(FL_WHEN_ENTER_KEY);
|
||||
Fl_Group::current()->resizable(fileName);
|
||||
fileName->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY_ALWAYS);
|
||||
fileName->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY);
|
||||
} // Fl_File_Input* fileName
|
||||
{ Fl_Box* o = new Fl_Box(10, 310, 105, 25, "Filename:");
|
||||
o->labelfont(1);
|
||||
|
|
|
@ -61,7 +61,7 @@ class FL_EXPORT Fl_File_Chooser {open
|
|||
callback {fileName->value("");
|
||||
fileList->deselect();
|
||||
Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
|
||||
window->hide();}
|
||||
window->hide();} open
|
||||
private xywh {388 284 490 380} type Double resizable
|
||||
code0 {if (title) window->label(title);}
|
||||
code1 {\#include <stdio.h>}
|
||||
|
@ -100,11 +100,11 @@ window->hide();}
|
|||
code0 {\#include <FL/Fl_File_Browser.H>}
|
||||
}
|
||||
Fl_Box previewBox {
|
||||
label {?}
|
||||
label {?} selected
|
||||
private xywh {305 45 175 225} box DOWN_BOX labelsize 100 align 80
|
||||
}
|
||||
}
|
||||
Fl_Group {} {
|
||||
Fl_Group {} {open
|
||||
private xywh {10 275 470 95}
|
||||
} {
|
||||
Fl_Group {} {open
|
||||
|
@ -123,7 +123,7 @@ window->hide();}
|
|||
Fl_File_Input fileName {
|
||||
callback {fileNameCB();}
|
||||
private xywh {115 300 365 35} labelfont 1 when 8 resizable
|
||||
code0 {fileName->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY_ALWAYS);}
|
||||
code0 {fileName->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY);}
|
||||
}
|
||||
Fl_Box {} {
|
||||
label {Filename:}
|
||||
|
@ -220,8 +220,7 @@ type(t);
|
|||
int e;
|
||||
prefs_.get("preview", e, 1);
|
||||
preview(e);
|
||||
Fl_Group::current(prev_current);} {selected
|
||||
}
|
||||
Fl_Group::current(prev_current);} {}
|
||||
}
|
||||
Function {~Fl_File_Chooser()} {} {
|
||||
code {Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
|
||||
|
|
|
@ -134,9 +134,12 @@ Fl_File_Chooser::count() {
|
|||
for (i = 1, fcount = 0; i <= fileList->size(); i ++)
|
||||
if (fileList->selected(i)) {
|
||||
// See if this file is a directory...
|
||||
filename = (char *)fileList->text(i);
|
||||
// matt: why would we do that? It is perfectly legal to select multiple
|
||||
// directories in a DIR chooser. They are visually selected and value(i)
|
||||
// returns all of them as expected
|
||||
//filename = (char *)fileList->text(i);
|
||||
|
||||
if (filename[strlen(filename) - 1] != '/')
|
||||
//if (filename[strlen(filename) - 1] != '/')
|
||||
fcount ++;
|
||||
}
|
||||
|
||||
|
@ -505,8 +508,8 @@ Fl_File_Chooser::fileNameCB()
|
|||
first_line; // First matching line
|
||||
const char *file; // File from directory
|
||||
|
||||
|
||||
// puts("fileNameCB()");
|
||||
// printf("Event: %s\n", fl_eventnames[Fl::event()]);
|
||||
|
||||
// Get the filename from the text field...
|
||||
filename = (char *)fileName->value();
|
||||
|
|
|
@ -315,8 +315,9 @@ show_callback(void)
|
|||
|
||||
fc->show();
|
||||
|
||||
while (fc->visible())
|
||||
while (fc->visible()) {
|
||||
Fl::wait();
|
||||
}
|
||||
|
||||
count = fc->count();
|
||||
if (count > 0)
|
||||
|
|
Loading…
Reference in New Issue