riched20:EM_HIDESELECTION implementation

hlakhani at gmail.com hlakhani at gmail.com
Fri Feb 24 15:31:25 CST 2006


My name is Hamza Lakhani.  I'm a resident of Los Angeles, CA,
USA, and I currently attend UCLA.  I hereby certify that i wrote
this code without copying from anyone else's sources, and I've 
never seen any secret Microsoft source code.

ChangeLog:

riched20: Implement EM_HIDESELECTION message

---

 editor.c  |   12 +++++++++---
 editstr.h |    1 +
 paint.c   |    5 ++++-
 3 files changed, 14 insertions(+), 4 deletions(-)

Index: dlls/riched20/editor.c
===================================================================
RCS file: /home/wine/wine/dlls/riched20/editor.c,v
retrieving revision 1.95
diff -u -r1.95 editor.c
--- dlls/riched20/editor.c	22 Feb 2006 21:31:55 -0000	1.95
+++ dlls/riched20/editor.c	24 Feb 2006 21:14:50 -0000
@@ -76,7 +76,7 @@
   - EM_GETWORDBREAKPROCEX
   - EM_GETWORDWRAPMODE 1.0asian
   + EM_GETZOOM 3.0
-  - EM_HIDESELECTION
+  + EM_HIDESELECTION
   - EM_LIMITTEXT
   + EM_LINEFROMCHAR
   + EM_LINEINDEX
@@ -1020,6 +1020,7 @@
   ed->nScrollPosY = 0;
   ed->nZoomNumerator = ed->nZoomDenominator = 0;
   ed->bRedraw = TRUE;
+  ed->bHideSelection = FALSE;
   ed->nInvalidOfs = -1;
   ed->pfnWordBreak = NULL;
   ed->lpOleCallback = NULL;
@@ -1198,7 +1199,7 @@
   "EM_GETOLEINTERFACE",
   "EM_GETPARAFORMAT",
   "EM_GETSELTEXT",
-  "EM_HIDESELECTION",
+  "EM_HIDESELECTION", 
   "EM_PASTESPECIAL",
   "EM_REQUESTRESIZE",
   "EM_SELECTIONTYPE",
@@ -1308,7 +1309,6 @@
   UNSUPPORTED_MSG(EM_GETTYPOGRAPHYOPTIONS)
   UNSUPPORTED_MSG(EM_GETUNDONAME)
   UNSUPPORTED_MSG(EM_GETWORDBREAKPROCEX)
-  UNSUPPORTED_MSG(EM_HIDESELECTION)
   UNSUPPORTED_MSG(EM_LIMITTEXT) /* also known as EM_SETLIMITTEXT */
   UNSUPPORTED_MSG(EM_PASTESPECIAL)
   UNSUPPORTED_MSG(EM_SCROLL)
@@ -1609,6 +1609,12 @@
     }
     return count;
   }
+  case EM_HIDESELECTION:
+  {
+     editor->bHideSelection = (wParam != 0);
+     ME_InvalidateSelection(editor);
+     return 0;
+  }
   case EM_LINESCROLL:
   {
     int nPos = editor->nScrollPosY, nEnd= editor->nTotalLength - editor->sizeWindow.cy;
Index: dlls/riched20/editstr.h
===================================================================
RCS file: /home/wine/wine/dlls/riched20/editstr.h,v
retrieving revision 1.25
diff -u -r1.25 editstr.h
--- dlls/riched20/editstr.h	22 Feb 2006 21:31:55 -0000	1.25
+++ dlls/riched20/editstr.h	24 Feb 2006 21:14:50 -0000
@@ -316,6 +316,7 @@
    *TM_SINGLELEVELUNDO or TM_MULTILEVELUNDO
    *TM_SINGLECODEPAGE or TM_MULTICODEPAGE*/
   int mode;
+  BOOL bHideSelection;
 } ME_TextEditor;
 
 typedef struct tagME_Context
Index: dlls/riched20/paint.c
===================================================================
RCS file: /home/wine/wine/dlls/riched20/paint.c,v
retrieving revision 1.23
diff -u -r1.23 paint.c
--- dlls/riched20/paint.c	4 Feb 2006 17:17:46 -0000	1.23
+++ dlls/riched20/paint.c	24 Feb 2006 21:14:51 -0000
@@ -175,7 +175,10 @@
     GetTextExtentPoint32W(hDC, szText, nSelFrom, &sz);
     x += sz.cx;
     GetTextExtentPoint32W(hDC, szText+nSelFrom, nSelTo-nSelFrom, &sz);
-    PatBlt(hDC, x, ymin, sz.cx, cy, DSTINVERT);
+    
+    /* Invert selection if not hidden by EM_HIDESELECTION */
+    if (c->editor->bHideSelection == FALSE)
+	PatBlt(hDC, x, ymin, sz.cx, cy, DSTINVERT);
   }
   SetTextColor(hDC, rgbOld);
   ME_UnselectStyleFont(c->editor, hDC, s, hOldFont);



More information about the wine-patches mailing list