summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2004-05-15 22:58:19 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2004-05-15 22:58:19 +0000
commit998f74be9f970c741c5e1fee9ee1358190346114 (patch)
treeec3823599ad90721427547a18b5e6171f638c069 /src
parente643c17eea3312b6871ea389d3ab754f030fc3b8 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Browser.cxx21
-rw-r--r--src/Fl_Gl_Choice.cxx6
-rw-r--r--src/Fl_Scroll.cxx7
-rw-r--r--src/Fl_Text_Display.cxx7
-rw-r--r--src/Fl_x.cxx11
-rw-r--r--src/gl_draw.cxx45
6 files changed, 76 insertions, 21 deletions
diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx
index 6e495a20f..f63f7572e 100644
--- a/src/Fl_Browser.cxx
+++ b/src/Fl_Browser.cxx
@@ -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 $".
//
diff --git a/src/Fl_Gl_Choice.cxx b/src/Fl_Gl_Choice.cxx
index b99331a6a..e8276823a 100644
--- a/src/Fl_Gl_Choice.cxx
+++ b/src/Fl_Gl_Choice.cxx
@@ -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 $".
//
diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx
index 76041ceb3..1aa97671b 100644
--- a/src/Fl_Scroll.cxx
+++ b/src/Fl_Scroll.cxx
@@ -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 $".
//
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 0d6c9da29..8facff07c 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -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 $".
//
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index 3499e5865..fd6111536 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.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 $".
//
diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx
index 50599dc8c..6bbdb5ab0 100644
--- a/src/gl_draw.cxx
+++ b/src/gl_draw.cxx
@@ -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 $".
//