summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-05-02 15:24:34 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-05-02 15:24:34 +0000
commitb010bc55c4ed22e8cbede27d5fe56b0ea843aef2 (patch)
treedc767f9aef3a543a13231da1769edf173a03d9d4
parente80eb3ebeb1db95d10b044b0519b166b5143b1ea (diff)
Add sort function to file chooser.
Document sort function and label strings for chooser. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2179 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--FL/Fl_File_Chooser.H1
-rw-r--r--documentation/Fl_File_Chooser.html28
-rw-r--r--src/Fl_File_Chooser.cxx3
-rw-r--r--src/Fl_File_Chooser.fl4
-rw-r--r--src/Fl_File_Chooser2.cxx7
5 files changed, 39 insertions, 4 deletions
diff --git a/FL/Fl_File_Chooser.H b/FL/Fl_File_Chooser.H
index b778587a1..18b9a4473 100644
--- a/FL/Fl_File_Chooser.H
+++ b/FL/Fl_File_Chooser.H
@@ -83,6 +83,7 @@ public:
static const char *directory_label;
static const char *filename_label;
static const char *filter_label;
+ static Fl_File_Sort_F *sort;
};
extern FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0);
extern FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);
diff --git a/documentation/Fl_File_Chooser.html b/documentation/Fl_File_Chooser.html
index 0e1db01af..c349ea5bd 100644
--- a/documentation/Fl_File_Chooser.html
+++ b/documentation/Fl_File_Chooser.html
@@ -27,6 +27,34 @@ dialog that supports various selection modes.
<CENTER><IMG SRC="filechooser.gif" WIDTH="397" HEIGHT="322" ALT="Fl_File_Chooser widget"></CENTER>
+<P>The <CODE>Fl_File_Chooser</CODE> class also exports several static values
+that may be used to localize or customize the appearance of all file chooser
+dialogs:
+
+<UL>
+
+ <LI><TT>const char
+ *Fl_File_Chooser::directory_label</TT> <P>The label used
+ for the directory chooser at the top of the file
+ chooser. The default value is "Directory:".</P></LI>
+
+ <LI><TT>const char *Fl_File_Chooser::filename_label</TT>
+ <P>The label used for the filename field at the bottom
+ of the file chooser. The default value is
+ "Filename:".</P></LI>
+
+ <LI><TT>const char *Fl_File_Chooser::filter_label</TT>
+ <P>The label used for the filter text field. The default
+ value is "Filter:".</P></LI>
+
+ <LI><TT>Fl_File_Sort_F *Fl_File_Chooser::sort</TT>
+ <P>The sort function used when loading the contents of a
+ directory. The default value is <TT>fl_numericsort</TT>.
+ Other values are described in the reference page for <A
+ HREF="functions.html#fl_filename_list"><TT>fl_filename_list</TT></A></P></LI>
+
+</UL>
+
<H3>Methods</H3>
<UL>
diff --git a/src/Fl_File_Chooser.cxx b/src/Fl_File_Chooser.cxx
index eaebca5bf..932690caf 100644
--- a/src/Fl_File_Chooser.cxx
+++ b/src/Fl_File_Chooser.cxx
@@ -265,3 +265,6 @@ int Fl_File_Chooser::type() {
int Fl_File_Chooser::visible() {
return window->visible();
}
+FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0);
+FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);
+FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));
diff --git a/src/Fl_File_Chooser.fl b/src/Fl_File_Chooser.fl
index 56f9175c9..6be09a616 100644
--- a/src/Fl_File_Chooser.fl
+++ b/src/Fl_File_Chooser.fl
@@ -215,12 +215,14 @@ else
}
decl {static const char *filter_label;} {public
}
+ decl {static Fl_File_Sort_F *sort;} {selected public
+ }
}
decl {FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0);} {public
}
-decl {FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);} {selected public
+decl {FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);} {public
}
decl {FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));} {public
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index 9a08dbb01..f3efbdcb0 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.11 2002/05/01 12:41:21 easysw Exp $"
+// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.12 2002/05/02 15:24:34 easysw Exp $"
//
// More Fl_File_Chooser routines.
//
@@ -68,6 +68,7 @@
const char *Fl_File_Chooser::directory_label = "Directory:";
const char *Fl_File_Chooser::filename_label = "Filename:";
const char *Fl_File_Chooser::filter_label = "New Filter?";
+Fl_File_Sort_F *Fl_File_Chooser::sort = fl_numericsort;
//
@@ -427,7 +428,7 @@ Fl_File_Chooser::rescan()
okButton->deactivate();
// Build the file list...
- fileList->load(directory_);
+ fileList->load(directory_, sort);
}
@@ -701,5 +702,5 @@ Fl_File_Chooser::fileNameCB()
//
-// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.11 2002/05/01 12:41:21 easysw Exp $".
+// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.12 2002/05/02 15:24:34 easysw Exp $".
//