Add "shown()" method to Fl_File_Chooser.
Use "while shown" instead of "while visible" in chooser functions, since a desktop switch will make FLTK think the window is not visible and prematurely return whatever file you have selected. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1849 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
4ef0817b83
commit
6c3a9ec36a
4
CHANGES
4
CHANGES
@ -1,5 +1,9 @@
|
|||||||
CHANGES IN FLTK 1.1.0b8
|
CHANGES IN FLTK 1.1.0b8
|
||||||
|
|
||||||
|
- The Fl_File_Chooser widget did not provide a shown()
|
||||||
|
method, and fl_file_chooser() and fl_dir_chooser() did
|
||||||
|
not wait on shown(); this would cause them to return
|
||||||
|
prematurely if you switched desktops/workspaces.
|
||||||
- Cosmetic changes to plastic boxtypes. Now look much
|
- Cosmetic changes to plastic boxtypes. Now look much
|
||||||
better for large areas and the sides now have a much
|
better for large areas and the sides now have a much
|
||||||
greater "3D" feeling to them.
|
greater "3D" feeling to them.
|
||||||
|
@ -68,6 +68,7 @@ public:
|
|||||||
const char * label();
|
const char * label();
|
||||||
void rescan();
|
void rescan();
|
||||||
void show();
|
void show();
|
||||||
|
int shown();
|
||||||
void textcolor(Fl_Color c);
|
void textcolor(Fl_Color c);
|
||||||
Fl_Color textcolor();
|
Fl_Color textcolor();
|
||||||
void textfont(uchar f);
|
void textfont(uchar f);
|
||||||
|
@ -213,6 +213,10 @@ void Fl_File_Chooser::show() {
|
|||||||
fileList->deselect();
|
fileList->deselect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Fl_File_Chooser::shown() {
|
||||||
|
return window->shown();
|
||||||
|
}
|
||||||
|
|
||||||
void Fl_File_Chooser::textcolor(Fl_Color c) {
|
void Fl_File_Chooser::textcolor(Fl_Color c) {
|
||||||
fileList->textcolor(c);
|
fileList->textcolor(c);
|
||||||
}
|
}
|
||||||
|
@ -89,8 +89,7 @@ fileList->filter(p);
|
|||||||
type(t);
|
type(t);
|
||||||
value(d);
|
value(d);
|
||||||
callback_ = 0;
|
callback_ = 0;
|
||||||
data_ = 0;} {selected
|
data_ = 0;} {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
decl {void (*callback_)(Fl_File_Chooser*, void *);} {}
|
decl {void (*callback_)(Fl_File_Chooser*, void *);} {}
|
||||||
decl {void *data_;} {}
|
decl {void *data_;} {}
|
||||||
@ -156,6 +155,11 @@ rescan();} {}
|
|||||||
code {window->show();
|
code {window->show();
|
||||||
fileList->deselect();} {}
|
fileList->deselect();} {}
|
||||||
}
|
}
|
||||||
|
Function {shown()} {return_type int
|
||||||
|
} {
|
||||||
|
code {return window->shown();} {selected
|
||||||
|
}
|
||||||
|
}
|
||||||
Function {textcolor(Fl_Color c)} {return_type void
|
Function {textcolor(Fl_Color c)} {return_type void
|
||||||
} {
|
} {
|
||||||
code {fileList->textcolor(c);} {}
|
code {fileList->textcolor(c);} {}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: fl_file_dir.cxx,v 1.1.2.3 2001/11/26 00:15:06 easysw Exp $"
|
// "$Id: fl_file_dir.cxx,v 1.1.2.4 2001/12/15 15:20:54 easysw Exp $"
|
||||||
//
|
//
|
||||||
// File chooser widget for the Fast Light Tool Kit (FLTK).
|
// File chooser widget for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@ -61,7 +61,7 @@ char* fl_file_chooser(const char* message, const char* pat, const char* fname)
|
|||||||
|
|
||||||
fc->show();
|
fc->show();
|
||||||
|
|
||||||
while (fc->visible())
|
while (fc->shown())
|
||||||
Fl::wait();
|
Fl::wait();
|
||||||
|
|
||||||
if (fc->value()) {
|
if (fc->value()) {
|
||||||
@ -91,7 +91,7 @@ char* fl_dir_chooser(const char* message, const char* fname)
|
|||||||
|
|
||||||
fc->show();
|
fc->show();
|
||||||
|
|
||||||
while (fc->visible())
|
while (fc->shown())
|
||||||
Fl::wait();
|
Fl::wait();
|
||||||
|
|
||||||
if (fc->value()) {
|
if (fc->value()) {
|
||||||
@ -103,5 +103,5 @@ char* fl_dir_chooser(const char* message, const char* fname)
|
|||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: fl_file_dir.cxx,v 1.1.2.3 2001/11/26 00:15:06 easysw Exp $".
|
// End of "$Id: fl_file_dir.cxx,v 1.1.2.4 2001/12/15 15:20:54 easysw Exp $".
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user