Fl_Scroll now uses a full redraw when the scheme is set to

plastic and the box type is a frame (STR #205)

Fl_Window::resize() did not work properly with KDE 3.2 (STR
#356)

FLTK didn't delete font bitmaps when the last OpenGL window was
deleted, preventing future text from displaying (STR #310)

FLUID didn't include a full initialization record for the
trailing NULL menu items (STR #375)

Fl_Browser::item_width() did not properly handle format
modifiers (STR #372)

Fl_Browser::item_height() did not handle columns properly (STR
#371)


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3419 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2004-05-15 22:58:19 +00:00
parent e643c17eea
commit 998f74be9f
9 changed files with 98 additions and 27 deletions

13
CHANGES
View File

@ -1,6 +1,19 @@
CHANGES IN FLTK 1.1.5rc2
- Documentation updates (STR #365)
- Fl_Scroll now uses a full redraw when the scheme is
set to plastic and the box type is a frame (STR #205)
- Fl_Window::resize() did not work properly with KDE 3.2
(STR #356)
- FLTK didn't delete font bitmaps when the last OpenGL
window was deleted, preventing future text from
displaying (STR #310)
- FLUID didn't include a full initialization record for
the trailing NULL menu items (STR #375)
- Fl_Browser::item_width() did not properly handle
format modifiers (STR #372)
- Fl_Browser::item_height() did not handle columns
properly (STR #371)
- Fl_Gl_Window's on WIN32 now prefer accelerated pixel
formats over generic formats (STR #382)
- Fl_Window::resize() did not work on some systems if

View File

@ -1,5 +1,5 @@
//
// "$Id: gl_draw.H,v 1.4.2.3.2.3 2004/04/11 04:38:55 easysw Exp $"
// "$Id: gl_draw.H,v 1.4.2.3.2.4 2004/05/15 22:58:18 easysw Exp $"
//
// OpenGL header file for the Fast Light Tool Kit (FLTK).
//
@ -25,6 +25,9 @@
#include "gl.h"
extern FL_EXPORT void gl_remove_displaylist_fonts();
//
// End of "$Id: gl_draw.H,v 1.4.2.3.2.3 2004/04/11 04:38:55 easysw Exp $".
// End of "$Id: gl_draw.H,v 1.4.2.3.2.4 2004/05/15 22:58:18 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Menu_Type.cxx,v 1.16.2.12.2.8 2004/04/11 04:38:55 easysw Exp $"
// "$Id: Fl_Menu_Type.cxx,v 1.16.2.12.2.9 2004/05/15 22:58:18 easysw Exp $"
//
// Menu item code for the Fast Light Tool Kit (FLTK).
//
@ -185,9 +185,9 @@ void Fl_Menu_Item_Type::write_static() {
int thislevel = q->level; if (q->is_parent()) thislevel++;
int nextlevel =
(q->next && q->next->is_menu_item()) ? q->next->level : t->level+1;
while (thislevel > nextlevel) {write_c(" {0},\n"); thislevel--;}
while (thislevel > nextlevel) {write_c(" {0,0,0,0,0,0,0,0,0},\n"); thislevel--;}
}
write_c(" {0}\n};\n");
write_c(" {0,0,0,0,0,0,0,0,0}\n};\n");
if (k) {
// Write menu item variables...
@ -465,5 +465,5 @@ void shortcut_in_cb(Shortcut_Button* i, void* v) {
}
//
// End of "$Id: Fl_Menu_Type.cxx,v 1.16.2.12.2.8 2004/04/11 04:38:55 easysw Exp $".
// End of "$Id: Fl_Menu_Type.cxx,v 1.16.2.12.2.9 2004/05/15 22:58:18 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Browser.cxx,v 1.9.2.12.2.9 2004/04/11 04:38:57 easysw Exp $"
// "$Id: Fl_Browser.cxx,v 1.9.2.12.2.10 2004/05/15 22:58:18 easysw Exp $"
//
// Browser widget for the Fast Light Tool Kit (FLTK).
//
@ -216,6 +216,7 @@ int Fl_Browser::item_height(void* lv) const {
if (hh > hmax) hmax = hh;
}
else {
const int* i = column_widths();
// do each column separately as they may all set different fonts:
for (char* str = l->txt; *str; str++) {
Fl_Font font = textfont(); // default font
@ -239,12 +240,13 @@ int Fl_Browser::item_height(void* lv) const {
}
END_FORMAT:
char* ptr = str;
for(;*str && (*str!=column_char()); str++) ;
if (ptr < str) {
if (*i++) str = strchr(str, column_char());
else str = NULL;
if((!str && *ptr) || (str && ptr < str)) {
fl_font(font, tsize); int hh = fl_height();
if (hh > hmax) hmax = hh;
}
if (!*str) str --;
if (!*str) break;
}
}
@ -258,8 +260,8 @@ int Fl_Browser::item_width(void* v) const {
while (*i) { // add up all tab-seperated fields
char* e;
for (e = str; *e && *e != column_char(); e++);
if (!*e) break; // last one occupied by text
e = strchr(str, column_char());
if (!e) break; // last one occupied by text
str = e+1;
ww += *i++;
}
@ -284,6 +286,7 @@ int Fl_Browser::item_width(void* v) const {
case 'S': tsize = strtol(str, &str, 10); break;
case '.':
done = 1;
break;
case '@':
str--;
done = 1;
@ -316,8 +319,8 @@ void Fl_Browser::item_draw(void* v, int X, int Y, int W, int H) const {
int w1 = W; // width for this field
char* e = 0; // pointer to end of field or null if none
if (*i) { // find end of field and temporarily replace with 0
for (e = str; *e && *e != column_char(); e++);
if (*e) {*e = 0; w1 = *i++;} else e = 0;
e = strchr(str, column_char());
if (e) {*e = 0; w1 = *i++;}
}
int tsize = textsize();
Fl_Font font = textfont();
@ -495,5 +498,5 @@ int Fl_Browser::value() const {
}
//
// End of "$Id: Fl_Browser.cxx,v 1.9.2.12.2.9 2004/04/11 04:38:57 easysw Exp $".
// End of "$Id: Fl_Browser.cxx,v 1.9.2.12.2.10 2004/05/15 22:58:18 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.18 2004/05/13 21:02:40 easysw Exp $"
// "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.19 2004/05/15 22:58:18 easysw Exp $"
//
// OpenGL visual selection code for the Fast Light Tool Kit (FLTK).
//
@ -30,6 +30,7 @@
# include <FL/x.H>
# include <stdlib.h>
# include "Fl_Gl_Choice.H"
# include <FL/gl_draw.H>
# include "flstring.h"
# ifdef __APPLE__
@ -245,6 +246,7 @@ static void del_context(GLContext ctx) {
break;
}
}
if (!nContext) gl_remove_displaylist_fonts();
}
# ifdef WIN32
@ -350,5 +352,5 @@ void fl_delete_gl_context(GLContext context) {
//
// End of "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.18 2004/05/13 21:02:40 easysw Exp $".
// End of "$Id: Fl_Gl_Choice.cxx,v 1.5.2.7.2.19 2004/05/15 22:58:18 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.11 2004/04/11 04:38:58 easysw Exp $"
// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.12 2004/05/15 22:58:18 easysw Exp $"
//
// Scroll widget for the Fast Light Tool Kit (FLTK).
//
@ -257,7 +257,8 @@ void Fl_Scroll::position(int X, int Y) {
if (o == &hscrollbar || o == &scrollbar) continue;
o->position(o->x()+dx, o->y()+dy);
}
damage(FL_DAMAGE_SCROLL);
if (parent() == (Fl_Group *)window() && Fl::scheme_bg_) damage(FL_DAMAGE_ALL);
else damage(FL_DAMAGE_SCROLL);
}
void Fl_Scroll::hscrollbar_cb(Fl_Widget* o, void*) {
@ -290,5 +291,5 @@ int Fl_Scroll::handle(int event) {
}
//
// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.11 2004/04/11 04:38:58 easysw Exp $".
// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.12 2004/05/15 22:58:18 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Text_Display.cxx,v 1.12.2.51 2004/04/11 04:38:58 easysw Exp $"
// "$Id: Fl_Text_Display.cxx,v 1.12.2.52 2004/05/15 22:58:18 easysw Exp $"
//
// Copyright 2001-2004 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
@ -2824,6 +2824,8 @@ void Fl_Text_Display::draw(void) {
// don't even try if there is no associated text buffer!
if (!buffer()) { draw_box(); return; }
fl_push_clip(x(),y(),w(),h()); // prevent drawing outside widget area
// draw the non-text, non-scrollbar areas.
if (damage() & FL_DAMAGE_ALL) {
// printf("drawing all (box = %d)\n", box());
@ -2930,6 +2932,7 @@ void Fl_Text_Display::draw(void) {
mCursorOldY = Y;
fl_pop_clip();
}
fl_pop_clip();
}
// this processes drag events due to mouse for Fl_Text_Display and
@ -3066,5 +3069,5 @@ int Fl_Text_Display::handle(int event) {
//
// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.51 2004/04/11 04:38:58 easysw Exp $".
// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.52 2004/05/15 22:58:18 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_x.cxx,v 1.24.2.24.2.34 2004/05/13 21:02:41 easysw Exp $"
// "$Id: Fl_x.cxx,v 1.24.2.24.2.35 2004/05/15 22:58:18 easysw Exp $"
//
// X specific code for the Fast Light Tool Kit (FLTK).
//
@ -921,6 +921,7 @@ int fl_handle(const XEvent& thisevent)
////////////////////////////////////////////////////////////////
void Fl_Window::resize(int X,int Y,int W,int H) {
int is_a_move = (X != x() || Y != y());
int is_a_resize = (W != w() || H != h());
int resize_from_program = (this != resize_bug_fix);
if (!resize_from_program) resize_bug_fix = 0;
@ -940,7 +941,11 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
if (resize_from_program && shown()) {
if (is_a_resize) {
if (!resizable()) size_range(w(),h(),w(),h());
XMoveResizeWindow(fl_display, i->xid, X, Y, W>0 ? W : 1, H>0 ? H : 1);
if (is_a_move) {
XMoveResizeWindow(fl_display, i->xid, X, Y, W>0 ? W : 1, H>0 ? H : 1);
} else {
XResizeWindow(fl_display, i->xid, W>0 ? W : 1, H>0 ? H : 1);
}
} else
XMoveWindow(fl_display, i->xid, X, Y);
}
@ -1275,5 +1280,5 @@ void Fl_Window::make_current() {
#endif
//
// End of "$Id: Fl_x.cxx,v 1.24.2.24.2.34 2004/05/13 21:02:41 easysw Exp $".
// End of "$Id: Fl_x.cxx,v 1.24.2.24.2.35 2004/05/15 22:58:18 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: gl_draw.cxx,v 1.7.2.5.2.12 2004/04/11 04:39:00 easysw Exp $"
// "$Id: gl_draw.cxx,v 1.7.2.5.2.13 2004/05/15 22:58:19 easysw Exp $"
//
// OpenGL drawing support routines for the Fast Light Tool Kit (FLTK).
//
@ -74,6 +74,47 @@ void gl_font(int fontid, int size) {
glListBase(fl_fontsize->listbase);
}
void gl_remove_displaylist_fonts()
{
# if HAVE_GL
// clear variables used mostly in fl_font
fl_font_ = 0;
fl_size_ = 0;
for (int j = 0 ; j < FL_FREE_FONT ; ++j)
{
Fl_FontSize* past = 0;
Fl_Fontdesc* s = fl_fonts + j ;
Fl_FontSize* f = s->first;
while (f != 0) {
if(f->listbase) {
if(f == s->first) {
s->first = f->next;
}
else {
past->next = f->next;
}
// It would be nice if this next line was in a descturctor somewhere
glDeleteLists(f->listbase, 256);
Fl_FontSize* tmp = f;
f = f->next;
delete tmp;
}
else {
past = f;
f = f->next;
}
}
}
#endif
}
void gl_draw(const char* str, int n) {
glCallLists(n, GL_UNSIGNED_BYTE, str);
}
@ -166,5 +207,5 @@ void gl_draw_image(const uchar* b, int x, int y, int w, int h, int d, int ld) {
#endif
//
// End of "$Id: gl_draw.cxx,v 1.7.2.5.2.12 2004/04/11 04:39:00 easysw Exp $".
// End of "$Id: gl_draw.cxx,v 1.7.2.5.2.13 2004/05/15 22:58:19 easysw Exp $".
//