summaryrefslogtreecommitdiff
path: root/src/Fl_Browser.cxx
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/Fl_Browser.cxx
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/Fl_Browser.cxx')
-rw-r--r--src/Fl_Browser.cxx21
1 files changed, 12 insertions, 9 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 $".
//