richedit: Don't show vertical scrollbar for single line controls.

Dylan Smith dylan.ah.smith at gmail.com
Tue Feb 24 01:37:21 CST 2009


The vertical scrollbar is not shown when the ES_MULTILINE style isn't
used, unless ES_DISBALENOSCROLL is also used.
---
 dlls/riched20/paint.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
-------------- next part --------------
diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c
index 35ca097..f235082 100644
--- a/dlls/riched20/paint.c
+++ b/dlls/riched20/paint.c
@@ -1071,7 +1071,8 @@ void ME_ScrollAbs(ME_TextEditor *editor, int x, int y)
 
     bScrollBarIsVisible = (winStyle & WS_VSCROLL) != 0;
     bScrollBarWillBeVisible = (editor->nTotalLength > editor->sizeWindow.cy
-                               && (editor->styleFlags & WS_VSCROLL))
+                               && (editor->styleFlags & WS_VSCROLL)
+                               && (editor->styleFlags & ES_MULTILINE))
                               || (editor->styleFlags & ES_DISABLENOSCROLL);
     if (bScrollBarIsVisible != bScrollBarWillBeVisible)
       ITextHost_TxShowScrollBar(editor->texthost, SB_VERT,
@@ -1174,7 +1175,8 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
 
   /* Update vertical scrollbar */
   bScrollBarWasVisible = editor->vert_si.nMax > editor->vert_si.nPage;
-  bScrollBarWillBeVisible = editor->nTotalLength > editor->sizeWindow.cy;
+  bScrollBarWillBeVisible = editor->nTotalLength > editor->sizeWindow.cy &&
+                            (editor->styleFlags & ES_MULTILINE);
 
   if (editor->vert_si.nPos && !bScrollBarWillBeVisible)
   {


More information about the wine-patches mailing list