Author: matt
Date: 2011-09-30 03:30:55 -0700 (Fri, 30 Sep 2011)
New Revision: 9096
Log:
Horizontal Scrollbar in TextDisplay is now even smarter.

Modified:
   branches/branch-3.0/src/fltk3/TextDisplay.cxx
   branches/branch-3.0/test/editor.cxx

Modified: branches/branch-3.0/src/fltk3/TextDisplay.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/TextDisplay.cxx       2011-09-30 10:20:34 UTC 
(rev 9095)
+++ branches/branch-3.0/src/fltk3/TextDisplay.cxx       2011-09-30 10:30:55 UTC 
(rev 9096)
@@ -352,7 +352,7 @@
     // figure the scrollbars
     if (scrollbar_width()) {
       /* Decide if the vertical scrollbar needs to be visible */
-      int vbvis = mVScrollBar->visible();
+      uchar vbvis = mVScrollBar->visible();
       if (scrollbar_align() & (fltk3::ALIGN_LEFT|fltk3::ALIGN_RIGHT) &&
           mNBufferLines >= mNVisibleLines - 1)
       {
@@ -395,7 +395,7 @@
       if (scrollbar_align() & (fltk3::ALIGN_TOP|fltk3::ALIGN_BOTTOM) &&
           (mVScrollBar->visible() || longest_vline() > text_area.w))
       {
-        char wrap_at_bounds = mContinuousWrap && (mWrapMarginPix==0);
+        char wrap_at_bounds = mContinuousWrap && (mWrapMarginPix<text_area.w);
         if (!mHScrollBar->visible() && !wrap_at_bounds) {
           mHScrollBar->set_visible();
           again = 1; // loop again to see if we now need vert. & recalc sizes

Modified: branches/branch-3.0/test/editor.cxx
===================================================================
--- branches/branch-3.0/test/editor.cxx 2011-09-30 10:20:34 UTC (rev 9095)
+++ branches/branch-3.0/test/editor.cxx 2011-09-30 10:30:55 UTC (rev 9096)
@@ -785,6 +785,7 @@
     w->editor->highlight_data(stylebuf, styletable,
                               sizeof(styletable) / sizeof(styletable[0]),
                              'A', style_unfinished_cb, 0);
+  w->editor->wrap_mode(fltk3::TextDisplay::WRAP_AT_BOUNDS, 40);
   textbuf->text();
   style_init();
   w->end();

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to