Dylan Smith : richedit: Prevent autoscrolling without ES_AUTO[VH] SCROLL style.

Alexandre Julliard julliard at winehq.org
Fri Jul 17 09:03:19 CDT 2009


Module: wine
Branch: master
Commit: 140fee179040c68717f46bfd076949a58bb7ed63
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=140fee179040c68717f46bfd076949a58bb7ed63

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Thu Jul 16 20:01:25 2009 -0400

richedit: Prevent autoscrolling without ES_AUTO[VH]SCROLL style.

When the richedit control is created without the ES_AUTOHSCROLL or the
ES_AUTOVSCROLL, then scrolling isn't done automatically when moving the
cursor with the arrow keys, drag selecting with the mouse, or even from
using the EM_SCROLLCARET (based on testing using a modified version of
wordpad).

---

 dlls/riched20/paint.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c
index 620ac69..bc62bdb 100644
--- a/dlls/riched20/paint.c
+++ b/dlls/riched20/paint.c
@@ -1242,11 +1242,21 @@ void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor)
   assert(pRow);
   assert(pPara);
 
-  x = pRun->pt.x + ME_PointFromChar(editor, pRun, pCursor->nOffset);
-  if (x > editor->horz_si.nPos + editor->sizeWindow.cx)
-    x = x + 1 - editor->sizeWindow.cx;
-  else if (x > editor->horz_si.nPos)
+  if (editor->styleFlags & ES_AUTOHSCROLL)
+  {
+    x = pRun->pt.x + ME_PointFromChar(editor, pRun, pCursor->nOffset);
+    if (x > editor->horz_si.nPos + editor->sizeWindow.cx)
+      x = x + 1 - editor->sizeWindow.cx;
+    else if (x > editor->horz_si.nPos)
+      x = editor->horz_si.nPos;
+
+    if (~editor->styleFlags & ES_AUTOVSCROLL)
+      ME_HScrollAbs(editor, x);
+  } else {
+    if (~editor->styleFlags & ES_AUTOVSCROLL)
+      return;
     x = editor->horz_si.nPos;
+  }
 
   y = pPara->member.para.pt.y + pRow->member.row.pt.y;
   yheight = pRow->member.row.nHeight;




More information about the wine-cvs mailing list