riched20: implement ECO_NOHIDESEL of EM_SETOPTIONS, take2
Brian Chang
brianch at seas.ucla.edu
Thu Mar 2 20:21:07 CST 2006
This is a revision of the previously submitted patch located here:
http://www.winehq.org/pipermail/wine-patches/2006-March/024700.html
which takes into account Mike McCormack's suggestion of addressing style changes
ECO_NOHIDESEL needs only to be taken into consideration when the richedit window does not have keyboard focus
editor.c | 32 ++++++++++++++++++++++++++------
1 files changed, 26 insertions(+), 6 deletions(-)
Index: dlls/riched20/editor.c
===================================================================
RCS file: /home/wine/wine/dlls/riched20/editor.c,v
retrieving revision 1.101
diff -a -u -r1.101 editor.c
--- dlls/riched20/editor.c 27 Feb 2006 15:35:12 -0000 1.101
+++ dlls/riched20/editor.c 2 Mar 2006 22:19:53 -0000
@@ -137,8 +137,8 @@
+ WM_PASTE
- WM_SETFONT
+ WM_SETTEXT (resets undo stack !) (proper style?) ANSI&Unicode
- - WM_STYLECHANGING
- - WM_STYLECHANGED (things like read-only flag)
+ + WM_STYLECHANGING (partially implemented)
+ + WM_STYLECHANGED (not processed by riched20 in Windows)
- WM_UNICHAR
Notifications
@@ -1328,8 +1328,6 @@
UNSUPPORTED_MSG(EM_SETWORDBREAKPROCEX)
UNSUPPORTED_MSG(EM_SHOWSCROLLBAR)
UNSUPPORTED_MSG(WM_SETFONT)
- UNSUPPORTED_MSG(WM_STYLECHANGING)
- UNSUPPORTED_MSG(WM_STYLECHANGED)
/* UNSUPPORTED_MSG(WM_UNICHAR) FIXME missing in Wine headers */
/* Messages specific to Richedit controls */
@@ -1432,8 +1430,6 @@
FIXME("ECO_AUTOHSCROLL not implemented yet!\n");
if (lParam & ECO_AUTOVSCROLL)
FIXME("ECO_AUTOVSCROLL not implemented yet!\n");
- if (lParam & ECO_NOHIDESEL)
- FIXME("ECO_NOHIDESEL not implemented yet!\n");
if (lParam & ECO_WANTRETURN)
FIXME("ECO_WANTRETURN not implemented yet!\n");
@@ -2059,10 +2055,18 @@
}
break;
case WM_SETFOCUS:
+ /* show selection if it isn't already because of ECO_NOHIDESEL */
+ if ((GetWindowLongW(hWnd, GWL_STYLE) & ECO_NOHIDESEL)==0)
+ RichEditANSIWndProc(hWnd, EM_HIDESELECTION, 0, 0);
+
ME_ShowCaret(editor);
ME_SendOldNotify(editor, EN_SETFOCUS);
return 0;
case WM_KILLFOCUS:
+ /* hide the selection if we don't have ECO_NOHIDESEL set */
+ if ((GetWindowLongW(hWnd, GWL_STYLE) & ECO_NOHIDESEL)==0)
+ RichEditANSIWndProc(hWnd, EM_HIDESELECTION, 1, 0);
+
ME_HideCaret(editor);
ME_SendOldNotify(editor, EN_KILLFOCUS);
return 0;
@@ -2301,6 +2305,22 @@
}
return ret;
}
+ case WM_STYLECHANGED:
+ /* Windows seems to always return 1. MSDN indicates 0 returned if processed */
+ return 1;
+ case WM_STYLECHANGING:
+ /* see if we have keyboard focus */
+ if (GetFocus()==NULL)
+ {
+ /* if ES_NOHIDESEL is set, we show the selection, otherwise hide it */
+ if ( (lParam & ES_NOHIDESEL) != 0)
+ RichEditANSIWndProc(hWnd, EM_HIDESELECTION, 0, 0);
+ else
+ RichEditANSIWndProc(hWnd, EM_HIDESELECTION, 1, 0);
+ }
+
+ /* 0 indicates message was processed */
+ return 0;
default:
do_default:
return DefWindowProcW(hWnd, msg, wParam, lParam);
More information about the wine-patches
mailing list