diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-12-02 15:47:30 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-12-02 15:47:30 +0000 |
| commit | 92402e682a1dc89c8915f1a4f5698d1c3ab82eb8 (patch) | |
| tree | 8c05965a36c0802d98572b4fa189bcc033e598e8 /src | |
| parent | 849e11623e44a62599d62ba9425f7e96146f555d (diff) | |
Fix for numericsort(), and drawing of some box types.
git-svn-id: file:///fltk/svn/fltk/trunk@107 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Scroll.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_win32.cxx | 8 | ||||
| -rw-r--r-- | src/fl_boxtype.cxx | 10 | ||||
| -rw-r--r-- | src/numericsort.c | 39 |
4 files changed, 36 insertions, 29 deletions
diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx index 9f0c18738..dfb7b939d 100644 --- a/src/Fl_Scroll.cxx +++ b/src/Fl_Scroll.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Scroll.cxx,v 1.5 1998/11/18 18:38:32 mike Exp $" +// "$Id: Fl_Scroll.cxx,v 1.6 1998/12/02 15:47:29 mike Exp $" // // Scroll widget for the Fast Light Tool Kit (FLTK). // @@ -153,12 +153,12 @@ void Fl_Scroll::draw() { scrollbar.resize(scrollbar.align()&FL_ALIGN_LEFT ? X-scrollbar.w() : X+W, Y, scrollbar.w(), H); - scrollbar.value(oldy = yposition_ = (Y-t), H, t, b-t); + scrollbar.value(oldy = yposition_ = (Y-t), H, 0, b-t); hscrollbar.resize(X, scrollbar.align()&FL_ALIGN_TOP ? Y-hscrollbar.h() : Y+H, W, hscrollbar.h()); - hscrollbar.value(oldx = xposition_ = (X-l), W, l, r-l); + hscrollbar.value(oldx = xposition_ = (X-l), W, 0, r-l); // draw the scrollbars: if (d & FL_DAMAGE_ALL) { @@ -231,5 +231,5 @@ int Fl_Scroll::handle(int event) { } // -// End of "$Id: Fl_Scroll.cxx,v 1.5 1998/11/18 18:38:32 mike Exp $". +// End of "$Id: Fl_Scroll.cxx,v 1.6 1998/12/02 15:47:29 mike Exp $". // diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index ff8e9844a..073aa5a73 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_win32.cxx,v 1.17 1998/11/08 17:02:39 mike Exp $" +// "$Id: Fl_win32.cxx,v 1.18 1998/12/02 15:47:29 mike Exp $" // // WIN32-specific code for the Fast Light Tool Kit (FLTK). // @@ -220,9 +220,9 @@ static int ms2fltk(int vk, int extended) { for (i = 0; i < sizeof(vktab)/sizeof(*vktab); i++) { vklut[vktab[i].vk] = vktab[i].fltk; extendedlut[vktab[i].vk] = vktab[i].extended; - } - for (i = 0; i < 256; i++) if (!extendedlut[i]) extendedlut[i] = vklut[i]; } + for (i = 0; i < 256; i++) if (!extendedlut[i]) extendedlut[i] = vklut[i]; + } return extended ? extendedlut[vk] : vklut[vk]; } @@ -813,5 +813,5 @@ void Fl_Window::flush() { } // -// End of "$Id: Fl_win32.cxx,v 1.17 1998/11/08 17:02:39 mike Exp $". +// End of "$Id: Fl_win32.cxx,v 1.18 1998/12/02 15:47:29 mike Exp $". // diff --git a/src/fl_boxtype.cxx b/src/fl_boxtype.cxx index 6666e53c9..f483b2d8e 100644 --- a/src/fl_boxtype.cxx +++ b/src/fl_boxtype.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_boxtype.cxx,v 1.5 1998/11/08 15:05:46 mike Exp $" +// "$Id: fl_boxtype.cxx,v 1.6 1998/12/02 15:47:30 mike Exp $" // // Box drawing code for the Fast Light Tool Kit (FLTK). // @@ -120,9 +120,9 @@ void fl_up_frame(int x, int y, int w, int h, Fl_Color) { fl_frame2("HHWW",x,y,w,h); #else #if BORDER_WIDTH == 2 - fl_frame2("AAUWMMSS",x,y,w,h); + fl_frame2("AAUWMMTT",x,y,w,h); #else - fl_frame("AAAAWUJJUSNN",x,y,w,h); + fl_frame("AAAAWUJJUTNN",x,y,w,h); #endif #endif } @@ -142,7 +142,7 @@ void fl_down_frame(int x, int y, int w, int h, Fl_Color) { #if BORDER_WIDTH == 2 fl_frame2("UWMMPPAA",x,y,w,h); #else - fl_frame("NNSUJJUWAAAA",x,y,w,h); + fl_frame("NNTUJJUWAAAA",x,y,w,h); #endif #endif } @@ -282,5 +282,5 @@ const { } // -// End of "$Id: fl_boxtype.cxx,v 1.5 1998/11/08 15:05:46 mike Exp $". +// End of "$Id: fl_boxtype.cxx,v 1.6 1998/12/02 15:47:30 mike Exp $". // diff --git a/src/numericsort.c b/src/numericsort.c index 3369f863d..00992097f 100644 --- a/src/numericsort.c +++ b/src/numericsort.c @@ -1,5 +1,5 @@ /* - * "$Id: numericsort.c,v 1.7 1998/11/09 16:25:59 mike Exp $" + * "$Id: numericsort.c,v 1.8 1998/12/02 15:47:30 mike Exp $" * * Numeric sorting routine for the Fast Light Tool Kit (FLTK). * @@ -56,26 +56,33 @@ extern "C" int numericsort(struct dirent **A, struct dirent **B) { const char* a = (*A)->d_name; const char* b = (*B)->d_name; - + int ret = 0; for (;;) { if (isdigit(*a) && isdigit(*b)) { - int anum = 0, bnum = 0; - - while (isdigit(*a)) anum = anum * 10 + *a++ - '0'; - while (isdigit(*b)) bnum = bnum * 10 + *b++ - '0'; - - if (anum < bnum) return (-1); - else if (anum > bnum) return (1); - } else if (tolower(*a) < tolower(*b)) return (-1); - else if (tolower(*a) > tolower(*b)) return (1); - else { - if (*a == '\0') return (0); - a++; - b++; + int diff,magdiff; + while (*a == '0') a++; + while (*b == '0') b++; + while (isdigit(*a) && *a == *b) {a++; b++;} + diff = (isdigit(*a) && isdigit(*b)) ? *a - *b : 0; + magdiff = 0; + while (isdigit(*a)) {magdiff++; a++;} + while (isdigit(*b)) {magdiff--; b++;} + if (magdiff) {ret = magdiff; break;} /* compare # of significant digits*/ + if (diff) {ret = diff; break;} /* compare first non-zero digit */ + } else { +#if 1 + if ((ret = tolower(*a)-tolower(*b))) break; /* compare case-insensitve */ +#else + if ((ret = *a-*b)) break; /* compare case-sensitive */ +#endif + if (!*a) break; + a++; b++; } } + if (!ret) return 0; + else return (ret < 0) ? -1 : 1; } /* - * End of "$Id: numericsort.c,v 1.7 1998/11/09 16:25:59 mike Exp $". + * End of "$Id: numericsort.c,v 1.8 1998/12/02 15:47:30 mike Exp $". */ |
