From 23cfc372a0dab95c688190f49614c1b9090cc435 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 21 May 2002 11:14:59 +0000 Subject: Fix links inside PRE Make style data const in Fl_Text_Display. Use INT input only when step() is an integral value. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2246 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Help_View.cxx | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/Fl_Help_View.cxx') diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx index b2783539a..bda620360 100644 --- a/src/Fl_Help_View.cxx +++ b/src/Fl_Help_View.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Help_View.cxx,v 1.1.2.31 2002/05/16 12:47:43 easysw Exp $" +// "$Id: Fl_Help_View.cxx,v 1.1.2.32 2002/05/21 11:14:57 easysw Exp $" // // Fl_Help_View widget routines. // @@ -836,12 +836,13 @@ Fl_Help_View::format() { if ((*ptr == '<' || isspace(*ptr)) && s > buf) { + // Get width... + *s = '\0'; + ww = (int)fl_width(buf); + if (!head && !pre) { // Check width... - *s = '\0'; - ww = (int)fl_width(buf); - if (ww > hsize_) { hsize_ = ww; done = 0; @@ -874,6 +875,14 @@ Fl_Help_View::format() } else if (pre) { + // Add a link as needed... + if (link[0]) + add_link(link, xx, yy - hh, ww, hh); + + xx += ww; + if ((size + 2) > hh) + hh = size + 2; + // Handle preformatted text... while (isspace(*ptr)) { @@ -881,15 +890,14 @@ Fl_Help_View::format() { if (xx > hsize_) break; - if (link[0]) - add_link(link, xx, yy - hh, ww, hh); - line = do_align(block, line, xx, newalign, links); xx = block->x; yy += hh; block->h += hh; hh = size + 2; } + else + xx += (int)fl_width(' '); if ((size + 2) > hh) hh = size + 2; @@ -2615,5 +2623,5 @@ hscrollbar_callback(Fl_Widget *s, void *) // -// End of "$Id: Fl_Help_View.cxx,v 1.1.2.31 2002/05/16 12:47:43 easysw Exp $". +// End of "$Id: Fl_Help_View.cxx,v 1.1.2.32 2002/05/21 11:14:57 easysw Exp $". // -- cgit v1.2.3