Fix Fl_Browser item width problem when column_widths() is set.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1982 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2002-03-05 10:42:13 +00:00
parent 2d90deead9
commit c2221d5552
2 changed files with 11 additions and 7 deletions

View File

@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.0b12
- Fl_Browser::item_width() didn't compute the width of
the item properly when column_widths() was set.
- Fl_Button didn't check to see if the widget could
accept focus before taking input focus.
- Fl_Help_View didn't preserve target names (e.g.

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Browser.cxx,v 1.9.2.12.2.3 2002/01/01 15:11:30 easysw Exp $"
// "$Id: Fl_Browser.cxx,v 1.9.2.12.2.4 2002/03/05 10:42:13 easysw Exp $"
//
// Browser widget for the Fast Light Tool Kit (FLTK).
//
@ -257,11 +257,11 @@ int Fl_Browser::item_width(void* v) const {
int w = 0;
while (*i) { // add up all tab-seperated fields
w += *i++;
char* e;
for (e = str; *e && *e != column_char(); e++);
if (!*e) return 0; // last one occupied by text
if (!*e) break; // last one occupied by text
str = e+1;
w += *i++;
}
// OK, we gotta parse the string and find the string width...
@ -269,9 +269,8 @@ int Fl_Browser::item_width(void* v) const {
Fl_Font font = textfont();
int done = 0;
// MRS - might this cause problems on some platforms - order of operations?
while (*str == format_char_ && *++str && *str != format_char_) {
while (*str == format_char_ && str[1] && str[1] != format_char_) {
str ++;
switch (*str++) {
case 'l': case 'L': size = 24; break;
case 'm': case 'M': size = 18; break;
@ -294,6 +293,9 @@ int Fl_Browser::item_width(void* v) const {
break;
}
if (*str == format_char_ && str[1])
str ++;
fl_font(font, size);
return w + int(fl_width(str)) + 6;
}
@ -493,5 +495,5 @@ int Fl_Browser::value() const {
}
//
// End of "$Id: Fl_Browser.cxx,v 1.9.2.12.2.3 2002/01/01 15:11:30 easysw Exp $".
// End of "$Id: Fl_Browser.cxx,v 1.9.2.12.2.4 2002/03/05 10:42:13 easysw Exp $".
//