summaryrefslogtreecommitdiff
path: root/documentation
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-05-02 14:31:10 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-05-02 14:31:10 +0000
commitae0a956f2e7ad36f5aab55aa030d6a0d9a82d97b (patch)
tree004bc1a77a3c83b06ffba425decb8f6baa8c0d3c /documentation
parent47e7de17bc515581d85a6f1d57341d0ce14131ad (diff)
Add sort function as optional argument to Fl_File_Browser::load().
Add docos for sort functions and changes to fl_filename_list() and Fl_File_Browser::load(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2176 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'documentation')
-rw-r--r--documentation/Fl_File_Browser.html5
-rw-r--r--documentation/functions.html36
2 files changed, 36 insertions, 5 deletions
diff --git a/documentation/Fl_File_Browser.html b/documentation/Fl_File_Browser.html
index 6137bdddc..82447904a 100644
--- a/documentation/Fl_File_Browser.html
+++ b/documentation/Fl_File_Browser.html
@@ -69,10 +69,13 @@ int filetype() const</A></H4>
files and directories are shown. Otherwise only directories are
shown.
-<H4><A NAME="Fl_File_Browser.load">int load(const char *directory)</A></H4>
+<H4><A NAME="Fl_File_Browser.load">int load(const char *directory, Fl_File_Sort_F *sort = fl_numeric_sort)</A></H4>
<P>Loads the specified directory into the browser. If icons have been
loaded then the correct icon is associated with each file in the list.
+<P>The <tt>sort</tt> argument specifies a sort function to be used with
+<A HREF="functions.html#fl_filename_list"><tt>fl_filename_list()</tt></A>.
+
</BODY>
</HTML>
diff --git a/documentation/functions.html b/documentation/functions.html
index 24d42a23d..f35a31fbe 100644
--- a/documentation/functions.html
+++ b/documentation/functions.html
@@ -579,7 +579,7 @@ int fl_filename_isdir(const char *f);
<H3>Prototype</H3>
<UL><PRE>
-int fl_filename_list(const char *d, dirent ***list);
+int fl_filename_list(const char *d, dirent ***list, Fl_File_Sort_F *sort = fl_numericsort);
</PRE></UL>
<H3>Description</H3>
@@ -595,9 +595,37 @@ pointer to the array is returned in <tt>*list</tt>. The number
of entries is given as a return value. If there is an error
reading the directory a number less than zero is returned, and
<tt>errno</tt> has the reason; <tt>errno</tt> does not work
-under WIN32. The files are sorted in &quot;alphanumeric&quot;
-order, where an attempt is made to put unpadded numbers in
-consecutive order.
+under WIN32.
+
+<P>The <tt>sort</tt> argument specifies a sort function to be used
+when on the array of filenames. The following standard sort functions
+are provided with FLTK:
+
+<UL>
+
+ <LI><TT>fl_alphasort</tt> - The files are sorted in
+ ascending alphabetical order; upper- and lowercase
+ letters are compared according to their ASCII ordering -
+ uppercase before lowercase.
+
+ <LI><TT>fl_casealphasort</tt> - The files are sorted in
+ ascending alphabetical order; upper- and lowercase
+ letters are compared equally - case is not significant.
+
+ <LI><TT>fl_casenumericsort</TT> - The files are sorted
+ in ascending &quot;alphanumeric&quot; order, where an
+ attempt is made to put unpadded numbers in consecutive
+ order; upper- and lowercase letters are compared equally
+ - case is not significant.
+
+ <LI><TT>fl_numericsort</TT> - The files are sorted in
+ ascending &quot;alphanumeric&quot; order, where an
+ attempt is made to put unpadded numbers in consecutive
+ order; upper- and lowercase letters are compared
+ according to their ASCII ordering - uppercase before
+ lowercase.
+
+</UL>
<P>You can free the returned list of files with the following
code: