Fixed Fl_Browser::item_height, I believe this will fix Adrian Miranda's

problems with it.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@422 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Bill Spitzak
1999-03-13 20:20:37 +00:00
parent 2316172e5f
commit 0f64401722
+11 -18
View File
@@ -1,5 +1,5 @@
// //
// "$Id: Fl_Browser.cxx,v 1.9 1999/03/10 20:06:37 mike Exp $" // "$Id: Fl_Browser.cxx,v 1.9.2.1 1999/03/13 20:20:37 bill Exp $"
// //
// Browser widget for the Fast Light Tool Kit (FLTK). // Browser widget for the Fast Light Tool Kit (FLTK).
// //
@@ -206,17 +206,11 @@ void Fl_Browser::data(int line, void* data) {
int Fl_Browser::item_height(void* lv) const { int Fl_Browser::item_height(void* lv) const {
FL_BLINE* l = (FL_BLINE*)lv; FL_BLINE* l = (FL_BLINE*)lv;
if (l->flags & NOTDISPLAYED) return 0; if (l->flags & NOTDISPLAYED) return 0;
char* str = l->txt;
Fl_Font font;
int size;
int w, h;
int hmax = 0; int hmax = 0;
for(;*str;str++) for (char* str = l->txt; *str; str++) {
{ Fl_Font font = Fl_Font(0); // default font
w = 0; // no wrap int size = textsize(); // default size
font = Fl_Font(0); // default font
size = textsize(); // default size
while(*str==format_char()) while(*str==format_char())
{ {
str++; str++;
@@ -235,14 +229,13 @@ int Fl_Browser::item_height(void* lv) const {
} }
END_FORMAT: END_FORMAT:
char* ptr = str; char* ptr = str;
for(;*str && (*str!=column_char());str++) ; for(;*str && (*str!=column_char()); str++) ;
char prev = *str; if (ptr < str) {
*str = 0; fl_font(font, size); int h = fl_height;
fl_font(font,size); if (h > hmax) hmax = size;
fl_measure(ptr,w,h);
*str = prev;
if(h>hmax) hmax=h;
} }
}
return hmax+2; return hmax+2;
} }
@@ -482,5 +475,5 @@ int Fl_Browser::value() const {
} }
// //
// End of "$Id: Fl_Browser.cxx,v 1.9 1999/03/10 20:06:37 mike Exp $". // End of "$Id: Fl_Browser.cxx,v 1.9.2.1 1999/03/13 20:20:37 bill Exp $".
// //