diff options
| -rw-r--r-- | FL/Fl.H | 19 | ||||
| -rw-r--r-- | FL/Fl_Button.H | 2 | ||||
| -rw-r--r-- | FL/Fl_Color_Chooser.H | 4 | ||||
| -rw-r--r-- | FL/fl_ask.H | 3 | ||||
| -rw-r--r-- | src/Fl_Color_Chooser.cxx | 24 | ||||
| -rw-r--r-- | src/Fl_File_Chooser2.cxx | 15 | ||||
| -rw-r--r-- | src/fl_ask.cxx | 57 | ||||
| -rw-r--r-- | src/fl_file_dir.cxx | 22 | ||||
| -rw-r--r-- | src/fl_shortcut.cxx | 1 |
9 files changed, 109 insertions, 38 deletions
@@ -254,10 +254,9 @@ public: static int damage() {return damage_;} static void redraw(); static void flush(); - /** \defgroup fl_windows Windows handling functions - Windows and standard dialogs handling + /** \addtogroup group_comdlg @{ */ - /** \fn void (*warning)(const char*, ...) + /** FLTK calls this to print a warning message. You can override the behavior by setting the function pointer to your own routine. @@ -272,7 +271,7 @@ public: own routine. <P>Fl::error means there is a recoverable error such as the inability to read an image file. The default implementation - prints the error message to stderr and returns. + shows an error dialog to stderr and returns. */ static void (*error)(const char*, ...); /** @@ -282,13 +281,19 @@ public: <P>Fl::fatal must not return, as FLTK is in an unusable state, however your version may be able to use longjmp or an exception to continue, as long as it does not call FLTK - again. The default implementation prints the error message to - stderr and exits with status 1. + again. The default implementation shows a fatal dialog box + and exits with status 1. */ static void (*fatal)(const char*, ...); + /** @} */ + + /** \defgroup fl_windows Windows handling functions + Windows and standard dialogs handling + @{ */ static Fl_Window* first_window(); static void first_window(Fl_Window*); static Fl_Window* next_window(const Fl_Window*); + /** Returns the top-most modal() window currently shown. This is the most recently @@ -805,7 +810,7 @@ public: /** @} */ #ifdef HAVE_CAIRO - /** \defgroup group_cairo Cairo functions support + /** \defgroup group_cairo Cairo support functions and classes @{ */ public: diff --git a/FL/Fl_Button.H b/FL/Fl_Button.H index 05b1b7585..9aabe5a95 100644 --- a/FL/Fl_Button.H +++ b/FL/Fl_Button.H @@ -43,7 +43,9 @@ are set to zero.*/ #define FL_HIDDEN_BUTTON 3 ///< for Forms compatibility +#ifndef FL_DOXYGEN extern FL_EXPORT int fl_old_shortcut(const char*); +#endif /** \class Fl_Button diff --git a/FL/Fl_Color_Chooser.H b/FL/Fl_Color_Chooser.H index 8a9372f9d..c6fabbc3c 100644 --- a/FL/Fl_Color_Chooser.H +++ b/FL/Fl_Color_Chooser.H @@ -76,6 +76,9 @@ public: #endif // !FL_DOXYGEN +/** \addtogroup group_comdlg + @{ */ + /** \class Fl_Color_Chooser \brief The Fl_Color_Chooser widget provides a standard RGB color chooser. @@ -108,6 +111,7 @@ public: user picks! You can however use fl_rectf() to fill a region with a simulated color using dithering. */ +/** @} */ class FL_EXPORT Fl_Color_Chooser : public Fl_Group { Flcc_HueBox huebox; Flcc_ValueBox valuebox; diff --git a/FL/fl_ask.H b/FL/fl_ask.H index d2c8d540b..dd4f83e1c 100644 --- a/FL/fl_ask.H +++ b/FL/fl_ask.H @@ -31,7 +31,7 @@ # include "Enumerations.H" class Fl_Widget; - +/** Different system beeps available. \relatesalso fl_beep(int) */ enum { FL_BEEP_DEFAULT = 0, FL_BEEP_MESSAGE, @@ -73,7 +73,6 @@ extern FL_EXPORT const char* fl_yes; extern FL_EXPORT const char* fl_ok; extern FL_EXPORT const char* fl_cancel; extern FL_EXPORT const char* fl_close; - #endif // !fl_ask_H // diff --git a/src/Fl_Color_Chooser.cxx b/src/Fl_Color_Chooser.cxx index 6edbb097d..6bfa70cc4 100644 --- a/src/Fl_Color_Chooser.cxx +++ b/src/Fl_Color_Chooser.cxx @@ -526,12 +526,16 @@ static void chooser_cb(Fl_Object* o, void* vv) { extern const char* fl_ok; extern const char* fl_cancel; +/** \addtogroup group_comdlg + @{ */ /** - \relatesalso Fl_Color_Chooser - \fn int fl_color_chooser(const char* name, double& r, double& g, double& b) \brief Pops up a window to let the user pick an arbitrary RGB color. - \param[in] name title label for the window - \param[in] r, g, b color components in the range 0.0 to 1.0. + \image html fl_color_chooser.jpg + \param[in,out] name title label for the window + \param[in,out] r, g, b color components in the range 0.0 to 1.0. + \retval 1 if user confirms the selection + \retval 0 if user cancels the dialog + \relates Fl_Color_Chooser */ int fl_color_chooser(const char* name, double& r, double& g, double& b) { Fl_Window window(215,200,name); @@ -568,11 +572,13 @@ int fl_color_chooser(const char* name, double& r, double& g, double& b) { } /** - \relatesalso Fl_Color_Chooser - \fn int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b) \brief Pops up a window to let the user pick an arbitrary RGB color. - \param[in] name title label for the window - \param[in] r, g, b color components in the range 0 to 255. + \image html fl_color_chooser.jpg + \param[in,out] name title label for the window + \param[in,out] r, g, b color components in the range 0 to 255. + \retval 1 if user confirms the selection + \retval 0 if user cancels the dialog + \relates Fl_Color_Chooser */ int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b) { double dr = r/255.0; @@ -586,7 +592,7 @@ int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b) { } return 0; } - +/** @} */ // // End of "$Id$". // diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index 49de39500..312f92e88 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -26,7 +26,9 @@ // // fabien: ATTENTION: Only Out Of Source Gen. because cxx/H files are autogenerated by fluid. - +/** \defgroup group_comdlg Common Dialogs classes and functions + @{ +*/ /** \class Fl_File_Chooser The Fl_File_Chooser widget displays a standard file selection dialog that supports various selection modes. @@ -110,6 +112,7 @@ can control their appearance and use. For more complex customization, consider copying the FLTK file chooser code and changing it accordingly. */ +/** @} */ /** \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 shown. @@ -284,9 +287,8 @@ Returns pointer for previous extra widget or NULL if not set previously. If argument is NULL only remove previous extra widget. - <I>NOTE! Fl_File_Chooser doesn't delete extra widget in destructor! - To prevent memory leakage don't forget delete unused extra widgets - by yourself.</I> + \note Fl_File_Chooser does \b not delete extra widget in destructor! + To prevent memory leakage, don't forget to delete unused extra widgets */ /** \fn int Fl_File_Chooser::shown() Returns non-zero if the file chooser main window show() has been called (but not hide() @@ -301,7 +303,6 @@ /** \fn void * Fl_File_Chooser::user_data() const Gets the file chooser user data d */ - // *** END OF OUT OF SOURCE DOC *** // Contents: @@ -324,9 +325,9 @@ // Fl_File_Chooser::add_extra() - add extra widget at the bottom, return pointer // to previous extra widget or NULL if none, // If argument is NULL extra widget removed. -// NOTE! file chooser don't delete extra widget in +// NOTE! file chooser does't delete extra widget in // destructor! To prevent memory leakage don't forget -// delete unused extra widgets by yuorself. +// delete unused extra widgets by yourself. // // diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx index b77afce88..530370346 100644 --- a/src/fl_ask.cxx +++ b/src/fl_ask.cxx @@ -228,14 +228,21 @@ static int innards(const char* fmt, va_list ap, return r; } + /** \addtogroup group_comdlg + @{ */ + // pointers you can use to change FLTK to a foreign language: -const char* fl_no = "No"; -const char* fl_yes= "Yes"; -const char* fl_ok = "OK"; -const char* fl_cancel= "Cancel"; -const char* fl_close= "Close"; +const char* fl_no = "No"; ///< string pointer used in common dialogs, you can change it to a foreign language +const char* fl_yes= "Yes"; ///< string pointer used in common dialogs, you can change it to a foreign language +const char* fl_ok = "OK"; ///< string pointer used in common dialogs, you can change it to a foreign language +const char* fl_cancel= "Cancel"; ///< string pointer used in common dialogs, you can change it to a foreign language +const char* fl_close= "Close"; ///< string pointer used in common dialogs, you can change it to a foreign language // fltk functions: + +/** + Emits a system beep message. + */ void fl_beep(int type) { #ifdef WIN32 switch (type) { @@ -281,7 +288,9 @@ void fl_beep(int type) { } #endif // WIN32 } - +/** Shows an information message dialog box + \param fmt can be used as an sprintf-like format and variables for the message text + */ void fl_message(const char *fmt, ...) { va_list ap; @@ -294,6 +303,9 @@ void fl_message(const char *fmt, ...) { iconlabel = "?"; } +/** Shows an alert message dialog box + \param fmt can be used as an sprintf-like format and variables for the message text + */ void fl_alert(const char *fmt, ...) { va_list ap; @@ -305,7 +317,12 @@ void fl_alert(const char *fmt, ...) { va_end(ap); iconlabel = "?"; } - +/** Shows a dialog displaying the \a fmt message, + this dialog features 2 yes/no buttons + \param fmt can be used as an sprintf-like format and variables for the message text + \retval 0 if the no button is selected + \retval 1 if yes is selected + */ int fl_ask(const char *fmt, ...) { va_list ap; @@ -318,6 +335,13 @@ int fl_ask(const char *fmt, ...) { return r; } +/** Shows a dialog displaying the \a fmt message, + this dialog features up to 3 customizable choice buttons + \param fmt can be used as an sprintf-like format and variables for the message text + \retval 0 if the first button with \a b0 text is selected + \retval 1 if the second button with \a b1 text is selected + \retval 2 if the third button with \a b2 text is selected + */ int fl_choice(const char*fmt,const char *b0,const char *b1,const char *b2,...){ va_list ap; @@ -328,7 +352,10 @@ int fl_choice(const char*fmt,const char *b0,const char *b1,const char *b2,...){ va_end(ap); return r; } - +/** Gets the Fl_Box icon container of the current default dialog used in + many common dialogs like fl_message(), fl_alert(), + fl_ask(), fl_choice(), fl_input(), fl_password() +*/ Fl_Widget *fl_message_icon() {makeform(); return icon;} static const char* input_innards(const char* fmt, va_list ap, @@ -346,6 +373,11 @@ static const char* input_innards(const char* fmt, va_list ap, return r ? input->value() : 0; } +/** Shows an input dialog displaying the \a fmt message + \param fmt can be used as an sprintf-like format and variables for the message text + \param defstr defines the default returned string if no text is entered + \return the user string input + */ const char* fl_input(const char *fmt, const char *defstr, ...) { fl_beep(FL_BEEP_QUESTION); @@ -356,6 +388,13 @@ const char* fl_input(const char *fmt, const char *defstr, ...) { return r; } +/** Shows an input dialog displaying the \a fmt message, + like fl_input except the input text is not shown, + '*' characters are displayed instead + \param fmt can be used as an sprintf-like format and variables for the message text + \param defstr defines the default returned string if no text is entered + \return the user string input + */ const char *fl_password(const char *fmt, const char *defstr, ...) { fl_beep(FL_BEEP_PASSWORD); @@ -366,6 +405,8 @@ const char *fl_password(const char *fmt, const char *defstr, ...) { return r; } +/** @} */ + // // End of "$Id$". // diff --git a/src/fl_file_dir.cxx b/src/fl_file_dir.cxx index 093a915cd..0db2d3453 100644 --- a/src/fl_file_dir.cxx +++ b/src/fl_file_dir.cxx @@ -42,6 +42,8 @@ static void callback(Fl_File_Chooser *, void*) { (*current_callback)(fc->value()); } +/** \addtogroup group_comdlg + @{ */ /** \relatesalso Fl_File_Chooser Set the file chooser callback @@ -59,8 +61,15 @@ void fl_file_chooser_ok_label(const char *l) { else current_label = fl_ok; } -/** \relatesalso Fl_File_Chooser - Show a file chooser dialog and get a filename. +/** \relates Fl_File_Chooser + Shows a file chooser dialog and get a filename. + \image html Fl_File_Chooser.jpg + \param message text in title bar + \param pat filename pattern filter + \param fname initial/default filename selection + \param relative 0 for absolute path name, relative path name otherwise + \return the user selected filename, in absolute or relative format + or NULL if user cancels */ char * // O - Filename or NULL fl_file_chooser(const char *message, // I - Message in titlebar @@ -136,8 +145,12 @@ fl_file_chooser(const char *message, // I - Message in titlebar else return 0; } -/** \relatesalso Fl_File_Chooser - Show a file chooser dialog and get a directory. +/** \relates Fl_File_Chooser + Shows a file chooser dialog and get a directory. + \param[in] message title bar text + \param[in] fname initial/default directory name + \param[in] relative 0 for absolute path return, relative otherwise + \return the directory path string choosen by the user or NULL if user cancels */ char * // O - Directory or NULL @@ -172,6 +185,7 @@ fl_dir_chooser(const char *message, // I - Message for titlebar } else if (fc->value()) return (char *)fc->value(); else return 0; } +/** @} */ // diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx index 4f67464ab..88624e96c 100644 --- a/src/fl_shortcut.cxx +++ b/src/fl_shortcut.cxx @@ -204,7 +204,6 @@ const char * fl_shortcut_label(int shortcut) { #include <stdlib.h> /** Emulation of XForms named shortcuts. - \todo Why does doxygen display fl_old_shortcut() on Fl_Button page? */ int fl_old_shortcut(const char* s) { if (!s || !*s) return 0; |
