mirror of
https://github.com/fltk/fltk.git
synced 2026-06-05 16:12:13 +08:00
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
This commit is contained in:
@@ -47,8 +47,7 @@ TODO - Documentation updates.
|
|||||||
- Updated configure stuff to support shared libraries
|
- Updated configure stuff to support shared libraries
|
||||||
under AIX (link to -lfltk_s)
|
under AIX (link to -lfltk_s)
|
||||||
|
|
||||||
TODO - Symbol labels can now contain regular text and
|
- Symbol labels can now contain regular text.
|
||||||
Fl_Browser font and color controls.
|
|
||||||
|
|
||||||
- FLUID now supports relative filenames for the source
|
- FLUID now supports relative filenames for the source
|
||||||
and header files you generate.
|
and header files you generate.
|
||||||
|
|||||||
+3
-8
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: Enumerations.H,v 1.18.2.14.2.4 2001/08/05 23:58:54 easysw Exp $"
|
// "$Id: Enumerations.H,v 1.18.2.14.2.5 2001/08/06 03:17:43 easysw Exp $"
|
||||||
//
|
//
|
||||||
// Enumerations for the Fast Light Tool Kit (FLTK).
|
// Enumerations for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -195,20 +195,15 @@ inline Fl_Boxtype frame(Fl_Boxtype b) {return (Fl_Boxtype)(b|2);}
|
|||||||
enum Fl_Labeltype { // labeltypes:
|
enum Fl_Labeltype { // labeltypes:
|
||||||
FL_NORMAL_LABEL = 0,
|
FL_NORMAL_LABEL = 0,
|
||||||
FL_NO_LABEL,
|
FL_NO_LABEL,
|
||||||
_FL_SYMBOL_LABEL,
|
|
||||||
_FL_SHADOW_LABEL,
|
_FL_SHADOW_LABEL,
|
||||||
_FL_ENGRAVED_LABEL,
|
_FL_ENGRAVED_LABEL,
|
||||||
_FL_EMBOSSED_LABEL,
|
_FL_EMBOSSED_LABEL,
|
||||||
_FL_BITMAP_LABEL,
|
|
||||||
_FL_PIXMAP_LABEL,
|
|
||||||
_FL_IMAGE_LABEL,
|
|
||||||
_FL_MULTI_LABEL,
|
_FL_MULTI_LABEL,
|
||||||
_FL_ICON_LABEL,
|
_FL_ICON_LABEL,
|
||||||
|
|
||||||
FL_FREE_LABELTYPE
|
FL_FREE_LABELTYPE
|
||||||
};
|
};
|
||||||
extern Fl_Labeltype FL_EXPORT define_FL_SYMBOL_LABEL();
|
#define FL_SYMBOL_LABEL FL_NORMAL_LABEL
|
||||||
#define FL_SYMBOL_LABEL define_FL_SYMBOL_LABEL()
|
|
||||||
extern Fl_Labeltype FL_EXPORT define_FL_SHADOW_LABEL();
|
extern Fl_Labeltype FL_EXPORT define_FL_SHADOW_LABEL();
|
||||||
#define FL_SHADOW_LABEL define_FL_SHADOW_LABEL()
|
#define FL_SHADOW_LABEL define_FL_SHADOW_LABEL()
|
||||||
extern Fl_Labeltype FL_EXPORT define_FL_ENGRAVED_LABEL();
|
extern Fl_Labeltype FL_EXPORT define_FL_ENGRAVED_LABEL();
|
||||||
@@ -369,5 +364,5 @@ enum Fl_Damage {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: Enumerations.H,v 1.18.2.14.2.4 2001/08/05 23:58:54 easysw Exp $".
|
// End of "$Id: Enumerations.H,v 1.18.2.14.2.5 2001/08/06 03:17:43 easysw Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: Fl.H,v 1.8.2.11.2.1 2001/08/02 20:09:25 easysw Exp $"
|
// "$Id: Fl.H,v 1.8.2.11.2.2 2001/08/06 03:17:43 easysw Exp $"
|
||||||
//
|
//
|
||||||
// Main header file for the Fast Light Tool Kit (FLTK).
|
// Main header file for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -187,7 +187,6 @@ public:
|
|||||||
// labeltypes:
|
// labeltypes:
|
||||||
static FL_EXPORT void set_labeltype(Fl_Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*);
|
static FL_EXPORT void set_labeltype(Fl_Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*);
|
||||||
static FL_EXPORT void set_labeltype(Fl_Labeltype, Fl_Labeltype from);
|
static FL_EXPORT void set_labeltype(Fl_Labeltype, Fl_Labeltype from);
|
||||||
static FL_EXPORT void enable_symbols();
|
|
||||||
|
|
||||||
// boxtypes:
|
// boxtypes:
|
||||||
static FL_EXPORT void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F*,uchar,uchar,uchar,uchar);
|
static FL_EXPORT void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F*,uchar,uchar,uchar,uchar);
|
||||||
@@ -218,5 +217,5 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: Fl.H,v 1.8.2.11.2.1 2001/08/02 20:09:25 easysw Exp $".
|
// End of "$Id: Fl.H,v 1.8.2.11.2.2 2001/08/06 03:17:43 easysw Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
+9
-7
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.1 2001/08/04 20:17:10 easysw Exp $"
|
// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.2 2001/08/06 03:17:43 easysw Exp $"
|
||||||
//
|
//
|
||||||
// Menu code for the Fast Light Tool Kit (FLTK).
|
// Menu code for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -123,11 +123,13 @@ int Fl_Menu_Item::measure(int* hp, const Fl_Menu_* m) const {
|
|||||||
void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m,
|
void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m,
|
||||||
int selected) const {
|
int selected) const {
|
||||||
Fl_Label l;
|
Fl_Label l;
|
||||||
l.value = text;
|
l.value = text;
|
||||||
l.type = labeltype_;
|
l.image = 0;
|
||||||
l.font = labelsize_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA);
|
l.deimage = 0;
|
||||||
l.size = labelsize_ ? labelsize_ : m ? m->textsize() : FL_NORMAL_SIZE;
|
l.type = labeltype_;
|
||||||
l.color = labelcolor_ ? labelcolor_ : m ? m->textcolor() : int(FL_BLACK);
|
l.font = labelsize_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA);
|
||||||
|
l.size = labelsize_ ? labelsize_ : m ? m->textsize() : FL_NORMAL_SIZE;
|
||||||
|
l.color = labelcolor_ ? labelcolor_ : m ? m->textcolor() : int(FL_BLACK);
|
||||||
if (!active()) l.color = inactive((Fl_Color)l.color);
|
if (!active()) l.color = inactive((Fl_Color)l.color);
|
||||||
Fl_Color color = m ? m->color() : FL_GRAY;
|
Fl_Color color = m ? m->color() : FL_GRAY;
|
||||||
if (selected) {
|
if (selected) {
|
||||||
@@ -741,5 +743,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.1 2001/08/04 20:17:10 easysw Exp $".
|
// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.2 2001/08/06 03:17:43 easysw Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
+20
-18
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.4 2001/08/05 14:00:15 easysw Exp $"
|
// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.5 2001/08/06 03:17:43 easysw Exp $"
|
||||||
//
|
//
|
||||||
// Base widget class for the Fast Light Tool Kit (FLTK).
|
// Base widget class for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -76,22 +76,24 @@ Fl_Widget::Fl_Widget(int X, int Y, int W, int H, const char* L) {
|
|||||||
|
|
||||||
x_ = X; y_ = Y; w_ = W; h_ = H;
|
x_ = X; y_ = Y; w_ = W; h_ = H;
|
||||||
|
|
||||||
label_.value = L;
|
label_.value = L;
|
||||||
label_.type = FL_NORMAL_LABEL;
|
label_.image = 0;
|
||||||
label_.font = FL_HELVETICA;
|
label_.deimage = 0;
|
||||||
label_.size = FL_NORMAL_SIZE;
|
label_.type = FL_NORMAL_LABEL;
|
||||||
label_.color = FL_BLACK;
|
label_.font = FL_HELVETICA;
|
||||||
tooltip_ = 0;
|
label_.size = FL_NORMAL_SIZE;
|
||||||
callback_ = default_callback;
|
label_.color = FL_BLACK;
|
||||||
user_data_ = 0;
|
tooltip_ = 0;
|
||||||
type_ = 0;
|
callback_ = default_callback;
|
||||||
flags_ = 0;
|
user_data_ = 0;
|
||||||
damage_ = 0;
|
type_ = 0;
|
||||||
box_ = FL_NO_BOX;
|
flags_ = 0;
|
||||||
color_ = FL_GRAY;
|
damage_ = 0;
|
||||||
color2_ = FL_GRAY;
|
box_ = FL_NO_BOX;
|
||||||
align_ = FL_ALIGN_CENTER;
|
color_ = FL_GRAY;
|
||||||
when_ = FL_WHEN_RELEASE;
|
color2_ = FL_GRAY;
|
||||||
|
align_ = FL_ALIGN_CENTER;
|
||||||
|
when_ = FL_WHEN_RELEASE;
|
||||||
|
|
||||||
parent_ = 0;
|
parent_ = 0;
|
||||||
if (Fl_Group::current()) Fl_Group::current()->add(this);
|
if (Fl_Group::current()) Fl_Group::current()->add(this);
|
||||||
@@ -229,5 +231,5 @@ int Fl_Widget::contains(const Fl_Widget *o) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.4 2001/08/05 14:00:15 easysw Exp $".
|
// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.5 2001/08/06 03:17:43 easysw Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
+101
-18
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: fl_draw.cxx,v 1.6.2.4.2.1 2001/08/05 23:58:54 easysw Exp $"
|
// "$Id: fl_draw.cxx,v 1.6.2.4.2.2 2001/08/06 03:17:43 easysw Exp $"
|
||||||
//
|
//
|
||||||
// Label drawing code for the Fast Light Tool Kit (FLTK).
|
// Label drawing code for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -34,8 +34,10 @@
|
|||||||
#include <FL/Fl_Image.H>
|
#include <FL/Fl_Image.H>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#define MAXBUF 1024
|
#define MAXBUF 1024
|
||||||
|
#define min(a,b) ((a)<(b)?(a):(b))
|
||||||
|
|
||||||
char fl_draw_shortcut; // set by fl_labeltypes.cxx
|
char fl_draw_shortcut; // set by fl_labeltypes.cxx
|
||||||
|
|
||||||
@@ -84,21 +86,20 @@ expand(const char* from, char* buf, double maxw, int& n, double &width, int wrap
|
|||||||
|
|
||||||
if (c == '\t') {
|
if (c == '\t') {
|
||||||
for (c = (o-buf)%8; c<8 && o<e; c++) *o++ = ' ';
|
for (c = (o-buf)%8; c<8 && o<e; c++) *o++ = ' ';
|
||||||
|
|
||||||
} else if (c == '&' && fl_draw_shortcut && *(p+1)) {
|
} else if (c == '&' && fl_draw_shortcut && *(p+1)) {
|
||||||
if (*(p+1) == '&') {p++; *o++ = '&';}
|
if (*(p+1) == '&') {p++; *o++ = '&';}
|
||||||
else if (fl_draw_shortcut != 2) underline_at = o;
|
else if (fl_draw_shortcut != 2) underline_at = o;
|
||||||
|
|
||||||
} else if (c < ' ' || c == 127) { // ^X
|
} else if (c < ' ' || c == 127) { // ^X
|
||||||
*o++ = '^';
|
*o++ = '^';
|
||||||
*o++ = c ^ 0x40;
|
*o++ = c ^ 0x40;
|
||||||
|
|
||||||
} else if (c == 0xA0) { // non-breaking space
|
} else if (c == 0xA0) { // non-breaking space
|
||||||
*o++ = ' ';
|
*o++ = ' ';
|
||||||
|
} else if (c == '@') { // Symbol???
|
||||||
|
if (p[1] && p[1] != '@') break;
|
||||||
|
*o++ = c;
|
||||||
|
if (p[1]) p++;
|
||||||
} else {
|
} else {
|
||||||
*o++ = c;
|
*o++ = c;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,32 +119,71 @@ void fl_draw(
|
|||||||
const char* e;
|
const char* e;
|
||||||
char buf[MAXBUF];
|
char buf[MAXBUF];
|
||||||
int buflen;
|
int buflen;
|
||||||
|
char symbol[255], *symptr;
|
||||||
|
int symwidth, symwhen, symoffset;
|
||||||
|
|
||||||
// count how many lines and put the last one into the buffer:
|
// count how many lines and put the last one into the buffer:
|
||||||
int lines;
|
int lines;
|
||||||
double width;
|
double width;
|
||||||
for (p=str,lines=0; ;) {
|
|
||||||
|
symbol[0] = '\0';
|
||||||
|
symwidth = 0;
|
||||||
|
symwhen = 0;
|
||||||
|
|
||||||
|
if (str && str[0] == '@' && str[1] && str[1] != '@') {
|
||||||
|
// Start with a symbol...
|
||||||
|
for (symptr = symbol;
|
||||||
|
*str && !isspace(*str) && symptr < (symbol + sizeof(symbol) - 1);
|
||||||
|
*symptr++ = *str++);
|
||||||
|
*symptr = '\0';
|
||||||
|
if (isspace(*str)) str++;
|
||||||
|
symwidth = min(w,h);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (p = str, lines=0; p;) {
|
||||||
e = expand(p, buf, w, buflen, width, align&FL_ALIGN_WRAP);
|
e = expand(p, buf, w, buflen, width, align&FL_ALIGN_WRAP);
|
||||||
lines++;
|
lines++;
|
||||||
if (!*e) break;
|
if (!*e) break;
|
||||||
|
else if (*e == '@') {
|
||||||
|
strncpy(symbol, e, sizeof(symbol) - 1);
|
||||||
|
symbol[sizeof(symbol) - 1] = '\0';
|
||||||
|
symwidth = min(w,h);
|
||||||
|
symwhen = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
p = e;
|
p = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (symwidth && lines) symwidth = lines * fl_height();
|
||||||
|
|
||||||
// figure out vertical position of the first line:
|
// figure out vertical position of the first line:
|
||||||
int xpos;
|
int xpos;
|
||||||
int ypos;
|
int ypos;
|
||||||
int height = fl_height();
|
int height = fl_height();
|
||||||
int imgh = img ? img->h() : 0;
|
int imgh = img ? img->h() : 0;
|
||||||
|
|
||||||
|
symoffset = 0;
|
||||||
|
|
||||||
if (align & FL_ALIGN_BOTTOM) ypos = y+h-(lines-1)*height-imgh;
|
if (align & FL_ALIGN_BOTTOM) ypos = y+h-(lines-1)*height-imgh;
|
||||||
else if (align & FL_ALIGN_TOP) ypos = y+height;
|
else if (align & FL_ALIGN_TOP) ypos = y+height;
|
||||||
else ypos = y+(h-lines*height-imgh)/2+height;
|
else ypos = y+(h-lines*height-imgh)/2+height;
|
||||||
|
|
||||||
// draw the image unless the "text over image" alignment flag is set...
|
// draw the image unless the "text over image" alignment flag is set...
|
||||||
if (img && !(align & FL_ALIGN_TEXT_OVER_IMAGE)) {
|
if (img && !(align & FL_ALIGN_TEXT_OVER_IMAGE)) {
|
||||||
if (align & FL_ALIGN_LEFT) xpos = x;
|
if (img->w() > symoffset) symoffset = img->w();
|
||||||
else if (align & FL_ALIGN_RIGHT) xpos = x+w-img->w();
|
|
||||||
else xpos = x+(w-img->w())/2;
|
if (align & FL_ALIGN_LEFT) {
|
||||||
|
if (!symwhen) xpos = x + symwidth;
|
||||||
|
else xpos = x;
|
||||||
|
}
|
||||||
|
else if (align & FL_ALIGN_RIGHT) {
|
||||||
|
if (symwhen) xpos = x+w-img->w()-symwidth;
|
||||||
|
else xpos = x+w-img->w();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
xpos = x+(w-img->w()-symwidth)/2;
|
||||||
|
if (!symwhen) xpos += symwidth;
|
||||||
|
}
|
||||||
|
|
||||||
img->draw(xpos, ypos - height);
|
img->draw(xpos, ypos - height);
|
||||||
ypos += img->h();
|
ypos += img->h();
|
||||||
@@ -154,27 +194,70 @@ void fl_draw(
|
|||||||
for (p=str; ; ypos += height) {
|
for (p=str; ; ypos += height) {
|
||||||
if (lines>1) e = expand(p, buf, w, buflen, width, align&FL_ALIGN_WRAP);
|
if (lines>1) e = expand(p, buf, w, buflen, width, align&FL_ALIGN_WRAP);
|
||||||
|
|
||||||
if (align & FL_ALIGN_LEFT) xpos = x;
|
if (width > symoffset) symoffset = (int)(width + 0.5);
|
||||||
else if (align & FL_ALIGN_RIGHT) xpos = x+w-int(width+.5);
|
|
||||||
else xpos = x+int((w-width)/2);
|
if (align & FL_ALIGN_LEFT) {
|
||||||
|
if (!symwhen) xpos = x + symwidth;
|
||||||
|
else xpos = x;
|
||||||
|
}
|
||||||
|
else if (align & FL_ALIGN_RIGHT) {
|
||||||
|
if (symwhen) xpos = x+w-int(width+.5) - symwidth;
|
||||||
|
else xpos = x+w-int(width+.5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
xpos = x+int((w-width-symwidth)/2);
|
||||||
|
if (!symwhen) xpos += symwidth;
|
||||||
|
}
|
||||||
|
|
||||||
callthis(buf,buflen,xpos,ypos-desc);
|
callthis(buf,buflen,xpos,ypos-desc);
|
||||||
|
|
||||||
if (underline_at)
|
if (underline_at)
|
||||||
callthis("_",1,xpos+int(fl_width(buf,underline_at-buf)),ypos-desc);
|
callthis("_",1,xpos+int(fl_width(buf,underline_at-buf)),ypos-desc);
|
||||||
|
|
||||||
if (!*e) break;
|
if (!*e || *e == '@') break;
|
||||||
p = e;
|
p = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw the image if the "text over image" alignment flag is set...
|
// draw the image if the "text over image" alignment flag is set...
|
||||||
if (img && (align & FL_ALIGN_TEXT_OVER_IMAGE)) {
|
if (img && (align & FL_ALIGN_TEXT_OVER_IMAGE)) {
|
||||||
if (align & FL_ALIGN_LEFT) xpos = x;
|
if (img->w() > symoffset) symoffset = img->w();
|
||||||
else if (align & FL_ALIGN_RIGHT) xpos = x+w-img->w();
|
|
||||||
else xpos = x+(w-img->w())/2;
|
if (align & FL_ALIGN_LEFT) {
|
||||||
|
if (!symwhen) xpos = x + symwidth;
|
||||||
|
else xpos = x;
|
||||||
|
}
|
||||||
|
else if (align & FL_ALIGN_RIGHT) {
|
||||||
|
if (symwhen) xpos = x+w-img->w()-symwidth;
|
||||||
|
else xpos = x+w-img->w();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
xpos = x+(w-img->w()-symwidth)/2;
|
||||||
|
if (!symwhen) xpos += symwidth;
|
||||||
|
}
|
||||||
|
|
||||||
img->draw(xpos, ypos);
|
img->draw(xpos, ypos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// draw the symbol, if any...
|
||||||
|
if (symwidth) {
|
||||||
|
if (symwhen) {
|
||||||
|
// draw to the right
|
||||||
|
if (align & FL_ALIGN_LEFT) xpos = x + symoffset;
|
||||||
|
else if (align & FL_ALIGN_RIGHT) xpos = x + w - symwidth;
|
||||||
|
else xpos = x + (w-symoffset-symwidth)/2+symoffset;
|
||||||
|
} else {
|
||||||
|
// draw to the left
|
||||||
|
if (align & FL_ALIGN_LEFT) xpos = x;
|
||||||
|
else if (align & FL_ALIGN_RIGHT) xpos = x + w - symwidth - symoffset;
|
||||||
|
else xpos = x + (w-symoffset-symwidth)/2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (align & FL_ALIGN_BOTTOM) ypos = y + h - symwidth;
|
||||||
|
else if (align & FL_ALIGN_TOP) ypos = y;
|
||||||
|
else ypos = y + (h-symwidth)/2;
|
||||||
|
|
||||||
|
fl_draw_symbol(symbol, xpos, ypos, symwidth, symwidth, fl_color());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void fl_draw(
|
void fl_draw(
|
||||||
@@ -211,5 +294,5 @@ void fl_measure(const char* str, int& w, int& h) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: fl_draw.cxx,v 1.6.2.4.2.1 2001/08/05 23:58:54 easysw Exp $".
|
// End of "$Id: fl_draw.cxx,v 1.6.2.4.2.2 2001/08/06 03:17:43 easysw Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: fl_labeltype.cxx,v 1.6.2.3.2.1 2001/08/05 23:58:54 easysw Exp $"
|
// "$Id: fl_labeltype.cxx,v 1.6.2.3.2.2 2001/08/06 03:17:43 easysw Exp $"
|
||||||
//
|
//
|
||||||
// Label drawing routines for the Fast Light Tool Kit (FLTK).
|
// Label drawing routines for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -63,16 +63,15 @@ fl_normal_measure(const Fl_Label* o, int& W, int& H) {
|
|||||||
static Fl_Label_Draw_F* table[MAX_LABELTYPE] = {
|
static Fl_Label_Draw_F* table[MAX_LABELTYPE] = {
|
||||||
fl_normal_label,
|
fl_normal_label,
|
||||||
fl_no_label,
|
fl_no_label,
|
||||||
fl_normal_label, // _FL_SYMBOL_LABEL,
|
|
||||||
fl_normal_label, // _FL_SHADOW_LABEL,
|
fl_normal_label, // _FL_SHADOW_LABEL,
|
||||||
fl_normal_label, // _FL_ENGRAVED_LABEL,
|
fl_normal_label, // _FL_ENGRAVED_LABEL,
|
||||||
fl_normal_label, // _FL_EMBOSSED_LABEL,
|
fl_normal_label, // _FL_EMBOSSED_LABEL,
|
||||||
fl_no_label, // _FL_BITMAP_LABEL,
|
fl_no_label, // _FL_MULTI_LABEL,
|
||||||
fl_no_label, // _FL_PIXMAP_LABEL,
|
fl_no_label, // _FL_ICON_LABEL,
|
||||||
fl_no_label, // _FL_IMAGE_LABEL,
|
|
||||||
// FL_FREE_LABELTYPE+n:
|
// FL_FREE_LABELTYPE+n:
|
||||||
fl_no_label, fl_no_label, fl_no_label,
|
fl_no_label, fl_no_label, fl_no_label,
|
||||||
fl_no_label, fl_no_label, fl_no_label, fl_no_label,
|
fl_no_label, fl_no_label, fl_no_label,
|
||||||
|
fl_no_label, fl_no_label, fl_no_label
|
||||||
};
|
};
|
||||||
|
|
||||||
static Fl_Label_Measure_F* measure[MAX_LABELTYPE];
|
static Fl_Label_Measure_F* measure[MAX_LABELTYPE];
|
||||||
@@ -132,5 +131,5 @@ void Fl_Widget::draw_label(int X, int Y, int W, int H, Fl_Align a) const {
|
|||||||
#include <FL/Fl_Input_.H>
|
#include <FL/Fl_Input_.H>
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: fl_labeltype.cxx,v 1.6.2.3.2.1 2001/08/05 23:58:54 easysw Exp $".
|
// End of "$Id: fl_labeltype.cxx,v 1.6.2.3.2.2 2001/08/06 03:17:43 easysw Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
+2
-24
@@ -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).
|
// Symbol drawing code for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -360,28 +360,6 @@ static void fl_init_symbols(void) {
|
|||||||
fl_add_symbol("||", draw_doublebar, 1);
|
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 $".
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: forms_compatability.cxx,v 1.5.2.3 2001/01/22 15:13:41 easysw Exp $"
|
// "$Id: forms_compatability.cxx,v 1.5.2.3.2.1 2001/08/06 03:17:43 easysw Exp $"
|
||||||
//
|
//
|
||||||
// Forms compatibility functions for the Fast Light Tool Kit (FLTK).
|
// Forms compatibility functions for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -89,8 +89,6 @@ char fl_modal_next; // set by fl_freeze_forms()
|
|||||||
|
|
||||||
void fl_show_form(Fl_Window *f,int place,int b,const char *n) {
|
void fl_show_form(Fl_Window *f,int place,int b,const char *n) {
|
||||||
|
|
||||||
Fl::enable_symbols();
|
|
||||||
|
|
||||||
f->label(n);
|
f->label(n);
|
||||||
if (!b) f->clear_border();
|
if (!b) f->clear_border();
|
||||||
if (fl_modal_next || b==FL_TRANSIENT) {f->set_modal(); fl_modal_next = 0;}
|
if (fl_modal_next || b==FL_TRANSIENT) {f->set_modal(); fl_modal_next = 0;}
|
||||||
@@ -204,5 +202,5 @@ char *fl_show_simple_input(const char *str1, const char *defstr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: forms_compatability.cxx,v 1.5.2.3 2001/01/22 15:13:41 easysw Exp $".
|
// End of "$Id: forms_compatability.cxx,v 1.5.2.3.2.1 2001/08/06 03:17:43 easysw Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
+1
-1
@@ -311,7 +311,7 @@ fl_show_colormap.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
|||||||
fl_show_colormap.o: ../FL/Fl_Single_Window.H ../FL/Fl_Window.H
|
fl_show_colormap.o: ../FL/Fl_Single_Window.H ../FL/Fl_Window.H
|
||||||
fl_show_colormap.o: ../FL/fl_draw.H ../FL/fl_show_colormap.H ../config.h
|
fl_show_colormap.o: ../FL/fl_draw.H ../FL/fl_show_colormap.H ../config.h
|
||||||
fl_symbols.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
fl_symbols.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||||
fl_symbols.o: ../FL/fl_draw.H ../FL/Fl_Widget.H
|
fl_symbols.o: ../FL/fl_draw.H
|
||||||
fl_vertex.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/x.H
|
fl_vertex.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/x.H
|
||||||
fl_vertex.o: ../FL/Fl_Window.H ../FL/math.h
|
fl_vertex.o: ../FL/Fl_Window.H ../FL/math.h
|
||||||
forms_compatability.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
|
forms_compatability.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
|
||||||
|
|||||||
Reference in New Issue
Block a user