From 4ab82443bd55b96f7db233e47b94338f70c01238 Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Thu, 15 Jun 2000 05:37:40 +0000 Subject: [PATCH] Added a bunch of missing FL_EXTERN's to glut.h (I have not really tested this, but I believe this is why I keep getting mail about glut not linking on win32. If anybody can check this please do so!) Fix for sliders so that clicking on one with a small (or zero) slider_size will not move the slider. I put Fl_Button.H in fl_shortcut.cxx so that it gets the FL_EXTERN for fl_old_shortcut() (and also assures the declarations match). Fixed xpaint link in the documentation. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1212 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/glut.H | 52 ++++++++++++++++++++-------------------- documentation/fluid.html | 13 ++++++---- src/Fl_Slider.cxx | 50 ++++++++++++++++++++------------------ src/fl_shortcut.cxx | 7 +++--- 4 files changed, 64 insertions(+), 58 deletions(-) diff --git a/FL/glut.H b/FL/glut.H index 799a72398..95b320d32 100644 --- a/FL/glut.H +++ b/FL/glut.H @@ -1,5 +1,5 @@ // -// "$Id: glut.H,v 1.6.2.2 2000/06/05 21:20:34 mike Exp $" +// "$Id: glut.H,v 1.6.2.3 2000/06/15 05:33:53 bill Exp $" // // GLUT emulation header file for the Fast Light Tool Kit (FLTK). // @@ -405,7 +405,7 @@ int glutLayerGet(GLenum); // Emulated Glut drawing functions: // Font argument must be a void* for compatability, so... -extern struct Glut_Bitmap_Font {uchar font; int size;} +extern FL_EXPORT struct Glut_Bitmap_Font {uchar font; int size;} glutBitmap9By15, glutBitmap8By13, glutBitmapTimesRoman10, glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12, glutBitmapHelvetica18; @@ -428,44 +428,44 @@ FL_EXPORT int glutBitmapWidth(void *font, int character); extern "C" { -extern int glutExtensionSupported(char *name); +extern FL_EXPORT int glutExtensionSupported(char *name); /* Stroke font opaque addresses (use constants instead in source code). */ -extern void *glutStrokeRoman; -extern void *glutStrokeMonoRoman; +extern FL_EXPORT void *glutStrokeRoman; +extern FL_EXPORT void *glutStrokeMonoRoman; /* Stroke font constants (use these in GLUT program). */ #define GLUT_STROKE_ROMAN (&glutStrokeRoman) #define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) /* GLUT font sub-API */ -extern void glutStrokeCharacter(void *font, int character); -extern int glutStrokeWidth(void *font, int character); +extern FL_EXPORT void glutStrokeCharacter(void *font, int character); +extern FL_EXPORT int glutStrokeWidth(void *font, int character); /* GLUT pre-built models sub-API */ -extern void glutWireSphere(GLdouble radius, GLint slices, GLint stacks); -extern void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); -extern void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); -extern void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); -extern void glutWireCube(GLdouble size); -extern void glutSolidCube(GLdouble size); -extern void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); -extern void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); -extern void glutWireDodecahedron(); -extern void glutSolidDodecahedron(); -extern void glutWireTeapot(GLdouble size); -extern void glutSolidTeapot(GLdouble size); -extern void glutWireOctahedron(); -extern void glutSolidOctahedron(); -extern void glutWireTetrahedron(); -extern void glutSolidTetrahedron(); -extern void glutWireIcosahedron(); -extern void glutSolidIcosahedron(); +extern FL_EXPORT void glutWireSphere(GLdouble radius, GLint slices, GLint stacks); +extern FL_EXPORT void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); +extern FL_EXPORT void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +extern FL_EXPORT void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +extern FL_EXPORT void glutWireCube(GLdouble size); +extern FL_EXPORT void glutSolidCube(GLdouble size); +extern FL_EXPORT void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +extern FL_EXPORT void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +extern FL_EXPORT void glutWireDodecahedron(); +extern FL_EXPORT void glutSolidDodecahedron(); +extern FL_EXPORT void glutWireTeapot(GLdouble size); +extern FL_EXPORT void glutSolidTeapot(GLdouble size); +extern FL_EXPORT void glutWireOctahedron(); +extern FL_EXPORT void glutSolidOctahedron(); +extern FL_EXPORT void glutWireTetrahedron(); +extern FL_EXPORT void glutSolidTetrahedron(); +extern FL_EXPORT void glutWireIcosahedron(); +extern FL_EXPORT void glutSolidIcosahedron(); } #endif /* __glut_h__ */ // -// End of "$Id: glut.H,v 1.6.2.2 2000/06/05 21:20:34 mike Exp $". +// End of "$Id: glut.H,v 1.6.2.3 2000/06/15 05:33:53 bill Exp $". // diff --git a/documentation/fluid.html b/documentation/fluid.html index b4a4cc2cd..45ceb9e60 100644 --- a/documentation/fluid.html +++ b/documentation/fluid.html @@ -877,11 +877,14 @@ FLTK and FLUID simulate this transparency rather badly. It will use the color() of the widget as the background, and all widgets using the same pixmap are assummed to have the same color. This may be fixed in the future or on non-X systems.

-

I have not found any good editors for small iconic pictures. For -pixmaps I have used -XPaint. This (and most other) painting programs are designed for -large full color images and are difficult to use to edit an image of -small size and few colors.

+ +

I have not found any good editors for small iconic pictures. For +pixmaps I have used XPaint. +This (and most other) painting programs are designed for large full +color images and are difficult to use to edit an image of small size +and few colors.

+

GIF files

FLUID will also read GIF image files. These files are often used on html documents to make icons. This lets you use nice icons that you diff --git a/src/Fl_Slider.cxx b/src/Fl_Slider.cxx index 8489960aa..a58d458eb 100644 --- a/src/Fl_Slider.cxx +++ b/src/Fl_Slider.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Slider.cxx,v 1.8.2.8 2000/06/10 18:24:31 bill Exp $" +// "$Id: Fl_Slider.cxx,v 1.8.2.9 2000/06/15 05:37:39 bill Exp $" // // Slider widget for the Fast Light Tool Kit (FLTK). // @@ -95,8 +95,8 @@ void Fl_Slider::draw_bg(int x, int y, int w, int h) { } void Fl_Slider::draw(int x, int y, int w, int h) { - double val; + double val; if (minimum() == maximum()) val = 0.5; else { @@ -179,43 +179,47 @@ int Fl_Slider::handle(int event, int x, int y, int w, int h) { if (!Fl::event_inside(x, y, w, h)) return 0; handle_push(); case FL_DRAG: { - int W = (horizontal() ? w : h); - //int H = (horizontal() ? h : w); - int mx = (horizontal() ? Fl::event_x()-x : Fl::event_y()-y); - int S = int(slider_size_*W+.5); if (S >= W) return 0; - int X; - static int offcenter; - double val = - (maximum()-minimum()) ? (value()-minimum())/(maximum()-minimum()) : 0.5; + double val; + if (minimum() == maximum()) + val = 0.5; + else { + val = (value()-minimum())/(maximum()-minimum()); + if (val > 1.0) val = 1.0; + else if (val < 0.0) val = 0.0; + } + + int W = (horizontal() ? w : h); + int mx = (horizontal() ? Fl::event_x()-x : Fl::event_y()-y); + int S; + static int offcenter; if (type() == FL_HOR_FILL_SLIDER || type() == FL_VERT_FILL_SLIDER) { - if (val >= 1.0) X = W; - else if (val <= 0.0) X = 0; - else X = int(val*W+.5); - + S = 0; if (event == FL_PUSH) { + int X = int(val*W+.5); offcenter = mx-X; - if (offcenter < -S/2) offcenter = 0; - else if (offcenter > S/2) offcenter = 0; + if (offcenter < -10 || offcenter > 10) offcenter = 0; else return 1; } - S = 0; + } else { - if (val >= 1.0) X = W-S; - else if (val <= 0.0) X = 0; - else X = int(val*(W-S)+.5); - + S = int(slider_size_*W+.5); if (S >= W) return 0; + int T = (horizontal() ? h : w)/2+1; + if (type()==FL_VERT_NICE_SLIDER || type()==FL_HOR_NICE_SLIDER) T += 4; + if (S < T) S = T; if (event == FL_PUSH) { + int X = int(val*(W-S)+.5); offcenter = mx-X; if (offcenter < 0) offcenter = 0; else if (offcenter > S) offcenter = S; else return 1; } } - X = mx-offcenter; + + int X = mx-offcenter; double v; TRY_AGAIN: if (X < 0) { @@ -251,5 +255,5 @@ int Fl_Slider::handle(int event) { } // -// End of "$Id: Fl_Slider.cxx,v 1.8.2.8 2000/06/10 18:24:31 bill Exp $". +// End of "$Id: Fl_Slider.cxx,v 1.8.2.9 2000/06/15 05:37:39 bill Exp $". // diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx index ebfad4cfd..45bd22368 100644 --- a/src/fl_shortcut.cxx +++ b/src/fl_shortcut.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_shortcut.cxx,v 1.4.2.7 2000/06/14 19:57:20 mike Exp $" +// "$Id: fl_shortcut.cxx,v 1.4.2.8 2000/06/15 05:37:40 bill Exp $" // // Shortcut support routines for the Fast Light Tool Kit (FLTK). // @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -48,8 +49,6 @@ #include #endif -extern FL_EXPORT int fl_old_shortcut(const char*); - int Fl::test_shortcut(int shortcut) { if (!shortcut) return 0; @@ -193,5 +192,5 @@ int Fl_Widget::test_shortcut() { } // -// End of "$Id: fl_shortcut.cxx,v 1.4.2.7 2000/06/14 19:57:20 mike Exp $". +// End of "$Id: fl_shortcut.cxx,v 1.4.2.8 2000/06/15 05:37:40 bill Exp $". //