Clip text in file list properly.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2196 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2002-05-06 04:11:50 +00:00
parent 10351f0254
commit 070a4044eb
2 changed files with 15 additions and 3 deletions

View File

@ -1,6 +1,7 @@
CHANGES IN FLTK 1.1.0rc2
- Portability fixes.
- Fl_File_Browser didn't clip items to the column width.
- Fl_Window::draw() cleared the window label but didn't
restore it, so windows could lose their titles.
- Eliminated multiple definitions of dirent structure

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_File_Browser.cxx,v 1.1.2.14 2002/05/02 14:31:10 easysw Exp $"
// "$Id: Fl_File_Browser.cxx,v 1.1.2.15 2002/05/06 04:11:50 easysw Exp $"
//
// Fl_File_Browser routines.
//
@ -342,7 +342,18 @@ Fl_File_Browser::item_draw(void *p, // I - List item data
// Tab - nul terminate this fragment and draw it...
*ptr = '\0';
fl_draw(fragment, x + width, y, w - width, fl_height(),
int cW = w - width; // Clip width...
if (columns)
{
// Try clipping inside this column...
for (i = 0; i < column && columns[i]; i ++);
if (columns[i])
cW = columns[i];
}
fl_draw(fragment, x + width, y, cW, fl_height(),
(Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_CLIP), 0, 0);
// Advance to the next column...
@ -627,5 +638,5 @@ Fl_File_Browser::filter(const char *pattern) // I - Pattern string
//
// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.14 2002/05/02 14:31:10 easysw Exp $".
// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.15 2002/05/06 04:11:50 easysw Exp $".
//