diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-08-06 03:17:43 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-08-06 03:17:43 +0000 |
| commit | 28c0d4ffa1ccd9828f00be1c96405484b5e5d681 (patch) | |
| tree | 1d3b2b901ccbfdf6e50168f7ff51dd7954b50c3c /src/fl_symbols.cxx | |
| parent | 7ebaf77cdcbcadb4706c87f1662730a4687caf20 (diff) | |
Symbols are now supported by main label drawing code - @@ to insert a
single @. Currently only 1 symbol per label, at the beginning or end of the
label string, with the remaining text (and image) getting formatted as
usual. The size of the symbol == lines * labelsize, unless there is
no text in which case the size == height of label area.
Fl_Menu_Item::draw() didn't clear the image field in the Fl_Label
structure.
Removed Fl::enable_symbols(), which is now the default.
Dropped FL_IMAGE_LABEL, FL_PIXMAP_LABEL, and FL_BITMAP_LABEL types,
which are no longer needed.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1561 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_symbols.cxx')
| -rw-r--r-- | src/fl_symbols.cxx | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/src/fl_symbols.cxx b/src/fl_symbols.cxx index 71b78d752..f2328594b 100644 --- a/src/fl_symbols.cxx +++ b/src/fl_symbols.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_symbols.cxx,v 1.8.2.3 2001/01/22 15:13:41 easysw Exp $" +// "$Id: fl_symbols.cxx,v 1.8.2.3.2.1 2001/08/06 03:17:43 easysw Exp $" // // Symbol drawing code for the Fast Light Tool Kit (FLTK). // @@ -92,7 +92,7 @@ int fl_add_symbol(const char *name, void (*drawit)(Fl_Color), int scalable) int fl_return_arrow(int x,int y,int w,int h); // provided for back compatability: -int fl_draw_symbol(const char *label,int x,int y,int w,int h,Fl_Color col) { +int fl_draw_symbol(const char *label,int x,int y,int w,int h,Fl_Color col) { const char *p = label; if (*p++ != '@') return 0; fl_init_symbols(); @@ -360,28 +360,6 @@ static void fl_init_symbols(void) { fl_add_symbol("||", draw_doublebar, 1); } -//////////////////////////////////////////////////////////////// - -#include <FL/Fl_Widget.H> - -// this is the labeltype function: -extern void fl_normal_label(const Fl_Label*, int, int, int, int, Fl_Align); -static void fl_symbol_label( - const Fl_Label* o, int x, int y, int w, int h, Fl_Align align) -{ - if (!fl_draw_symbol(o->value, x, y, w, h, (Fl_Color)o->color)) - fl_normal_label(o, x, y, w, h, align); -} - -Fl_Labeltype define_FL_SYMBOL_LABEL() { - Fl::set_labeltype(_FL_SYMBOL_LABEL, fl_symbol_label, 0); - return _FL_SYMBOL_LABEL; -} - -void Fl::enable_symbols() { - Fl::set_labeltype(FL_NORMAL_LABEL, fl_symbol_label, 0); -} - // -// End of "$Id: fl_symbols.cxx,v 1.8.2.3 2001/01/22 15:13:41 easysw Exp $". +// End of "$Id: fl_symbols.cxx,v 1.8.2.3.2.1 2001/08/06 03:17:43 easysw Exp $". // |
