Skip to content

Commit

Permalink
WIN32's scandir() emulation did not allocate enough memory for
Browse files Browse the repository at this point in the history
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
  • Loading branch information
michaelrsweet committed Feb 26, 2004
1 parent 7615da8 commit 1b84038
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 45 deletions.
13 changes: 13 additions & 0 deletions 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)
Expand Down
49 changes: 25 additions & 24 deletions 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).
//
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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 $".
//
8 changes: 6 additions & 2 deletions 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.
//
Expand Down Expand Up @@ -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')
{
//
Expand Down Expand Up @@ -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 $".
//
11 changes: 2 additions & 9 deletions 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).
//
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 $".
//
8 changes: 5 additions & 3 deletions 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).
//
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -115,13 +116,14 @@ 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++;
return sprintf(buffer, "%.*f", i, v);
}

//
// 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 $".
//
5 changes: 4 additions & 1 deletion 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).
//
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions 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).
//
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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 $".
//
6 changes: 3 additions & 3 deletions 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).
*
Expand Down Expand Up @@ -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...
Expand Down Expand Up @@ -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 $".
*/

0 comments on commit 1b84038

Please sign in to comment.