summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-07-23 11:40:55 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-07-23 11:40:55 +0000
commita84f6826475f491045d79198db94d2efb7ad8cee (patch)
treef6d955aa36eeba44b00e59b5ba4a2d42fef2fa0b
parent35b28fafd1a9b4d9bf67d3b01cfc1da9fad59f8c (diff)
In order to make the rescan effect of Fl_File_Chooser::show() more intuitive, I added a Fl::flush() to show the dialog immediatly, and changed the mouse cursor to a WAIT cursor while the rescan happens. On local Harddrives, the difference is almost invisible, but on remote connections, it should become clearer to the user what the file chooser is currently doing. (STR #827)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4447 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_File_Chooser.cxx5
-rw-r--r--src/Fl_File_Chooser.fl20
2 files changed, 16 insertions, 9 deletions
diff --git a/src/Fl_File_Chooser.cxx b/src/Fl_File_Chooser.cxx
index b3fb06d53..f2acdb33b 100644
--- a/src/Fl_File_Chooser.cxx
+++ b/src/Fl_File_Chooser.cxx
@@ -28,6 +28,7 @@
// generated by Fast Light User Interface Designer (fluid) version 1.0107
#include "../FL/Fl_File_Chooser.H"
+#include <FL/fl_draw.h>
void Fl_File_Chooser::cb_window_i(Fl_Double_Window*, void*) {
fileName->value("");
@@ -361,7 +362,6 @@ int w, h;
okButton->measure_label(w, h);
okButton->resize(cancelButton->x() - 50 - w, cancelButton->y(),
w + 40, 25);
-okButton->parent()->init_sizes();
}
const char * Fl_File_Chooser::ok_label() {
@@ -371,7 +371,10 @@ const char * Fl_File_Chooser::ok_label() {
void Fl_File_Chooser::show() {
window->hotspot(fileList);
window->show();
+Fl::flush();
+fl_cursor(FL_CURSOR_WAIT);
rescan();
+fl_cursor(FL_CURSOR_DEFAULT);
fileName->take_focus();
}
diff --git a/src/Fl_File_Chooser.fl b/src/Fl_File_Chooser.fl
index cccbbd3e4..f605ae0de 100644
--- a/src/Fl_File_Chooser.fl
+++ b/src/Fl_File_Chooser.fl
@@ -31,6 +31,9 @@ comment {//
} {in_source in_header
}
+decl {\#include <FL/fl_draw.h>} {selected
+}
+
class FL_EXPORT Fl_File_Chooser {open
} {
decl {enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 };} {public
@@ -51,15 +54,14 @@ class FL_EXPORT Fl_File_Chooser {open
decl {void showChoiceCB();} {}
decl {void update_favorites();} {}
decl {void update_preview();} {}
- Function {Fl_File_Chooser(const char *d, const char *p, int t, const char *title)} {open
- } {
+ Function {Fl_File_Chooser(const char *d, const char *p, int t, const char *title)} {} {
Fl_Window window {
label {Choose File}
callback {fileName->value("");
fileList->deselect();
Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
window->hide();} open
- private xywh {153 80 490 380} type Double resizable
+ private xywh {387 242 490 380} type Double resizable
code0 {if (title) window->label(title);}
code1 {\#include <stdio.h>}
code2 {\#include <stdlib.h>}
@@ -158,7 +160,7 @@ window->hide();}
}
Fl_Window favWindow {
label {Manage Favorites}
- private xywh {580 44 355 150} type Double resizable
+ private xywh {580 50 355 150} type Double resizable
code0 {favWindow->label(manage_favorites_label);} modal visible
} {
Fl_File_Browser favList {
@@ -218,8 +220,7 @@ int e;
prefs_.get("preview", e, 1);
preview(e);} {}
}
- Function {~Fl_File_Chooser()} {open
- } {
+ Function {~Fl_File_Chooser()} {} {
code {Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
delete window;
delete favWindow;} {}
@@ -279,7 +280,7 @@ showChoiceCB();} {}
} {
code {return (window->label());} {}
}
- Function {ok_label(const char *l)} {open return_type void
+ Function {ok_label(const char *l)} {return_type void
} {
code {okButton->label(l);
int w, h;
@@ -301,7 +302,10 @@ okButton->resize(cancelButton->x() - 50 - w, cancelButton->y(),
} {
code {window->hotspot(fileList);
window->show();
+Fl::flush();
+fl_cursor(FL_CURSOR_WAIT);
rescan();
+fl_cursor(FL_CURSOR_DEFAULT);
fileName->take_focus();} {}
}
Function {shown()} {return_type int
@@ -399,7 +403,7 @@ decl {FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const
decl {FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));} {public
}
-decl {FL_EXPORT void fl_file_chooser_ok_label(const char*l);} {selected public
+decl {FL_EXPORT void fl_file_chooser_ok_label(const char*l);} {public
}
comment {