diff options
Diffstat (limited to 'src')
| -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 |
5 files changed, 90 insertions, 29 deletions
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; |
