summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-12-21 15:50:49 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-12-21 15:50:49 +0000
commitb7be2be5e629579880f7e8c02c50ded96debcc3b (patch)
treef75d60a6f1badf53cef6cebf93dafd2b62f67c2a /src
parentb7c23bc5e113a426c07a48d39f65db70224439ea (diff)
Assign broken image when Fl_Shared_Image::get() returns NULL.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1890 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Help_View.cxx53
1 files changed, 50 insertions, 3 deletions
diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx
index 832a206b4..85d2520fa 100644
--- a/src/Fl_Help_View.cxx
+++ b/src/Fl_Help_View.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Help_View.cxx,v 1.1.2.23 2001/12/19 18:15:34 easysw Exp $"
+// "$Id: Fl_Help_View.cxx,v 1.1.2.24 2001/12/21 15:50:49 easysw Exp $"
//
// Fl_Help_View widget routines.
//
@@ -54,6 +54,7 @@
//
#include <FL/Fl_Help_View.H>
+#include <FL/Fl_Pixmap.H>
#include <stdio.h>
#include <stdlib.h>
#include "flstring.h"
@@ -90,6 +91,48 @@ static void hscrollbar_callback(Fl_Widget *s, void *);
//
+// Broken image...
+//
+
+static const char *broken_xpm[] =
+ {
+ "16 24 4 1",
+ "@ c #000000",
+ " c #ffffff",
+ "+ c none",
+ "x c #ff0000",
+ // pixels
+ "@@@@@@@+++++++++",
+ "@ @++++++++++",
+ "@ @+++++++++++",
+ "@ @++@++++++++",
+ "@ @@+++++++++",
+ "@ @+++@+++++",
+ "@ @++@@++++@",
+ "@ xxx @@ @++@@",
+ "@ xxx xx@@ @",
+ "@ xxx xxx @",
+ "@ xxxxxx @",
+ "@ xxxx @",
+ "@ xxxxxx @",
+ "@ xxx xxx @",
+ "@ xxx xxx @",
+ "@ xxx xxx @",
+ "@ @",
+ "@ @",
+ "@ @",
+ "@ @",
+ "@ @",
+ "@ @",
+ "@ @",
+ "@@@@@@@@@@@@@@@@",
+ NULL
+ };
+
+static Fl_Pixmap broken_image(broken_xpm);
+
+
+//
// 'Fl_Help_View::add_block()' - Add a text block to the list.
//
@@ -1967,6 +2010,7 @@ Fl_Help_View::get_image(const char *name, int W, int H) {
char dir[1024]; // Current directory
char temp[1024], // Temporary filename
*tempptr; // Pointer into temporary name
+ Fl_Shared_Image *ip; // Image pointer...
// See if the image can be found...
if (strchr(directory_, ':') != NULL && strchr(name, ':') == NULL) {
@@ -1994,7 +2038,10 @@ Fl_Help_View::get_image(const char *name, int W, int H) {
if (strncmp(localname, "file:", 5) == 0) localname += 5;
- return Fl_Shared_Image::get(localname, W, H);
+ if ((ip = Fl_Shared_Image::get(localname, W, H)) == NULL)
+ ip = (Fl_Shared_Image *)&broken_image;
+
+ return ip;
}
@@ -2569,5 +2616,5 @@ hscrollbar_callback(Fl_Widget *s, void *)
//
-// End of "$Id: Fl_Help_View.cxx,v 1.1.2.23 2001/12/19 18:15:34 easysw Exp $".
+// End of "$Id: Fl_Help_View.cxx,v 1.1.2.24 2001/12/21 15:50:49 easysw Exp $".
//