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
This commit is contained in:
Bill Spitzak 2000-06-15 05:37:40 +00:00
parent 43b5617c47
commit 4ab82443bd
4 changed files with 64 additions and 58 deletions

View File

@ -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). // GLUT emulation header file for the Fast Light Tool Kit (FLTK).
// //
@ -405,7 +405,7 @@ int glutLayerGet(GLenum);
// Emulated Glut drawing functions: // Emulated Glut drawing functions:
// Font argument must be a void* for compatability, so... // 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, glutBitmap9By15, glutBitmap8By13, glutBitmapTimesRoman10,
glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12, glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12,
glutBitmapHelvetica18; glutBitmapHelvetica18;
@ -428,44 +428,44 @@ FL_EXPORT int glutBitmapWidth(void *font, int character);
extern "C" { extern "C" {
extern int glutExtensionSupported(char *name); extern FL_EXPORT int glutExtensionSupported(char *name);
/* Stroke font opaque addresses (use constants instead in source code). */ /* Stroke font opaque addresses (use constants instead in source code). */
extern void *glutStrokeRoman; extern FL_EXPORT void *glutStrokeRoman;
extern void *glutStrokeMonoRoman; extern FL_EXPORT void *glutStrokeMonoRoman;
/* Stroke font constants (use these in GLUT program). */ /* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN (&glutStrokeRoman) #define GLUT_STROKE_ROMAN (&glutStrokeRoman)
#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) #define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
/* GLUT font sub-API */ /* GLUT font sub-API */
extern void glutStrokeCharacter(void *font, int character); extern FL_EXPORT void glutStrokeCharacter(void *font, int character);
extern int glutStrokeWidth(void *font, int character); extern FL_EXPORT int glutStrokeWidth(void *font, int character);
/* GLUT pre-built models sub-API */ /* GLUT pre-built models sub-API */
extern void glutWireSphere(GLdouble radius, GLint slices, GLint stacks); extern FL_EXPORT void glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
extern void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); extern FL_EXPORT void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
extern void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); extern FL_EXPORT void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
extern void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); extern FL_EXPORT void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
extern void glutWireCube(GLdouble size); extern FL_EXPORT void glutWireCube(GLdouble size);
extern void glutSolidCube(GLdouble size); extern FL_EXPORT void glutSolidCube(GLdouble size);
extern void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); extern FL_EXPORT void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
extern void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); extern FL_EXPORT void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
extern void glutWireDodecahedron(); extern FL_EXPORT void glutWireDodecahedron();
extern void glutSolidDodecahedron(); extern FL_EXPORT void glutSolidDodecahedron();
extern void glutWireTeapot(GLdouble size); extern FL_EXPORT void glutWireTeapot(GLdouble size);
extern void glutSolidTeapot(GLdouble size); extern FL_EXPORT void glutSolidTeapot(GLdouble size);
extern void glutWireOctahedron(); extern FL_EXPORT void glutWireOctahedron();
extern void glutSolidOctahedron(); extern FL_EXPORT void glutSolidOctahedron();
extern void glutWireTetrahedron(); extern FL_EXPORT void glutWireTetrahedron();
extern void glutSolidTetrahedron(); extern FL_EXPORT void glutSolidTetrahedron();
extern void glutWireIcosahedron(); extern FL_EXPORT void glutWireIcosahedron();
extern void glutSolidIcosahedron(); extern FL_EXPORT void glutSolidIcosahedron();
} }
#endif /* __glut_h__ */ #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 $".
// //

View File

@ -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 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 same pixmap are assummed to have the same color. This may be fixed in
the future or on non-X systems. </P> the future or on non-X systems. </P>
<P>I have not found any good editors for small iconic pictures. For
pixmaps I have used <A href="http://www.image.dk/~torsten/xpaint/index.html"> <P>I have not found any good editors for small iconic pictures. For
XPaint</A>. This (and most other) painting programs are designed for pixmaps I have used <A
large full color images and are difficult to use to edit an image of href="http://home.worldonline.dk/~torsten/xpaint/index.html">XPaint</A>.
small size and few colors. </P> 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. </P>
<H4>GIF files</H4> <H4>GIF files</H4>
FLUID will also read GIF image files. These files are often used on 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 html documents to make icons. This lets you use nice icons that you

View File

@ -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). // 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) { void Fl_Slider::draw(int x, int y, int w, int h) {
double val;
double val;
if (minimum() == maximum()) if (minimum() == maximum())
val = 0.5; val = 0.5;
else { 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; if (!Fl::event_inside(x, y, w, h)) return 0;
handle_push(); handle_push();
case FL_DRAG: { 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 = double val;
(maximum()-minimum()) ? (value()-minimum())/(maximum()-minimum()) : 0.5; 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 (type() == FL_HOR_FILL_SLIDER || type() == FL_VERT_FILL_SLIDER) {
if (val >= 1.0) X = W; S = 0;
else if (val <= 0.0) X = 0;
else X = int(val*W+.5);
if (event == FL_PUSH) { if (event == FL_PUSH) {
int X = int(val*W+.5);
offcenter = mx-X; offcenter = mx-X;
if (offcenter < -S/2) offcenter = 0; if (offcenter < -10 || offcenter > 10) offcenter = 0;
else if (offcenter > S/2) offcenter = 0;
else return 1; else return 1;
} }
S = 0;
} else { } else {
if (val >= 1.0) X = W-S; S = int(slider_size_*W+.5); if (S >= W) return 0;
else if (val <= 0.0) X = 0; int T = (horizontal() ? h : w)/2+1;
else X = int(val*(W-S)+.5); if (type()==FL_VERT_NICE_SLIDER || type()==FL_HOR_NICE_SLIDER) T += 4;
if (S < T) S = T;
if (event == FL_PUSH) { if (event == FL_PUSH) {
int X = int(val*(W-S)+.5);
offcenter = mx-X; offcenter = mx-X;
if (offcenter < 0) offcenter = 0; if (offcenter < 0) offcenter = 0;
else if (offcenter > S) offcenter = S; else if (offcenter > S) offcenter = S;
else return 1; else return 1;
} }
} }
X = mx-offcenter;
int X = mx-offcenter;
double v; double v;
TRY_AGAIN: TRY_AGAIN:
if (X < 0) { 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 $".
// //

View File

@ -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). // Shortcut support routines for the Fast Light Tool Kit (FLTK).
// //
@ -41,6 +41,7 @@
#include <FL/Fl.H> #include <FL/Fl.H>
#include <FL/Fl_Widget.H> #include <FL/Fl_Widget.H>
#include <FL/Fl_Button.H>
#include <FL/fl_draw.H> #include <FL/fl_draw.H>
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
@ -48,8 +49,6 @@
#include <FL/x.H> #include <FL/x.H>
#endif #endif
extern FL_EXPORT int fl_old_shortcut(const char*);
int Fl::test_shortcut(int shortcut) { int Fl::test_shortcut(int shortcut) {
if (!shortcut) return 0; 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 $".
// //