summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-08-05 23:58:54 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-08-05 23:58:54 +0000
commit7ebaf77cdcbcadb4706c87f1662730a4687caf20 (patch)
tree07340f24b863b23f716b9cf9f657026c76c62fbf /src
parent208cf399a6ab801951bf28a82a0e07adefc60028 (diff)
Image labels!
image() method to set active image, deimage() method to set inactive image. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1560 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Bitmap.cxx55
-rw-r--r--src/Fl_HelpView.cxx8
-rw-r--r--src/Fl_Image.cxx62
-rw-r--r--src/Fl_Pixmap.cxx74
-rw-r--r--src/fl_draw.cxx57
-rw-r--r--src/fl_labeltype.cxx29
-rw-r--r--src/makedepend88
7 files changed, 183 insertions, 190 deletions
diff --git a/src/Fl_Bitmap.cxx b/src/Fl_Bitmap.cxx
index 91c9fd4d3..49d450479 100644
--- a/src/Fl_Bitmap.cxx
+++ b/src/Fl_Bitmap.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Bitmap.cxx,v 1.5.2.4 2001/01/22 15:13:39 easysw Exp $"
+// "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.1 2001/08/05 23:58:54 easysw Exp $"
//
// Bitmap drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -36,30 +36,30 @@ void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
cx += X-XP; cy += Y-YP;
// clip the box down to the size of image, quit if empty:
if (cx < 0) {W += cx; X -= cx; cx = 0;}
- if ((cx+W) > w) W = w-cx;
+ if ((cx+W) > w()) W = w()-cx;
if (W <= 0) return;
if (cy < 0) {H += cy; Y -= cy; cy = 0;}
- if ((cy+H) > h) H = h-cy;
+ if ((cy+H) > h()) H = h()-cy;
if (H <= 0) return;
#ifdef WIN32
if (!id) {
// we need to pad the lines out to words & swap the bits
// in each byte.
- int w1 = (w+7)/8;
- int w2 = ((w+15)/16)*2;
- uchar* newarray = new uchar[w2*h];
+ int w1 = (w()+7)/8;
+ int w2 = ((w()+15)/16)*2;
+ uchar* newarray = new uchar[w2*h()];
const uchar* src = array;
uchar* dest = newarray;
static uchar reverse[16] = /* Bit reversal lookup table */
{ 0x00, 0x88, 0x44, 0xcc, 0x22, 0xaa, 0x66, 0xee,
0x11, 0x99, 0x55, 0xdd, 0x33, 0xbb, 0x77, 0xff };
- for (int y=0; y < h; y++) {
+ for (int y=0; y < h(); y++) {
for (int n = 0; n < w1; n++, src++)
*dest++ = (reverse[*src & 0x0f] & 0xf0) |
(reverse[(*src >> 4) & 0x0f] & 0x0f);
dest += w2-w1;
}
- id = (ulong)CreateBitmap(w, h, 1, 1, newarray);
+ id = (ulong)CreateBitmap(w(), h(), 1, 1, newarray);
array = newarray; // keep the pointer so I can free it later
}
HDC tempdc = CreateCompatibleDC(fl_gc);
@@ -70,10 +70,10 @@ void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
DeleteDC(tempdc);
#else
if (!id) id = XCreateBitmapFromData(fl_display, fl_window,
- (const char*)array, (w+7)&-8, h);
+ (const char*)array, (w()+7)&-8, h());
XSetStipple(fl_display, fl_gc, id);
- int ox = X-cx; if (ox < 0) ox += w;
- int oy = Y-cy; if (oy < 0) oy += h;
+ int ox = X-cx; if (ox < 0) ox += w();
+ int oy = Y-cy; if (oy < 0) oy += h();
XSetTSOrigin(fl_display, fl_gc, ox, oy);
XSetFillStyle(fl_display, fl_gc, FillStippled);
XFillRectangle(fl_display, fl_window, fl_gc, X, Y, W, H);
@@ -92,38 +92,13 @@ Fl_Bitmap::~Fl_Bitmap() {
#endif
}
-static void bitmap_labeltype(
- const Fl_Label* o, int x, int y, int w, int h, Fl_Align a)
-{
- Fl_Bitmap* b = (Fl_Bitmap*)(o->value);
- int cx;
- if (a & FL_ALIGN_LEFT) cx = 0;
- else if (a & FL_ALIGN_RIGHT) cx = b->w-w;
- else cx = (b->w-w)/2;
- int cy;
- if (a & FL_ALIGN_TOP) cy = 0;
- else if (a & FL_ALIGN_BOTTOM) cy = b->h-h;
- else cy = (b->h-h)/2;
- fl_color((Fl_Color)o->color);
- b->draw(x,y,w,h,cx,cy);
+void Fl_Bitmap::label(Fl_Widget* w) {
+ w->image(this);
}
-static void bitmap_measure(const Fl_Label* o, int& w, int& h) {
- Fl_Bitmap* b = (Fl_Bitmap*)(o->value);
- w = b->w;
- h = b->h;
-}
-
-void Fl_Bitmap::label(Fl_Widget* o) {
- Fl::set_labeltype(_FL_BITMAP_LABEL, bitmap_labeltype, bitmap_measure);
- o->label(_FL_BITMAP_LABEL, (const char*)this);
-}
-
-void Fl_Bitmap::label(Fl_Menu_Item* o) {
- Fl::set_labeltype(_FL_BITMAP_LABEL, bitmap_labeltype, bitmap_measure);
- o->label(_FL_BITMAP_LABEL, (const char*)this);
+void Fl_Bitmap::label(Fl_Menu_Item* m) {
}
//
-// End of "$Id: Fl_Bitmap.cxx,v 1.5.2.4 2001/01/22 15:13:39 easysw Exp $".
+// End of "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.1 2001/08/05 23:58:54 easysw Exp $".
//
diff --git a/src/Fl_HelpView.cxx b/src/Fl_HelpView.cxx
index 15579c41b..d658ec96e 100644
--- a/src/Fl_HelpView.cxx
+++ b/src/Fl_HelpView.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_HelpView.cxx,v 1.1.2.3 2001/08/02 21:11:43 easysw Exp $"
+// "$Id: Fl_HelpView.cxx,v 1.1.2.4 2001/08/05 23:58:54 easysw Exp $"
//
// Fl_HelpView widget routines.
//
@@ -499,7 +499,7 @@ Fl_HelpView::add_image(const char *name, // I - Path of image
{
// Make the image if needed...
if (!img->image)
- img->image = new Fl_Image(img->data, img->w, img->h, img->d);
+ img->image = new Fl_RGB_Image(img->data, img->w, img->h, img->d);
return (img);
}
@@ -723,7 +723,7 @@ Fl_HelpView::add_image(const char *name, // I - Path of image
img->hattr[sizeof(img->hattr) - 1] = '\0';
if (make)
- img->image = new Fl_Image(img->data, img->w, img->h, img->d);
+ img->image = new Fl_RGB_Image(img->data, img->w, img->h, img->d);
else
img->image = (Fl_Image *)0;
@@ -3132,5 +3132,5 @@ scrollbar_callback(Fl_Widget *s, void *)
//
-// End of "$Id: Fl_HelpView.cxx,v 1.1.2.3 2001/08/02 21:11:43 easysw Exp $".
+// End of "$Id: Fl_HelpView.cxx,v 1.1.2.4 2001/08/05 23:58:54 easysw Exp $".
//
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx
index 843a88963..1c62e2fea 100644
--- a/src/Fl_Image.cxx
+++ b/src/Fl_Image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Image.cxx,v 1.5.2.3 2001/01/22 15:13:39 easysw Exp $"
+// "$Id: Fl_Image.cxx,v 1.5.2.3.2.1 2001/08/05 23:58:54 easysw Exp $"
//
// Image drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -30,61 +30,51 @@
#include <FL/Fl_Menu_Item.H>
#include <FL/Fl_Image.H>
+Fl_Image::~Fl_Image() {
+}
+
void Fl_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
+}
+
+void Fl_Image::label(Fl_Widget* w) {
+ w->image(this);
+}
+
+void Fl_Image::label(Fl_Menu_Item* m) {
+}
+
+Fl_RGB_Image::~Fl_RGB_Image() {
+ if (id) fl_delete_offscreen((Fl_Offscreen)id);
+}
+
+void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
// account for current clip region (faster on Irix):
int X,Y,W,H; fl_clip_box(XP,YP,WP,HP,X,Y,W,H);
cx += X-XP; cy += Y-YP;
// clip the box down to the size of image, quit if empty:
if (cx < 0) {W += cx; X -= cx; cx = 0;}
- if (cx+W > w) W = w-cx;
+ if (cx+W > w()) W = w()-cx;
if (W <= 0) return;
if (cy < 0) {H += cy; Y -= cy; cy = 0;}
- if (cy+H > h) H = h-cy;
+ if (cy+H > h()) H = h()-cy;
if (H <= 0) return;
if (!id) {
- id = (ulong)fl_create_offscreen(w, h);
+ id = (ulong)fl_create_offscreen(w(), h());
fl_begin_offscreen((Fl_Offscreen)id);
- fl_draw_image(array, 0, 0, w, h, d, ld);
+ fl_draw_image(array, 0, 0, w(), h(), d, ld);
fl_end_offscreen();
}
fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy);
}
-Fl_Image::~Fl_Image() {
- if (id) fl_delete_offscreen((Fl_Offscreen)id);
+void Fl_RGB_Image::label(Fl_Widget* w) {
+ w->image(this);
}
-static void image_labeltype(
- const Fl_Label* o, int x, int y, int w, int h, Fl_Align a)
-{
- Fl_Image* b = (Fl_Image*)(o->value);
- int cx;
- if (a & FL_ALIGN_LEFT) cx = 0;
- else if (a & FL_ALIGN_RIGHT) cx = b->w-w;
- else cx = (b->w-w)/2;
- int cy;
- if (a & FL_ALIGN_TOP) cy = 0;
- else if (a & FL_ALIGN_BOTTOM) cy = b->h-h;
- else cy = (b->h-h)/2;
- b->draw(x,y,w,h,cx,cy);
+void Fl_RGB_Image::label(Fl_Menu_Item* m) {
}
-static void image_measure(const Fl_Label* o, int& w, int& h) {
- Fl_Image* b = (Fl_Image*)(o->value);
- w = b->w;
- h = b->h;
-}
-
-void Fl_Image::label(Fl_Widget* o) {
- Fl::set_labeltype(_FL_IMAGE_LABEL, image_labeltype, image_measure);
- o->label(_FL_IMAGE_LABEL, (const char*)this);
-}
-
-void Fl_Image::label(Fl_Menu_Item* o) {
- Fl::set_labeltype(_FL_IMAGE_LABEL, image_labeltype, image_measure);
- o->label(_FL_IMAGE_LABEL, (const char*)this);
-}
//
-// End of "$Id: Fl_Image.cxx,v 1.5.2.3 2001/01/22 15:13:39 easysw Exp $".
+// End of "$Id: Fl_Image.cxx,v 1.5.2.3.2.1 2001/08/05 23:58:54 easysw Exp $".
//
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx
index 846383b55..df0e029a6 100644
--- a/src/Fl_Pixmap.cxx
+++ b/src/Fl_Pixmap.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Pixmap.cxx,v 1.9.2.4 2001/01/22 15:13:40 easysw Exp $"
+// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.1 2001/08/05 23:58:54 easysw Exp $"
//
// Pixmap drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -42,25 +42,35 @@
extern uchar **fl_mask_bitmap; // used by fl_draw_pixmap.C to store mask
void fl_restore_clip(); // in fl_rect.C
+void Fl_Pixmap::measure() {
+ int W, H;
+
+ // ignore empty or bad pixmap data:
+ if (w()<0) {
+ fl_measure_pixmap(data, W, H);
+ w(W); h(H);
+ }
+}
+
void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
// ignore empty or bad pixmap data:
- if (w<0) {
- fl_measure_pixmap(data, w, h);
- if (WP==-1) { WP = w; HP = h; }
+ if (w()<0) {
+ measure();
+ if (WP==-1) { WP = w(); HP = h(); }
}
- if (!w) return;
+ if (!w()) return;
// account for current clip region (faster on Irix):
int X,Y,W,H; fl_clip_box(XP,YP,WP,HP,X,Y,W,H);
cx += X-XP; cy += Y-YP;
// clip the box down to the size of image, quit if empty:
if (cx < 0) {W += cx; X -= cx; cx = 0;}
- if (cx+W > w) W = w-cx;
+ if (cx+W > w()) W = w()-cx;
if (W <= 0) return;
if (cy < 0) {H += cy; Y -= cy; cy = 0;}
- if (cy+H > h) H = h-cy;
+ if (cy+H > h()) H = h()-cy;
if (H <= 0) return;
if (!id) {
- id = (ulong)fl_create_offscreen(w, h);
+ id = (ulong)fl_create_offscreen(w(), h());
fl_begin_offscreen((Fl_Offscreen)id);
uchar *bitmap = 0;
fl_mask_bitmap = &bitmap;
@@ -78,11 +88,11 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b, 0x07, 0x0f };
int np = GetDeviceCaps(fl_gc, PLANES); //: was always one on sample machines
int bpp = GetDeviceCaps(fl_gc, BITSPIXEL);//: 1,4,8,16,24,32 and more odd stuff?
- int Bpr = (bpp*w+7)/8; //: bytes per row
- int pad = Bpr&1, w1 = (w+7)/8, shr = ((w-1)&7)+1;
+ int Bpr = (bpp*w()+7)/8; //: bytes per row
+ int pad = Bpr&1, w1 = (w()+7)/8, shr = ((w()-1)&7)+1;
if (bpp==4) shr = (shr+1)/2;
uchar *newarray = new uchar[(Bpr+pad)*h], *dst = newarray, *src = bitmap;
- for (int i=0; i<h; i++) {
+ for (int i=0; i<h(); i++) {
//: this is slooow, but we do it only once per pixmap
for (int j=w1; j>0; j--) {
uchar b = *src++;
@@ -112,11 +122,11 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
}
dst += pad;
}
- mask = (ulong)CreateBitmap(w, h, np, bpp, newarray);
+ mask = (ulong)CreateBitmap(w(), h(), np, bpp, newarray);
delete[] newarray;
#else
mask = XCreateBitmapFromData(fl_display, fl_window,
- (const char*)bitmap, (w+7)&-8, h);
+ (const char*)bitmap, (w()+7)&-8, h());
#endif
delete[] bitmap;
}
@@ -142,8 +152,8 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
cy += ny-Y; Y = ny;
// make X use the bitmap as a mask:
XSetClipMask(fl_display, fl_gc, mask);
- int ox = X-cx; if (ox < 0) ox += w;
- int oy = Y-cy; if (oy < 0) oy += h;
+ int ox = X-cx; if (ox < 0) ox += w();
+ int oy = Y-cy; if (oy < 0) oy += h();
XSetClipOrigin(fl_display, fl_gc, X-cx, Y-cy);
}
fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy);
@@ -160,39 +170,13 @@ Fl_Pixmap::~Fl_Pixmap() {
if (mask) fl_delete_offscreen((Fl_Offscreen)mask);
}
-static void pixmap_labeltype(
- const Fl_Label* o, int x, int y, int w, int h, Fl_Align a)
-{
- Fl_Pixmap* b = (Fl_Pixmap*)(o->value);
- if (b->w<0) fl_measure_pixmap(b->data, b->w, b->h);
- int cx;
- if (a & FL_ALIGN_LEFT) cx = 0;
- else if (a & FL_ALIGN_RIGHT) cx = b->w-w;
- else cx = (b->w-w)/2;
- int cy;
- if (a & FL_ALIGN_TOP) cy = 0;
- else if (a & FL_ALIGN_BOTTOM) cy = b->h-h;
- else cy = (b->h-h)/2;
- b->draw(x,y,w,h,cx,cy);
-}
-
-static void pixmap_measure(const Fl_Label* o, int& w, int& h) {
- Fl_Pixmap* b = (Fl_Pixmap*)(o->value);
- if (b->w<0) fl_measure_pixmap(b->data, b->w, b->h);
- w = b->w;
- h = b->h;
-}
-
-void Fl_Pixmap::label(Fl_Widget* o) {
- Fl::set_labeltype(_FL_PIXMAP_LABEL, pixmap_labeltype, pixmap_measure);
- o->label(_FL_PIXMAP_LABEL, (const char*)this);
+void Fl_Pixmap::label(Fl_Widget* w) {
+ w->image(this);
}
-void Fl_Pixmap::label(Fl_Menu_Item* o) {
- Fl::set_labeltype(_FL_PIXMAP_LABEL, pixmap_labeltype, pixmap_measure);
- o->label(_FL_PIXMAP_LABEL, (const char*)this);
+void Fl_Pixmap::label(Fl_Menu_Item* m) {
}
//
-// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4 2001/01/22 15:13:40 easysw Exp $".
+// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.1 2001/08/05 23:58:54 easysw Exp $".
//
diff --git a/src/fl_draw.cxx b/src/fl_draw.cxx
index 97857d6c1..10d5a24e9 100644
--- a/src/fl_draw.cxx
+++ b/src/fl_draw.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_draw.cxx,v 1.6.2.4 2001/01/22 15:13:40 easysw Exp $"
+// "$Id: fl_draw.cxx,v 1.6.2.4.2.1 2001/08/05 23:58:54 easysw Exp $"
//
// Label drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -31,11 +31,14 @@
// Aligns them against the inside of the box.
#include <FL/fl_draw.H>
+#include <FL/Fl_Image.H>
+
#include <string.h>
#define MAXBUF 1024
-char fl_draw_shortcut; // set by fl_labeltypes.C
+char fl_draw_shortcut; // set by fl_labeltypes.cxx
+
static char* underline_at;
// Copy p to buf, replacing unprintable characters with ^X and \nnn
@@ -90,19 +93,6 @@ expand(const char* from, char* buf, double maxw, int& n, double &width, int wrap
*o++ = '^';
*o++ = c ^ 0x40;
- /*
- * mike@fltk.org - The following escaping code causes problems when
- * using the PostScript ISOLatin1 and WinANSI encodings, because these
- * map to I18N characters...
- */
-#if 0
- } else if (c >= 128 && c < 0xA0) { // \nnn
- *o++ = '\\';
- *o++ = (c>>6)+'0';
- *o++ = ((c>>3)&7)+'0';
- *o++ = (c&7)+'0';
-#endif /* 0 */
-
} else if (c == 0xA0) { // non-breaking space
*o++ = ' ';
@@ -122,8 +112,8 @@ void fl_draw(
const char* str, // the (multi-line) string
int x, int y, int w, int h, // bounding box
Fl_Align align,
- void (*callthis)(const char*,int,int,int)
-) {
+ void (*callthis)(const char*,int,int,int),
+ Fl_Image* img) {
const char* p;
const char* e;
char buf[MAXBUF];
@@ -140,18 +130,30 @@ void fl_draw(
}
// figure out vertical position of the first line:
+ int xpos;
int ypos;
int height = fl_height();
- if (align & FL_ALIGN_BOTTOM) ypos = y+h-(lines-1)*height;
+ int imgh = img ? img->h() : 0;
+
+ if (align & FL_ALIGN_BOTTOM) ypos = y+h-(lines-1)*height-imgh;
else if (align & FL_ALIGN_TOP) ypos = y+height;
- else ypos = y+(h-lines*height)/2+height;
+ else ypos = y+(h-lines*height-imgh)/2+height;
+
+ // draw the image unless the "text over image" alignment flag is set...
+ if (img && !(align & FL_ALIGN_TEXT_OVER_IMAGE)) {
+ if (align & FL_ALIGN_LEFT) xpos = x;
+ else if (align & FL_ALIGN_RIGHT) xpos = x+w-img->w();
+ else xpos = x+(w-img->w())/2;
+
+ img->draw(xpos, ypos - height);
+ ypos += img->h();
+ }
// now draw all the lines:
int desc = fl_descent();
for (p=str; ; ypos += height) {
if (lines>1) e = expand(p, buf, w, buflen, width, align&FL_ALIGN_WRAP);
- int xpos;
if (align & FL_ALIGN_LEFT) xpos = x;
else if (align & FL_ALIGN_RIGHT) xpos = x+w-int(width+.5);
else xpos = x+int((w-width)/2);
@@ -165,16 +167,25 @@ void fl_draw(
p = e;
}
+ // draw the image if the "text over image" alignment flag is set...
+ if (img && (align & FL_ALIGN_TEXT_OVER_IMAGE)) {
+ if (align & FL_ALIGN_LEFT) xpos = x;
+ else if (align & FL_ALIGN_RIGHT) xpos = x+w-img->w();
+ else xpos = x+(w-img->w())/2;
+
+ img->draw(xpos, ypos);
+ }
}
void fl_draw(
const char* str, // the (multi-line) string
int x, int y, int w, int h, // bounding box
- Fl_Align align) {
+ Fl_Align align,
+ Fl_Image* img) {
if (!str || !*str) return;
if (w && h && !fl_not_clipped(x, y, w, h)) return;
if (align & FL_ALIGN_CLIP) fl_clip(x, y, w, h);
- fl_draw(str, x, y, w, h, align, fl_draw);
+ fl_draw(str, x, y, w, h, align, fl_draw, img);
if (align & FL_ALIGN_CLIP) fl_pop_clip();
}
@@ -200,5 +211,5 @@ void fl_measure(const char* str, int& w, int& h) {
}
//
-// End of "$Id: fl_draw.cxx,v 1.6.2.4 2001/01/22 15:13:40 easysw Exp $".
+// End of "$Id: fl_draw.cxx,v 1.6.2.4.2.1 2001/08/05 23:58:54 easysw Exp $".
//
diff --git a/src/fl_labeltype.cxx b/src/fl_labeltype.cxx
index b669b7e6e..32cc94775 100644
--- a/src/fl_labeltype.cxx
+++ b/src/fl_labeltype.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_labeltype.cxx,v 1.6.2.3 2001/01/22 15:13:41 easysw Exp $"
+// "$Id: fl_labeltype.cxx,v 1.6.2.3.2.1 2001/08/05 23:58:54 easysw Exp $"
//
// Label drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -40,7 +40,16 @@ fl_normal_label(const Fl_Label* o, int X, int Y, int W, int H, Fl_Align align)
{
fl_font(o->font, o->size);
fl_color((Fl_Color)o->color);
- fl_draw(o->value, X, Y, W, H, align);
+ if (o->image) {
+ if (align & FL_ALIGN_TEXT_OVER_IMAGE) {
+ fl_draw(o->value, X, Y, W, H, align, o->image);
+ } else {
+ fl_draw(o->value, X, Y, W, H, align, o->image);
+ }
+ }
+ else {
+ fl_draw(o->value, X, Y, W, H, align, o->image);
+ }
}
void
@@ -77,12 +86,16 @@ void Fl::set_labeltype(Fl_Labeltype t,Fl_Label_Draw_F* f,Fl_Label_Measure_F*m)
// draw label with arbitrary alignment in arbitrary box:
void Fl_Label::draw(int X, int Y, int W, int H, Fl_Align align) const {
- if (!value) return;
+ if (!value && !image) return;
table[type](this, X, Y, W, H, align);
}
void Fl_Label::measure(int& W, int& H) const {
- if (!value) return;
+ if (!value && !image) {
+ W = H = 0;
+ return;
+ }
+
Fl_Label_Measure_F* f = ::measure[type]; if (!f) f = fl_normal_measure;
f(this, W, H);
}
@@ -103,11 +116,13 @@ void Fl_Widget::draw_label(int X, int Y, int W, int H) const {
}
// Anybody can call this to force the label to draw anywhere:
-extern char fl_draw_shortcut;
void Fl_Widget::draw_label(int X, int Y, int W, int H, Fl_Align a) const {
if (flags()&SHORTCUT_LABEL) fl_draw_shortcut = 1;
Fl_Label l1 = label_;
- if (!active_r()) l1.color = inactive((Fl_Color)l1.color);
+ if (!active_r()) {
+ l1.color = inactive((Fl_Color)l1.color);
+ if (l1.deimage) l1.image = l1.deimage;
+ }
l1.draw(X,Y,W,H,a);
fl_draw_shortcut = 0;
}
@@ -117,5 +132,5 @@ void Fl_Widget::draw_label(int X, int Y, int W, int H, Fl_Align a) const {
#include <FL/Fl_Input_.H>
//
-// End of "$Id: fl_labeltype.cxx,v 1.6.2.3 2001/01/22 15:13:41 easysw Exp $".
+// End of "$Id: fl_labeltype.cxx,v 1.6.2.3.2.1 2001/08/05 23:58:54 easysw Exp $".
//
diff --git a/src/makedepend b/src/makedepend
index f09496585..7a7b88bec 100644
--- a/src/makedepend
+++ b/src/makedepend
@@ -5,11 +5,12 @@ Fl.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/x.H ../FL/Fl_Window.H
Fl.o: ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H ../FL/fl_draw.H
Fl_Adjuster.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Adjuster.o: ../FL/Fl_Adjuster.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
-Fl_Adjuster.o: ../FL/Fl_Bitmap.H ../FL/fl_draw.H fastarrow.h mediumarrow.h
-Fl_Adjuster.o: slowarrow.h
+Fl_Adjuster.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/fl_draw.H fastarrow.h
+Fl_Adjuster.o: mediumarrow.h slowarrow.h
Fl_Bitmap.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/x.H
Fl_Bitmap.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Fl_Widget.H
Fl_Bitmap.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
+Fl_Bitmap.o: ../FL/Fl_Image.H
Fl_Browser.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Browser.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Group.H
Fl_Browser.o: ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
@@ -26,7 +27,6 @@ Fl_Box.o: ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Widget.H
Fl_Box.o: ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Button.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Button.o: ../FL/Fl_Button.H ../FL/Fl_Widget.H ../FL/Fl_Group.H
-Fl_Button.o: ../FL/fl_draw.H
Fl_Chart.o: ../FL/math.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Chart.o: ../FL/Fl_Chart.H ../FL/Fl_Widget.H ../FL/fl_draw.H
Fl_Check_Button.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
@@ -66,7 +66,7 @@ Fl_FileChooser.o: ../FL/Fl_Valuator.H ../FL/Fl_FileIcon.H ../FL/Fl.H
Fl_FileChooser.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H
Fl_FileChooser.o: ../FL/Fl_Button.H ../FL/fl_ask.H ../FL/Fl_Input.H
Fl_FileChooser.o: ../FL/Fl_Input_.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
-Fl_FileChooser.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Bitmap.H
+Fl_FileChooser.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H
Fl_FileChooser2.o: ../FL/Fl_FileChooser.H ../FL/Fl.H ../FL/Enumerations.H
Fl_FileChooser2.o: ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H
Fl_FileChooser2.o: ../FL/Fl_Widget.H ../FL/Fl_FileBrowser.H
@@ -93,6 +93,7 @@ Fl_HelpView.o: ../FL/Fl_HelpView.H ../FL/Fl.H ../FL/Enumerations.H
Fl_HelpView.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H
Fl_HelpView.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
Fl_HelpView.o: ../FL/fl_draw.H ../config.h ../FL/Fl_Image.H ../FL/Fl_Pixmap.H
+Fl_HelpView.o: ../FL/Fl_Image.H
Fl_Image.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_draw.H
Fl_Image.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Fl_Widget.H
Fl_Image.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H
@@ -137,6 +138,7 @@ Fl_Pack.o: ../FL/Fl_Group.H ../FL/fl_draw.H
Fl_Pixmap.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Pixmap.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Fl_Widget.H
Fl_Pixmap.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Pixmap.H
+Fl_Pixmap.o: ../FL/Fl_Image.H
Fl_Positioner.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Positioner.o: ../FL/Fl_Positioner.H ../FL/Fl_Widget.H ../FL/fl_draw.H
Fl_Repeat_Button.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
@@ -195,6 +197,7 @@ Fl_Value_Slider.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H
Fl_Value_Slider.o: ../FL/Fl_Valuator.H ../FL/Fl_Widget.H ../FL/fl_draw.H
Fl_Widget.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Widget.o: ../FL/Fl_Widget.H ../FL/Fl_Group.H ../FL/Fl_Tooltip.H
+Fl_Widget.o: ../FL/fl_draw.H
Fl_Window.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Window.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
Fl_Window_fullscreen.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
@@ -256,6 +259,7 @@ fl_curve.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Export.H
fl_diamond_box.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
fl_diamond_box.o: ../FL/fl_draw.H
fl_draw.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Export.H
+fl_draw.o: ../FL/Fl_Image.H
fl_draw_image.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
fl_draw_image.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H Fl_XColor.H
fl_draw_image.o: ../config.h ../FL/Enumerations.H
@@ -314,13 +318,13 @@ forms_compatability.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
forms_compatability.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
forms_compatability.o: ../FL/Fl_Window.H ../FL/fl_draw.H
forms_compatability.o: ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H
-forms_compatability.o: ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H
-forms_compatability.o: ../FL/Fl_Box.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
-forms_compatability.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
-forms_compatability.o: ../FL/Fl_Valuator.H ../FL/Fl_Button.H
-forms_compatability.o: ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H
-forms_compatability.o: ../FL/Fl_Check_Button.H ../FL/Fl_Chart.H
-forms_compatability.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
+forms_compatability.o: ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H
+forms_compatability.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
+forms_compatability.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
+forms_compatability.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
+forms_compatability.o: ../FL/Fl_Button.H ../FL/Fl_Light_Button.H
+forms_compatability.o: ../FL/Fl_Round_Button.H ../FL/Fl_Check_Button.H
+forms_compatability.o: ../FL/Fl_Chart.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
forms_compatability.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H
forms_compatability.o: ../FL/Fl_Counter.H ../FL/Fl_Dial.H ../FL/Fl_Free.H
forms_compatability.o: ../FL/fl_ask.H ../FL/fl_show_colormap.H
@@ -332,10 +336,10 @@ forms_compatability.o: ../FL/Fl_Return_Button.H ../FL/Fl_Repeat_Button.H
forms_bitmap.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
forms_bitmap.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
forms_bitmap.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H
-forms_bitmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H
-forms_bitmap.o: ../FL/Fl_Box.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
-forms_bitmap.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
-forms_bitmap.o: ../FL/Fl_Button.H ../FL/Fl_Light_Button.H
+forms_bitmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H
+forms_bitmap.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
+forms_bitmap.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
+forms_bitmap.o: ../FL/Fl_Valuator.H ../FL/Fl_Button.H ../FL/Fl_Light_Button.H
forms_bitmap.o: ../FL/Fl_Round_Button.H ../FL/Fl_Check_Button.H
forms_bitmap.o: ../FL/Fl_Chart.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
forms_bitmap.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H ../FL/Fl_Counter.H
@@ -349,25 +353,25 @@ forms_free.o: ../FL/Fl_Free.H ../FL/Fl_Widget.H
forms_fselect.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
forms_fselect.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
forms_fselect.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H
-forms_fselect.o: ../FL/Fl_Bitmap.H ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H
-forms_fselect.o: ../FL/Fl_Box.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
-forms_fselect.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
-forms_fselect.o: ../FL/Fl_Button.H ../FL/Fl_Light_Button.H
-forms_fselect.o: ../FL/Fl_Round_Button.H ../FL/Fl_Check_Button.H
-forms_fselect.o: ../FL/Fl_Chart.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
-forms_fselect.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H ../FL/Fl_Counter.H
-forms_fselect.o: ../FL/Fl_Dial.H ../FL/Fl_Free.H ../FL/fl_ask.H
-forms_fselect.o: ../FL/fl_show_colormap.H ../FL/filename.H
+forms_fselect.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H
+forms_fselect.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
+forms_fselect.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
+forms_fselect.o: ../FL/Fl_Valuator.H ../FL/Fl_Button.H
+forms_fselect.o: ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H
+forms_fselect.o: ../FL/Fl_Check_Button.H ../FL/Fl_Chart.H ../FL/Fl_Choice.H
+forms_fselect.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H
+forms_fselect.o: ../FL/Fl_Counter.H ../FL/Fl_Dial.H ../FL/Fl_Free.H
+forms_fselect.o: ../FL/fl_ask.H ../FL/fl_show_colormap.H ../FL/filename.H
forms_fselect.o: ../FL/fl_file_chooser.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
forms_fselect.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Positioner.H
forms_fselect.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H
forms_pixmap.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
forms_pixmap.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
forms_pixmap.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H
-forms_pixmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H
-forms_pixmap.o: ../FL/Fl_Box.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
-forms_pixmap.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
-forms_pixmap.o: ../FL/Fl_Button.H ../FL/Fl_Light_Button.H
+forms_pixmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H
+forms_pixmap.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
+forms_pixmap.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
+forms_pixmap.o: ../FL/Fl_Valuator.H ../FL/Fl_Button.H ../FL/Fl_Light_Button.H
forms_pixmap.o: ../FL/Fl_Round_Button.H ../FL/Fl_Check_Button.H
forms_pixmap.o: ../FL/Fl_Chart.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
forms_pixmap.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H ../FL/Fl_Counter.H
@@ -378,13 +382,27 @@ forms_pixmap.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Positioner.H
forms_pixmap.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H
forms_timer.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
forms_timer.o: ../FL/Fl_Timer.H ../FL/Fl_Widget.H ../FL/fl_draw.H
-Fl_Gl_Choice.o: ../config.h
-Fl_Gl_Overlay.o: ../config.h
-Fl_Gl_Window.o: ../config.h
-gl_draw.o: ../config.h
-gl_start.o: ../config.h
-glut_compatability.o: ../config.h
-glut_font.o: ../config.h
+Fl_Gl_Choice.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
+Fl_Gl_Choice.o: ../FL/x.H ../FL/Fl_Window.H Fl_Gl_Choice.H
+Fl_Gl_Overlay.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H
+Fl_Gl_Overlay.o: ../FL/Fl_Export.H ../FL/x.H ../FL/Fl_Window.H Fl_Gl_Choice.H
+Fl_Gl_Overlay.o: ../FL/Fl_Gl_Window.H
+Fl_Gl_Window.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
+Fl_Gl_Window.o: ../FL/x.H ../FL/Fl_Window.H Fl_Gl_Choice.H
+Fl_Gl_Window.o: ../FL/Fl_Gl_Window.H
+gl_draw.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
+gl_draw.o: ../FL/gl.h ../FL/x.H ../FL/Fl_Window.H ../FL/fl_draw.H
+gl_draw.o: Fl_Gl_Choice.H Fl_Font.H
+gl_start.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
+gl_start.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/x.H
+gl_start.o: ../FL/Fl_Window.H ../FL/fl_draw.H Fl_Gl_Choice.H
+glut_compatability.o: ../config.h ../FL/glut.H ../FL/gl.h
+glut_compatability.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl.H
+glut_compatability.o: ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H
+glut_compatability.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H
+glut_font.o: ../config.h ../FL/glut.H ../FL/gl.h ../FL/Enumerations.H
+glut_font.o: ../FL/Fl_Export.H ../FL/Fl.H ../FL/Fl_Gl_Window.H
+glut_font.o: ../FL/Fl_Window.H
scandir.o: ../config.h
numericsort.o: ../config.h
vsnprintf.o: ../config.h