RFC: fluid experts: how to declare an enum with doxygen comments in fluid?

29 views
Skip to first unread message

Greg Ercolano

unread,
Dec 4, 2023, 7:15:18 PM12/4/23
to fltkc...@googlegroups.com
Manolo pointed out that my recent doc modifications to Fl_File_Chooser's
enum needs to be made to the .fl file, not the .h/.cxx files.

The enum in question is currently declared within fluid as a one-liner enum.

How can I define something like this:

class FL_EXPORT Fl_File_Chooser {
public:
  /**
    \enum Type
    Determines the type of file chooser presented to the user.
  */
  enum Type {
    SINGLE    = 0, ///< Select a single, existing file.
    MULTI     = 1, ///< Select one or more existing files.
    CREATE    = 2, ///< When used alone, select a single, existing file or specify a new filename.
                   ///< Can be combined with DIRECTORY (e.g. CREATE|DIRECTORY) to have the same
                   ///< effect for directories.
    DIRECTORY = 4  ///< Select a single, existing directory. Can be combined with CREATE.
  };

..within fluid?

Currently the enum is defined as a one liner "Declaration".

Apparently I need a way to drop a blob of code into the class without it being
associated with a function/method, but not sure how to do it. I guess I could
make multiple declarations for each line in the code, but that sames kinda hacky.

New>Code>Code|CodeBlock won't work unless I associate it with a function,
which is not the case here.


melcher....@googlemail.com

unread,
Dec 5, 2023, 5:15:09 AM12/5/23
to fltk.coredev
Create a declaration in your class, make it private so it only shows up in your header file, and enter the line like this:
"enum Test { TOAST = 0; ///< important^JJAM = 1; ///< less important^J};"
Where the ^J characters are created by pressing Ctrl-J on your keyboard, generating a newline character in your code files.

I will check for dialogs where it makes sense to allow multiline input.

ercola...@gmail.com

unread,
Dec 6, 2023, 3:28:54 PM12/6/23
to fltk.coredev
On Tuesday, December 5, 2023 at 2:15:09 AM UTC-8 Matt wrote:
Create a declaration in your class, make it private so it only shows up in your header file..
..I will check for dialogs where it makes sense to allow multiline input.

Great -- your recent modifications to fluid's New>Code>Declaration dialog from being single-line-only
to multi-line makes for a good solution.

Thanks!
Reply all
Reply to author
Forward
0 new messages