From 58548b781d7c3f0fa6c8c72c63dece888a02ea43 Mon Sep 17 00:00:00 2001 From: Fabien Costantini Date: Sun, 14 Sep 2008 12:45:42 +0000 Subject: Doxygen Documentation WP2 done. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6235 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_File_Chooser2.cxx | 288 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 277 insertions(+), 11 deletions(-) (limited to 'src/Fl_File_Chooser2.cxx') diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index c7d481df4..8447ab080 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -24,6 +24,276 @@ // // http://www.fltk.org/str.php // + +// fabien: ATTENTION: Only Out Of Source Gen. because cxx/H files are autogenerated by fluid. + +/** \class Fl_File_Chooser + The Fl_File_Chooser widget displays a standard file selection + dialog that supports various selection modes. + +
\image html Fl_File_Chooser.jpg
+ +

The Fl_File_Chooser class also exports several static values + that may be used to localize or customize the appearance of all file chooser + dialogs: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MemberDefault value
add_favorites_label"Add to Favorites"
all_files_label"All Files (*)"
custom_filter_label"Custom Filter"
existing_file_label"Please choose an existing file!"
favorites_label"Favorites"
filename_label"Filename:"
filesystems_label"My Computer" (WIN32)
+ "File Systems" (all others)
manage_favorites_label"Manage Favorites"
new_directory_label"New Directory?"
new_directory_tooltip"Create a new directory."
preview_label"Preview"
save_label"Save"
show_label"Show:"
sortfl_numericsort
+ +

The sort member specifies the sort function that is + used when loading the contents of a directory. +*/ + +/** \fn Fl_File_Chooser::Fl_File_Chooser(const char *pathname, const char *pattern, int type, const char *title) + The constructor creates the Fl_File_Chooser dialog pictured + above. The pathname argument can be a directory name or a + complete file name (in which case the corresponding file is highlighted + in the list and in the filename input field.) + +

The pattern argument can be a NULL + string or "*" to list all files, or it can be a + series of descriptions and filter strings separated by tab + characters (\t). The format of filters is either + "Description text (patterns)" or just "patterns". A file chooser + that provides filters for HTML and image files might look like: + +

+ +

The file chooser will automatically add the "All Files (*)" + pattern to the end of the string you pass if you do not provide + one. The first filter in the string is the default filter. + +

See the FLTK documentation on fl_filename_match() + for the kinds of pattern strings that are supported. + +

The type argument can be one of the following: + +

+ +

The title argument is used to set the title bar text for the + Fl_File_Chooser window. +*/ + +/** \fn Fl_File_Chooser::~Fl_File_Chooser() + Destroys the widget and frees all memory used by it.*/ + +/** \fn void Fl_File_Chooser::color(Fl_Color c) + Sets or gets the background color of the Fl_File_Browser list.*/ + +/** \fn Fl_Color Fl_File_Chooser::color() + Sets or gets the background color of the Fl_File_Browser list.*/ + +/** \fn int Fl_File_Chooser::count() + Returns the number of selected files.*/ + +/** \fn void Fl_File_Chooser::directory(const char *pathname) + Sets or gets the current directory.*/ + +/** \fn const char *Fl_File_Chooser::directory() + Sets or gets the current directory.*/ + +/** \fn void Fl_File_Chooser::filter(const char *pattern) + Sets or gets the current filename filter patterns. The filter + patterns use fl_filename_match(). + Multiple patterns can be used by separating them with tabs, like + "*.jpg\t*.png\t*.gif\t*". In addition, you can provide + human-readable labels with the patterns inside parenthesis, like + "JPEG Files (*.jpg)\tPNG Files (*.png)\tGIF Files (*.gif)\tAll Files (*)". + Use filter(NULL) to show all files. +*/ + +/** \fn const char *Fl_File_Chooser::filter() + See void filter(const char *pattern)*/ + +/** \fn void Fl_File_Chooser::filter_value(int f) + Sets or gets the current filename filter selection.*/ + +/** \fn int Fl_File_Chooser::filter_value() + Sets or gets the current filename filter selection.*/ + +/** \fn void Fl_File_Chooser::hide() + Hides the Fl_File_Chooser window.*/ + +/** \fn void Fl_File_Chooser::iconsize(uchar s) + Sets or gets the size of the icons in the Fl_File_Browser. By + default the icon size is set to 1.5 times the textsize(). +*/ + +/** \fn uchar Fl_File_Chooser::iconsize() + Sets or gets the size of the icons in the Fl_File_Browser. By + default the icon size is set to 1.5 times the textsize(). +*/ + +/** \fn void Fl_File_Chooser::label(const char *l) + Sets or gets the title bar text for the Fl_File_Chooser.*/ + +/** \fn const char *Fl_File_Chooser::label() + Sets or gets the title bar text for the Fl_File_Chooser.*/ + +/** \fn void Fl_File_Chooser::ok_label(const char *l) + Sets or gets the label for the "ok" button in the + Fl_File_Chooser. +*/ + +/** \fn const char *Fl_File_Chooser::ok_label() + Sets or gets the label for the "ok" button in the + Fl_File_Chooser. +*/ + +/** \fn int Fl_File_Chooser::preview() const + Returns the current state of the preview box. */ + +/** \fn void Fl_File_Chooser::rescan() + Reloads the current directory in the Fl_File_Browser.*/ + +/** \fn void Fl_File_Chooser::show() + Shows the Fl_File_Chooser window.*/ + +/** \fn void Fl_File_Chooser::textcolor(Fl_Color c) + Sets or gets the current Fl_File_Browser text color.*/ + +/** \fn Fl_Color Fl_File_Chooser::textcolor() + Sets or gets the current Fl_File_Browser text color.*/ + +/** \fn void Fl_File_Chooser::textfont(Fl_Font f) + Sets or gets the current Fl_File_Browser text font.*/ + +/** \fn Fl_Font Fl_File_Chooser::textfont() + Sets or gets the current Fl_File_Browser text font.*/ + +/** \fn void Fl_File_Chooser::textsize(Fl_Fontsize s) + Sets or gets the current Fl_File_Browser text size.*/ + +/** \fn Fl_Fontsize Fl_File_Chooser::textsize() + Sets or gets the current Fl_File_Browser text size.*/ + +/** \fn void Fl_File_Chooser::type(int t) + Sets or gets the current type of Fl_File_Chooser.*/ + +/** \fn int Fl_File_Chooser::type() + Sets or gets the current type of Fl_File_Chooser.*/ + +/** \fn const char *Fl_File_Chooser::value(const char *pathname) + Sets or gets the current value of the selected file. + +

In the second form, file is a 1-based index into a list of + file names. The number of selected files is returned by + Fl_File_Chooser::count(). + +

This sample code loops through all selected files: +

+  // Get list of filenames user selected from a MULTI chooser
+  for ( int t=1; t<=chooser->count(); t++ ) {
+     const char *filename = chooser->value(t);
+     ..
+  }
+  
+*/ + +/** \fn const char *Fl_File_Chooser::value(int file) + See const char *value(const char *pathname)*/ + +/** \fn const char *Fl_File_Chooser::value() + See const char *value(const char *pathname)*/ + +/** \fn int Fl_File_Chooser::visible() + Returns 1 if the Fl_File_Chooser window is visible.*/ + +/** \fn Fl_Widget* Fl_File_Chooser::add_extra(Fl_Widget*) + Adds extra widget at the bottom of Fl_File_Chooser window. + Returns pointer for previous extra widget or NULL if not set previously. + If argument is NULL only remove previous extra widget.
+ NOTE! Fl_File_Chooser doesn't delete extra widget in destructor! To prevent memory leakage don't forget + delete unused extra widgets by yourself. +*/ + /** \fn int Fl_File_Chooser::shown() + Returns non-zero if the file chooser main window show() has been called (but not hide() + see Fl_Window::shown() + */ + + /** \fn void Fl_File_Chooser::callback(void (*cb)(Fl_File_Chooser *, void *), void *d = 0) + Sets the file chooser callback cb and associated data d */ + + /** \fn void Fl_File_Chooser::user_data(void *d) + Sets the file chooser user data d */ + + /** \fn void * Fl_File_Chooser::user_data() const + Gets the file chooser user data d */ + +// *** END OF OUT OF SOURCE DOC *** + // Contents: // // Fl_File_Chooser::count() - Return the number of selected files. @@ -794,12 +1064,9 @@ Fl_File_Chooser::newdir() } -// -// 'Fl_File_Chooser::preview()' - Enable or disable the preview tile. -// -void -Fl_File_Chooser::preview(int e)// I - 1 = enable preview, 0 = disable preview +/** Enable or disable the preview tile. 1 = enable preview, 0 = disable preview. */ +void Fl_File_Chooser::preview(int e) { previewButton->value(e); prefs_.set("preview", e); @@ -868,12 +1135,11 @@ Fl_File_Chooser::rescan() } // -// 'Fl_File_Chooser::rescan_keep_filename()' - Rescan the current directory -// without clearing the filename, then select the file if it is in the list -// - -void -Fl_File_Chooser::rescan_keep_filename() +/** + Rescan the current directory without clearing the filename, + then select the file if it is in the list +*/ +void Fl_File_Chooser::rescan_keep_filename() { // if no filename was set, this is likely a diretory browser const char *fn = fileName->value(); -- cgit v1.2.3