summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2004-02-26 03:06:41 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2004-02-26 03:06:41 +0000
commit1b840383451e10c18508bd51f44f39789383504b (patch)
tree4151d8919edda206972cdd26be8aa0082be04817
parent7615da84bb83093a0cfa925b9b8004c385074e62 (diff)
WIN32's scandir() emulation did not allocate enough memory for
directory names (STR #263) Fl::compose() did not handle special keys like backspace properly (STR #293) Fl_Choice did not clip its text when drawing using the plastic scheme (STR #287) Fl_Group incorrectly mapped the emacs CTRL keys to keyboard navigation (STR #228) Fl_File_Browser::load() didn't handle a NULL directory name (STR #266) 64-bit library fixes (STR #261, ) The Fl_Valuator::format() function did not limit the size of the number buffer (STR #268) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3211 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES13
-rw-r--r--src/Fl_Choice.cxx49
-rw-r--r--src/Fl_File_Browser.cxx8
-rw-r--r--src/Fl_Group.cxx11
-rw-r--r--src/Fl_Valuator.cxx8
-rw-r--r--src/Fl_compose.cxx5
-rw-r--r--src/Fl_x.cxx6
-rw-r--r--src/scandir_win32.c6
8 files changed, 61 insertions, 45 deletions
diff --git a/CHANGES b/CHANGES
index bcdaa822b..a3ad36682 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,18 @@
CHANGES IN FLTK 1.1.5rc1
+ - WIN32's scandir() emulation did not allocate enough
+ memory for directory names (STR #263)
+ - Fl::compose() did not handle special keys like
+ backspace properly (STR #293)
+ - Fl_Choice did not clip its text when drawing using the
+ plastic scheme (STR #287)
+ - Fl_Group incorrectly mapped the emacs CTRL keys to
+ keyboard navigation (STR #228)
+ - Fl_File_Browser::load() didn't handle a NULL directory
+ name (STR #266)
+ - 64-bit library fixes (STR #261, )
+ - The Fl_Valuator::format() function did not limit the
+ size of the number buffer (STR #268)
- The keypad Enter key works as the normal Enter/Return
key in common widgets (STR #191)
- Doco fixes (STR #186)
diff --git a/src/Fl_Choice.cxx b/src/Fl_Choice.cxx
index d14315e54..0186f9c1b 100644
--- a/src/Fl_Choice.cxx
+++ b/src/Fl_Choice.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Choice.cxx,v 1.10.2.5.2.14 2003/08/24 13:09:06 easysw Exp $"
+// "$Id: Fl_Choice.cxx,v 1.10.2.5.2.15 2004/02/26 03:06:40 easysw Exp $"
//
// Choice widget for the Fast Light Tool Kit (FLTK).
//
@@ -66,30 +66,31 @@ void Fl_Choice::draw() {
// ERCO
int xx = x() + dx, yy = y() + dy + 1, ww = w() - W, hh = H - 2;
- if ( Fl::scheme() )
- {
- Fl_Label l;
- l.value = m.text;
- l.image = 0;
- l.deimage = 0;
- l.type = m.labeltype_;
- l.font = m.labelsize_ || m.labelfont_ ? m.labelfont_ : uchar(textfont());
- l.size = m.labelsize_ ? m.labelsize_ : textsize();
- l.color= m.labelcolor_ ? m.labelcolor_ : textcolor();
- if (!m.active()) l.color = fl_inactive((Fl_Color)l.color);
- fl_draw_shortcut = 2; // hack value to make '&' disappear
- l.draw(xx+3, yy, ww>6 ? ww-6 : 0, hh, FL_ALIGN_LEFT);
- fl_draw_shortcut = 0;
- if ( Fl::focus() == this ) draw_focus(box(), xx, yy, ww, hh);
+
+ fl_clip(xx, yy, ww, hh);
+
+ if ( Fl::scheme()) {
+ Fl_Label l;
+ l.value = m.text;
+ l.image = 0;
+ l.deimage = 0;
+ l.type = m.labeltype_;
+ l.font = m.labelsize_ || m.labelfont_ ? m.labelfont_ : uchar(textfont());
+ l.size = m.labelsize_ ? m.labelsize_ : textsize();
+ l.color= m.labelcolor_ ? m.labelcolor_ : textcolor();
+ if (!m.active()) l.color = fl_inactive((Fl_Color)l.color);
+ fl_draw_shortcut = 2; // hack value to make '&' disappear
+ l.draw(xx+3, yy, ww>6 ? ww-6 : 0, hh, FL_ALIGN_LEFT);
+ fl_draw_shortcut = 0;
+ if ( Fl::focus() == this ) draw_focus(box(), xx, yy, ww, hh);
}
- else
- {
- fl_clip(xx, yy, ww, hh);
- fl_draw_shortcut = 2; // hack value to make '&' disappear
- m.draw(xx, yy, ww, hh, this, Fl::focus() == this);
- fl_draw_shortcut = 0;
- fl_pop_clip();
+ else {
+ fl_draw_shortcut = 2; // hack value to make '&' disappear
+ m.draw(xx, yy, ww, hh, this, Fl::focus() == this);
+ fl_draw_shortcut = 0;
}
+
+ fl_pop_clip();
}
draw_label();
@@ -151,5 +152,5 @@ int Fl_Choice::handle(int e) {
}
//
-// End of "$Id: Fl_Choice.cxx,v 1.10.2.5.2.14 2003/08/24 13:09:06 easysw Exp $".
+// End of "$Id: Fl_Choice.cxx,v 1.10.2.5.2.15 2004/02/26 03:06:40 easysw Exp $".
//
diff --git a/src/Fl_File_Browser.cxx b/src/Fl_File_Browser.cxx
index 6052fa99d..b9c21fb52 100644
--- a/src/Fl_File_Browser.cxx
+++ b/src/Fl_File_Browser.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_File_Browser.cxx,v 1.1.2.26 2003/05/04 21:45:45 easysw Exp $"
+// "$Id: Fl_File_Browser.cxx,v 1.1.2.27 2004/02/26 03:06:40 easysw Exp $"
//
// Fl_File_Browser routines.
//
@@ -421,8 +421,12 @@ Fl_File_Browser::load(const char *directory,// I - Directory to load
// printf("Fl_File_Browser::load(\"%s\")\n", directory);
clear();
+
directory_ = directory;
+ if (!directory)
+ return (0);
+
if (directory_[0] == '\0')
{
//
@@ -639,5 +643,5 @@ Fl_File_Browser::filter(const char *pattern) // I - Pattern string
//
-// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.26 2003/05/04 21:45:45 easysw Exp $".
+// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.27 2004/02/26 03:06:40 easysw Exp $".
//
diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx
index d742601b4..014c4a2d7 100644
--- a/src/Fl_Group.cxx
+++ b/src/Fl_Group.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Group.cxx,v 1.8.2.8.2.22 2003/11/01 01:49:35 easysw Exp $"
+// "$Id: Fl_Group.cxx,v 1.8.2.8.2.23 2004/02/26 03:06:40 easysw Exp $"
//
// Group widget for the Fast Light Tool Kit (FLTK).
//
@@ -106,13 +106,6 @@ static int navkey() {
return FL_Up;
case FL_Down:
return FL_Down;
- default:
- switch (Fl::event_text()[0]) {
- case ctrl('N') : return FL_Down;
- case ctrl('P') : return FL_Up;
- case ctrl('F') : return FL_Right;
- case ctrl('B') : return FL_Left;
- }
}
return 0;
}
@@ -593,5 +586,5 @@ void Fl_Group::draw_outside_label(const Fl_Widget& widget) const {
}
//
-// End of "$Id: Fl_Group.cxx,v 1.8.2.8.2.22 2003/11/01 01:49:35 easysw Exp $".
+// End of "$Id: Fl_Group.cxx,v 1.8.2.8.2.23 2004/02/26 03:06:40 easysw Exp $".
//
diff --git a/src/Fl_Valuator.cxx b/src/Fl_Valuator.cxx
index ace987b39..e9148f14e 100644
--- a/src/Fl_Valuator.cxx
+++ b/src/Fl_Valuator.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.6 2003/01/30 21:42:53 easysw Exp $"
+// "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.7 2004/02/26 03:06:40 easysw Exp $"
//
// Valuator widget for the Fast Light Tool Kit (FLTK).
//
@@ -29,6 +29,7 @@
#include <FL/Fl_Valuator.H>
#include <FL/math.h>
#include <stdio.h>
+#include "flstring.h"
Fl_Valuator::Fl_Valuator(int X, int Y, int W, int H, const char* L)
: Fl_Widget(X,Y,W,H,L) {
@@ -115,7 +116,8 @@ double Fl_Valuator::increment(double v, int n) {
int Fl_Valuator::format(char* buffer) {
double v = value();
- if (!A) return sprintf(buffer, "%g", v);
+ // MRS: THIS IS A HACK - RECOMMEND ADDING BUFFER SIZE ARGUMENT
+ if (!A) return snprintf(buffer, 128, "%g", v);
int i, X;
double ba = B / A;
for (X = 1, i = 0; X < ba; X *= 10) i++;
@@ -123,5 +125,5 @@ int Fl_Valuator::format(char* buffer) {
}
//
-// End of "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.6 2003/01/30 21:42:53 easysw Exp $".
+// End of "$Id: Fl_Valuator.cxx,v 1.5.2.4.2.7 2004/02/26 03:06:40 easysw Exp $".
//
diff --git a/src/Fl_compose.cxx b/src/Fl_compose.cxx
index 277a26c53..2be09f890 100644
--- a/src/Fl_compose.cxx
+++ b/src/Fl_compose.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_compose.cxx,v 1.1.2.7.2.4 2003/05/20 15:29:42 easysw Exp $"
+// "$Id: Fl_compose.cxx,v 1.1.2.7.2.5 2004/02/26 03:06:40 easysw Exp $"
//
// Character compose processing for the Fast Light Tool Kit (FLTK).
//
@@ -91,6 +91,9 @@ int Fl::compose(int& del) {
e_text[0] = char(0xA0);
compose_state = 0;
return 1;
+ } else if (ascii < ' ' || ascii == 127) {
+ compose_state = 0;
+ return 0;
}
// see if it is either character of any pair:
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index 409ac2d14..968e9b336 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_x.cxx,v 1.24.2.24.2.30 2003/06/15 04:27:35 easysw Exp $"
+// "$Id: Fl_x.cxx,v 1.24.2.24.2.31 2004/02/26 03:06:41 easysw Exp $"
//
// X specific code for the Fast Light Tool Kit (FLTK).
//
@@ -1085,7 +1085,7 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap)
}
// Make it receptive to DnD:
- int version = 4;
+ long version = 4;
XChangeProperty(fl_display, xp->xid, fl_XdndAware,
XA_ATOM, sizeof(int)*8, 0, (unsigned char*)&version, 1);
@@ -1268,5 +1268,5 @@ void Fl_Window::make_current() {
#endif
//
-// End of "$Id: Fl_x.cxx,v 1.24.2.24.2.30 2003/06/15 04:27:35 easysw Exp $".
+// End of "$Id: Fl_x.cxx,v 1.24.2.24.2.31 2004/02/26 03:06:41 easysw Exp $".
//
diff --git a/src/scandir_win32.c b/src/scandir_win32.c
index 9c5612f23..da81f871b 100644
--- a/src/scandir_win32.c
+++ b/src/scandir_win32.c
@@ -1,5 +1,5 @@
/*
- * "$Id: scandir_win32.c,v 1.11.2.4.2.7 2003/05/28 16:38:09 matthiaswm Exp $"
+ * "$Id: scandir_win32.c,v 1.11.2.4.2.8 2004/02/26 03:06:41 easysw Exp $"
*
* WIN32 scandir function for the Fast Light Tool Kit (FLTK).
*
@@ -64,7 +64,7 @@ int fl_scandir(const char *dirname, struct dirent ***namelist,
return nDir;
}
do {
- selectDir=(struct dirent*)malloc(sizeof(struct dirent)+strlen(find.cFileName)+1);
+ selectDir=(struct dirent*)malloc(sizeof(struct dirent)+strlen(find.cFileName)+2);
strcpy(selectDir->d_name, find.cFileName);
if (find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
// Append a trailing slash to directory names...
@@ -104,5 +104,5 @@ int fl_scandir(const char *dirname, struct dirent ***namelist,
#endif
/*
- * End of "$Id: scandir_win32.c,v 1.11.2.4.2.7 2003/05/28 16:38:09 matthiaswm Exp $".
+ * End of "$Id: scandir_win32.c,v 1.11.2.4.2.8 2004/02/26 03:06:41 easysw Exp $".
*/