diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2017-09-11 18:54:10 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2017-09-11 18:54:10 +0000 |
| commit | 322208b8556790bea75efb5a468813c9a49af0d8 (patch) | |
| tree | 5d9ec65d946ef766a06ee8d6c9e72bffd9f2502c /src/Fl_Multi_Label.cxx | |
| parent | 2670903db904c029a181653881d948ab0173e068 (diff) | |
Add missing Fl_Labeltype and Fl_Boxtype definitions.
Some labeltypes and boxtypes were missing a #define for the enum
without a leading underscore and the corresponding setup function
to initialize the internal table of boxtypes and labeltypes, for
instance _FL_MULTI_LABEL. This is now fixed so (hopefully) all boxtypes
and labeltypes can and _should_ be used w/o leading underscore.
Note: if there are still boxtypes or labeltypes that can't be used w/o
leading underscore this should be considered a bug and is to be fixed ASAP.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12443 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Multi_Label.cxx')
| -rw-r--r-- | src/Fl_Multi_Label.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/Fl_Multi_Label.cxx b/src/Fl_Multi_Label.cxx index 56ce602ca..1a9050494 100644 --- a/src/Fl_Multi_Label.cxx +++ b/src/Fl_Multi_Label.cxx @@ -3,7 +3,7 @@ // // Multi-label widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2017 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 @@ -16,8 +16,8 @@ // http://www.fltk.org/str.php // -// Allows two labels to be used on a widget (by having one of them -// be one of these it allows an infinte number!) +// Allows two or more labels to be used on a widget (by having one of them +// be one of these it allows an infinite number!) #include <FL/Fl.H> #include <FL/Fl_Widget.H> @@ -56,14 +56,18 @@ static void multi_measure(const Fl_Label* o, int& w, int& h) { w += W; if (H>h) h = H; } -void Fl_Multi_Label::label(Fl_Widget* o) { +// used by FL_MULTI_LABEL to set up the internal table, see FL/Enumerations.H +Fl_Labeltype fl_define_FL_MULTI_LABEL() { Fl::set_labeltype(_FL_MULTI_LABEL, multi_labeltype, multi_measure); - o->label(_FL_MULTI_LABEL, (const char*)this); + return _FL_MULTI_LABEL; +} + +void Fl_Multi_Label::label(Fl_Widget* o) { + o->label(FL_MULTI_LABEL, (const char*)this); // calls fl_define_FL_MULTI_LABEL() } void Fl_Multi_Label::label(Fl_Menu_Item* o) { - Fl::set_labeltype(_FL_MULTI_LABEL, multi_labeltype, multi_measure); - o->label(_FL_MULTI_LABEL, (const char*)this); + o->label(FL_MULTI_LABEL, (const char*)this); // calls fl_define_FL_MULTI_LABEL() } // |
