summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2010-02-26 17:25:32 +0000
committerGreg Ercolano <erco@seriss.com>2010-02-26 17:25:32 +0000
commit0f87d7719b6510e2596703453da0bfb19d335be8 (patch)
treec424bec3523aca2ab65dc0729c83e1f10ddad48b
parent1c38efe1a35b4c89178330234e3fb5ec1a561be9 (diff)
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
-rw-r--r--FL/names.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/FL/names.h b/FL/names.h
index a1870e2ea..1c3cca4b0 100644
--- a/FL/names.h
+++ b/FL/names.h
@@ -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 &lt;FL/names.h&gt;' 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 */
//