summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan MacArthur <imacarthur@gmail.com>2015-02-04 13:12:43 +0000
committerIan MacArthur <imacarthur@gmail.com>2015-02-04 13:12:43 +0000
commite402a64457289864bc1c526827cf05d0ace21f11 (patch)
treefdb08e70b933411a0e91e8eafe6134cda1e0f135
parent84f87addfc5afcb54c5d18bac1c97345afaa0ef7 (diff)
Add some doxygen descriptions for the (previously undocumented) Fl_Multi_Label struct, and make some minor related adjustments to the docs for Fl_Label and Fl_Labeltype.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10553 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--FL/Enumerations.H28
-rw-r--r--FL/Fl_Multi_Label.H42
-rw-r--r--FL/Fl_Widget.H7
3 files changed, 59 insertions, 18 deletions
diff --git a/FL/Enumerations.H b/FL/Enumerations.H
index 28f8d36d8..40cefc6df 100644
--- a/FL/Enumerations.H
+++ b/FL/Enumerations.H
@@ -3,7 +3,7 @@
//
// Enumerations for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2014 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -624,27 +624,27 @@ inline Fl_Boxtype fl_frame(Fl_Boxtype b) {
/**
The labeltype() method sets the type of the label.
-
+
The following standard label types are included:
-
+
\todo The doxygen comments are incomplete, and some labeltypes
- are starting with an underscore. Also, there are three
+ start with an underscore. Also, there are three
external functions undocumented (yet):
- fl_define_FL_SHADOW_LABEL()
- fl_define_FL_ENGRAVED_LABEL()
- fl_define_FL_EMBOSSED_LABEL()
*/
enum Fl_Labeltype { // labeltypes:
- FL_NORMAL_LABEL = 0, ///< draws the text (0)
- FL_NO_LABEL, ///< does nothing
- _FL_SHADOW_LABEL, ///< draws a drop shadow under the text
- _FL_ENGRAVED_LABEL, ///< draws edges as though the text is engraved
- _FL_EMBOSSED_LABEL, ///< draws edges as though the text is raised
- _FL_MULTI_LABEL, ///< ?
- _FL_ICON_LABEL, ///< draws the icon associated with the text
- _FL_IMAGE_LABEL, ///< ?
-
- FL_FREE_LABELTYPE ///< first free labeltype to use for creating own labeltypes
+ FL_NORMAL_LABEL = 0, ///< draws the text (0)
+ FL_NO_LABEL, ///< does nothing
+ _FL_SHADOW_LABEL, ///< draws a drop shadow under the text
+ _FL_ENGRAVED_LABEL, ///< draws edges as though the text is engraved
+ _FL_EMBOSSED_LABEL, ///< draws edges as though the text is raised
+ _FL_MULTI_LABEL, ///< draws a composite label \see Fl_Multi_Label
+ _FL_ICON_LABEL, ///< draws the icon associated with the text
+ _FL_IMAGE_LABEL, ///< the label displays an "icon" based on a Fl_Image
+
+ FL_FREE_LABELTYPE ///< first free labeltype to use for creating own labeltypes
};
/**
diff --git a/FL/Fl_Multi_Label.H b/FL/Fl_Multi_Label.H
index 8f90e5079..63d0ef2f3 100644
--- a/FL/Fl_Multi_Label.H
+++ b/FL/Fl_Multi_Label.H
@@ -3,7 +3,7 @@
//
// Multi-label header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -22,12 +22,52 @@
class Fl_Widget;
struct Fl_Menu_Item;
+/** This struct allows multiple labels to be added to objects that might normally have only one label.
+
+ This struct allows a mixed text and/or graphics label to be applied to an object that
+ would normally only have a single (usually text only) label.
+
+ Most regular FLTK widgets now support the ability to associate both images and text
+ with a label but some special cases, notably the non-widget Fl_Menu_Item objects, do not.
+ Fl_Multi_Label may be used to create menu items that have an icon and text, which would
+ not normally be possible for an Fl_Menu_Item.
+ For example, Fl_Multi_Label is used in the New->Code submenu in fluid, and others.
+
+ Each Fl_Multi_Label holds two elements, labela and labelb; each may hold either a
+ text label (const char*) or an image (Fl_Image*). When displayed, labela is drawn first
+ and labelb is drawn immediately to its right.
+
+ More complex labels might be constructed by setting labelb as another Fl_Multi_Label and
+ thus chaining up a series of label elements.
+
+ When assigning a label element to one of labela or labelb, they should be explicitly cast
+ to (const char*) if they are not of that type already.
+
+ \see Fl_Label and Fl_Labeltype
+ */
struct FL_EXPORT Fl_Multi_Label {
+ /** Holds the "leftmost" of the two elements in the composite label.
+ Typically this would be assigned either a text string (const char*),
+ a (Fl_Image*) or a (Fl_Multi_Label*). */
const char* labela;
+ /** Holds the "rightmost" of the two elements in the composite label.
+ Typically this would be assigned either a text string (const char*),
+ a (Fl_Image*) or a (Fl_Multi_Label*). */
const char* labelb;
+ /** Holds the "type" of labela.
+ Typically this is set to FL_NORMAL_LABEL for a text label,
+ _FL_IMAGE_LABEL for an image (based on Fl_image) or _FL_MULTI_LABEL
+ if "chaining" multiple Fl_Multi_Label elements together. */
uchar typea;
+ /** Holds the "type" of labelb.
+ Typically this is set to FL_NORMAL_LABEL for a text label,
+ _FL_IMAGE_LABEL for an image (based on Fl_image) or _FL_MULTI_LABEL
+ if "chaining" multiple Fl_Multi_Label elements together. */
uchar typeb;
+
+ /** This method is used to associate a Fl_Multi_Label with a Fl_Widget. */
void label(Fl_Widget*);
+ /** This method is used to associate a Fl_Multi_Label with a Fl_Menu_Item. */
void label(Fl_Menu_Item*);
};
diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H
index b70732e3a..de6166f9a 100644
--- a/FL/Fl_Widget.H
+++ b/FL/Fl_Widget.H
@@ -3,7 +3,7 @@
//
// Widget header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2012 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -56,10 +56,11 @@ typedef void (Fl_Callback1)(Fl_Widget*, long);
/** This struct stores all information for a text or mixed graphics label.
- \todo For FLTK 1.3, the Fl_Label type will become a widget by itself. That way
- we will be avoiding a lot of code duplication by handling labels in
+ \todo There is an aspiration that the Fl_Label type will become a widget by itself.
+ That way we will be avoiding a lot of code duplication by handling labels in
a similar fashion to widgets containing text. We also provide an easy
interface for very complex labels, containing html or vector graphics.
+ However, this re-factoring is not in place in this release.
*/
struct FL_EXPORT Fl_Label {
/** label text */