FLTK logo

File Chooser Design Contest

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

This contest was finished on May 31, 2002

The winner was Mike Sweet's file chooser with 74% of all votes.
View the results

Received Entries

The following entries have been received:

Matthias Melcher

Download .tar.gz | Download .zip

I added two features to the existing file browser

  1. I extended the pattern function to contain multiple pattern (a la Windows) This is source code compatible to 1.1.0.

    To use this feature, simply provide a tab delimited list of description/pattern pairs instead of one pattern (the single pattern method continues to work, as does the custom pattern button - try it :-).

    char patternList[] =
    "Source Code (.c;.C;.cxx;.cpp;.h;.H)\t*.{c,C,cxx,cpp,h,H}\t"
    "C++ Source Files only(.cxx;.cpp)\t*.{cxx,cpp}\t"
    "Header Files only (.h;.H)\t*.{h,H}\t"
    "Fluid Files (.fl)\t*.fl";
    	
  2. I added a shortcut button (a la Mac OS X, top right) which pops up a menu with all mounted drives (home, desktop, etc. to be added). It also provides menu items to add and delete the current file/directory to the shortcuts (uses Fl_Preferences, up to 10 entries). Using a button for a pulldown is disputable...

Michael Sweet

Download .tar.gz | Download .zip (last updated 5/27/2002)

My new file chooser simplifies the dialog while providing several key enhancements:

  1. Like Matthias's file chooser, you can now provide multiple patterns, although I chose to put the patterns in parenthesis and use a tab to separate each pattern, e.g.:
    char pattern[] = "Image Files (*.{bmp,gif,jpg,png,xbm,xpm})\t"
                     "Web Files (*.{htm,html,php})\t"
    		 "All Files (*)";
    	

    If no "*" pattern is provided, then an entry for "All Files (*)" is automatically added.

  2. The new file chooser provides a built-in preview box which can be toggled by the programmer or user. The preview box first tries to load the selected file using Fl_Shared_Image::get(), and if that fails it checks if the first 2048 bytes are printable text. Apps can register (preview) image loading functions to provide file previews. The sample app includes code to generate previews of PS and PDF files using Ghostscript...
  3. The favorites button shows up to 100 user-saved favorite directories, the user's home directory, and a filesystems item.
  4. A simple dialog is provided for managing saved directories.
  5. Shortcut keys are provided for adding a directory to the favorites list (Alt+a), managing the favorites list (Alt+m), showing the filesystem list (Alt+f), going to the home directory (Alt+h), and going to any of the first 10 favorites (Alt+0 to Alt+9).
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.