diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-07-01 18:03:10 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-07-06 20:28:20 +0200 |
| commit | f09e17c3c564e8310125a10c03397cbf473ff643 (patch) | |
| tree | 8d0fd4a28e3686c33aaa140d07ddba26ab28bdc2 /src/fl_file_dir.cxx | |
| parent | b0e0c355edaa2e23148cb0260ada907aec930f05 (diff) | |
Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files
- update .fl files and generated files accordingly
- replace 'http://www.fltk.org' URL's with 'https://...'
- replace bug report URL 'str.php' with 'bugs.php'
- remove trailing whitespace
- fix other whitespace errors flagged by Git
- add and/or fix missing or wrong standard headers
- convert tabs to spaces in all source files
The only relevant code changes are in the fluid/ folder where
some .fl files and other source files were used to generate
the '$Id' headers and footers.
Diffstat (limited to 'src/fl_file_dir.cxx')
| -rw-r--r-- | src/fl_file_dir.cxx | 81 |
1 files changed, 37 insertions, 44 deletions
diff --git a/src/fl_file_dir.cxx b/src/fl_file_dir.cxx index ab16c55d7..dc740f9e5 100644 --- a/src/fl_file_dir.cxx +++ b/src/fl_file_dir.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // File chooser widget for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2015 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include "flstring.h" @@ -22,9 +20,9 @@ #include <FL/fl_ask.H> -static Fl_File_Chooser *fc = (Fl_File_Chooser *)0; -static void (*current_callback)(const char*) = 0; -static const char *current_label = fl_ok; +static Fl_File_Chooser *fc = (Fl_File_Chooser *)0; +static void (*current_callback)(const char*) = 0; +static const char *current_label = fl_ok; // Do a file chooser callback... @@ -49,10 +47,10 @@ static void popup(Fl_File_Chooser *filechooser) { } -/** \addtogroup group_comdlg +/** \addtogroup group_comdlg @{ */ -/** +/** Set the file chooser callback \note \#include <FL/Fl_File_Chooser.H> \relates Fl_File_Chooser @@ -62,7 +60,7 @@ void fl_file_chooser_callback(void (*cb)(const char*)) { } -/** +/** Set the "OK" button label \note \#include <FL/Fl_File_Chooser.H> \relates Fl_File_Chooser @@ -72,27 +70,27 @@ void fl_file_chooser_ok_label(const char *l) { else current_label = fl_ok; } -/** +/** Shows a file chooser dialog and gets a filename. \note \#include <FL/Fl_File_Chooser.H> - \image html Fl_File_Chooser.jpg + \image html Fl_File_Chooser.jpg \image latex Fl_File_Chooser.jpg "Fl_File_Chooser" width=12cm \param[in] message text in title bar \param[in] pat filename pattern filter \param[in] fname initial/default filename selection \param[in] relative 0 for absolute path name, relative path name otherwise - \return the user selected filename, in absolute or relative format + \return the user selected filename, in absolute or relative format or NULL if user cancels \relates Fl_File_Chooser */ -char * // O - Filename or NULL -fl_file_chooser(const char *message, // I - Message in titlebar - const char *pat, // I - Filename pattern - const char *fname, // I - Initial filename selection - int relative) { // I - 0 for absolute path - static char retname[FL_PATH_MAX]; // Returned filename +char * // O - Filename or NULL +fl_file_chooser(const char *message, // I - Message in titlebar + const char *pat, // I - Filename pattern + const char *fname, // I - Initial filename selection + int relative) { // I - 0 for absolute path + static char retname[FL_PATH_MAX]; // Returned filename if (!fc) { if (!fname || !*fname) fname = "."; @@ -114,29 +112,29 @@ fl_file_chooser(const char *message, // I - Message in titlebar if (!fname) { // null pointer reuses same filename if pattern didn't change if (!same_pattern && fc->value()) { - // if pattern is different, remove name but leave old directory: - strlcpy(retname, fc->value(), sizeof(retname)); + // if pattern is different, remove name but leave old directory: + strlcpy(retname, fc->value(), sizeof(retname)); - char *p = strrchr(retname, '/'); + char *p = strrchr(retname, '/'); if (p) { - // If the filename is "/foo", then the directory will be "/", not - // ""... - if (p == retname) - retname[1] = '\0'; - else - *p = '\0'; - } - // Set the directory... - fc->value(retname); + // If the filename is "/foo", then the directory will be "/", not + // ""... + if (p == retname) + retname[1] = '\0'; + else + *p = '\0'; + } + // Set the directory... + fc->value(retname); } else { // re-use the previously selected name } } else if (!*fname) { // empty filename reuses directory with empty name const char *fcv = fc->value(); - if (fcv) + if (fcv) strlcpy(retname, fc->value(), sizeof(retname)); - else + else *retname = 0; const char *n = fl_filename_name(retname); if (n) *((char*)n) = 0; @@ -165,12 +163,12 @@ fl_file_chooser(const char *message, // I - Message in titlebar \return the directory path string chosen by the user or NULL if user cancels \relates Fl_File_Chooser */ -char * // O - Directory or NULL -fl_dir_chooser(const char *message, // I - Message for titlebar - const char *fname, // I - Initial directory name - int relative) // I - 0 for absolute +char * // O - Directory or NULL +fl_dir_chooser(const char *message, // I - Message for titlebar + const char *fname, // I - Initial directory name + int relative) // I - 0 for absolute { - static char retname[FL_PATH_MAX]; // Returned directory name + static char retname[FL_PATH_MAX]; // Returned directory name if (!fc) { if (!fname || !*fname) fname = "."; @@ -195,8 +193,3 @@ fl_dir_chooser(const char *message, // I - Message for titlebar else return 0; } /** @} */ - - -// -// End of "$Id$". -// |
