Piotr Caban : riched20: Add support for ECO_NOHIDESEL flag.
Alexandre Julliard
julliard at winehq.org
Fri Jul 8 10:02:05 CDT 2016
Module: wine
Branch: master
Commit: 060d8c6abb25119cfc67b069a7fe3a94248c3702
URL: http://source.winehq.org/git/wine.git/?a=commit;h=060d8c6abb25119cfc67b069a7fe3a94248c3702
Author: Piotr Caban <piotr at codeweavers.com>
Date: Fri Jul 8 12:27:14 2016 +0200
riched20: Add support for ECO_NOHIDESEL flag.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/riched20/editor.c | 9 +++++++--
dlls/riched20/paint.c | 6 ++++--
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 13a2857..9ec72e2 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -3453,14 +3453,15 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
ME_RewrapRepaint(editor);
}
+ if ((changedSettings & settings & ES_NOHIDESEL) && !editor->bHaveFocus)
+ ME_InvalidateSelection( editor );
+
if (changedSettings & settings & ECO_VERTICAL)
FIXME("ECO_VERTICAL not implemented yet!\n");
if (changedSettings & settings & ECO_AUTOHSCROLL)
FIXME("ECO_AUTOHSCROLL not implemented yet!\n");
if (changedSettings & settings & ECO_AUTOVSCROLL)
FIXME("ECO_AUTOVSCROLL not implemented yet!\n");
- if (changedSettings & settings & ECO_NOHIDESEL)
- FIXME("ECO_NOHIDESEL not implemented yet!\n");
if (changedSettings & settings & ECO_WANTRETURN)
FIXME("ECO_WANTRETURN not implemented yet!\n");
if (changedSettings & settings & ECO_AUTOWORDSELECTION)
@@ -4257,6 +4258,8 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
editor->bHaveFocus = TRUE;
ME_ShowCaret(editor);
ME_SendOldNotify(editor, EN_SETFOCUS);
+ if (!editor->bHideSelection && !(editor->styleFlags & ES_NOHIDESEL))
+ ME_InvalidateSelection( editor );
return 0;
case WM_KILLFOCUS:
ME_CommitUndo(editor); /* End coalesced undos for typed characters */
@@ -4264,6 +4267,8 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
editor->wheel_remain = 0;
ME_HideCaret(editor);
ME_SendOldNotify(editor, EN_KILLFOCUS);
+ if (!editor->bHideSelection && !(editor->styleFlags & ES_NOHIDESEL))
+ ME_InvalidateSelection( editor );
return 0;
case WM_COMMAND:
TRACE("editor wnd command = %d\n", LOWORD(wParam));
diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c
index 8580539..42434b9 100644
--- a/dlls/riched20/paint.c
+++ b/dlls/riched20/paint.c
@@ -261,7 +261,8 @@ static void draw_space( ME_Context *c, ME_Run *run, int x, int y,
SetRect( &rect, x, ymin, x + run->nWidth, ymin + cy );
- if (c->editor->bHideSelection) selected = FALSE;
+ if (c->editor->bHideSelection || (!c->editor->bHaveFocus &&
+ !(c->editor->styleFlags & ES_NOHIDESEL))) selected = FALSE;
if (c->editor->bEmulateVersion10)
{
old_style_selected = selected;
@@ -355,7 +356,8 @@ static void ME_DrawTextWithStyle(ME_Context *c, ME_Run *run, int x, int y,
HGDIOBJ hOldFont;
int yOffset = 0;
BOOL selected = (nSelFrom < run->len && nSelTo >= 0
- && nSelFrom < nSelTo && !c->editor->bHideSelection);
+ && nSelFrom < nSelTo && !c->editor->bHideSelection &&
+ (c->editor->bHaveFocus || (c->editor->styleFlags & ES_NOHIDESEL)));
BOOL old_style_selected = FALSE;
RECT sel_rect;
HRGN clip = NULL, sel_rgn = NULL;
More information about the wine-cvs
mailing list