added docs for fl_eventnames[] and fl_fontnames[]. (fixes STR#2275)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7156 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Greg Ercolano 2010-02-26 17:25:32 +00:00
parent 1c38efe1a3
commit 0f87d7719b

View File

@ -30,6 +30,26 @@
#ifndef FL_NAMES_H
#define FL_NAMES_H
/** \defgroup fl_events Events handling functions
@{
*/
/**
This is an array of event names you can use to convert event numbers into names.
The array gets defined inline wherever your '\#include <FL/names.h>' appears.
\b Example:
\code
#include <FL/names.h> // array will be defined here
// MyWidget's event handler
int MyWidget::handle(int e) {
printf("Event was %s (%d)\n", fl_eventnames[e], e);
/* ..resulting output might be e.g. "Event was FL_PUSH (1)".. */
[..]
}
\endcode
*/
const char * const fl_eventnames[] =
{
"FL_NO_EVENT",
@ -58,6 +78,23 @@ const char * const fl_eventnames[] =
"FL_DND_RELEASE",
};
/**
This is an array of font names you can use to convert font numbers into names.
The array gets defined inline wherever your '\#include &lt;FL/names.h&gt;' appears.
\b Example:
\code
#include <FL/names.h> // array will be defined here
int MyWidget::my_callback(Fl_Widget *w, void*) {
int fnum = w->labelfont();
// Resulting output might be e.g. "Label's font is FL_HELVETICA (0)"
printf("Label's font is %s (%d)\n", fl_fontnames[fnum], fnum);
/* ..resulting output might be e.g. "Label's font is FL_HELVETICA (0)".. */
[..]
}
\endcode
*/
const char * const fl_fontnames[] =
{
"FL_HELVETICA",
@ -78,6 +115,8 @@ const char * const fl_fontnames[] =
"FL_ZAPF_DINGBATS",
};
/** @} */
#endif /* FL_NAMES_H */
//