Commit 060d8c6a authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

riched20: Add support for ECO_NOHIDESEL flag.

parent cc9c18a4
...@@ -3453,14 +3453,15 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, ...@@ -3453,14 +3453,15 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
ME_RewrapRepaint(editor); ME_RewrapRepaint(editor);
} }
if ((changedSettings & settings & ES_NOHIDESEL) && !editor->bHaveFocus)
ME_InvalidateSelection( editor );
if (changedSettings & settings & ECO_VERTICAL) if (changedSettings & settings & ECO_VERTICAL)
FIXME("ECO_VERTICAL not implemented yet!\n"); FIXME("ECO_VERTICAL not implemented yet!\n");
if (changedSettings & settings & ECO_AUTOHSCROLL) if (changedSettings & settings & ECO_AUTOHSCROLL)
FIXME("ECO_AUTOHSCROLL not implemented yet!\n"); FIXME("ECO_AUTOHSCROLL not implemented yet!\n");
if (changedSettings & settings & ECO_AUTOVSCROLL) if (changedSettings & settings & ECO_AUTOVSCROLL)
FIXME("ECO_AUTOVSCROLL not implemented yet!\n"); FIXME("ECO_AUTOVSCROLL not implemented yet!\n");
if (changedSettings & settings & ECO_NOHIDESEL)
FIXME("ECO_NOHIDESEL not implemented yet!\n");
if (changedSettings & settings & ECO_WANTRETURN) if (changedSettings & settings & ECO_WANTRETURN)
FIXME("ECO_WANTRETURN not implemented yet!\n"); FIXME("ECO_WANTRETURN not implemented yet!\n");
if (changedSettings & settings & ECO_AUTOWORDSELECTION) if (changedSettings & settings & ECO_AUTOWORDSELECTION)
...@@ -4257,6 +4258,8 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, ...@@ -4257,6 +4258,8 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
editor->bHaveFocus = TRUE; editor->bHaveFocus = TRUE;
ME_ShowCaret(editor); ME_ShowCaret(editor);
ME_SendOldNotify(editor, EN_SETFOCUS); ME_SendOldNotify(editor, EN_SETFOCUS);
if (!editor->bHideSelection && !(editor->styleFlags & ES_NOHIDESEL))
ME_InvalidateSelection( editor );
return 0; return 0;
case WM_KILLFOCUS: case WM_KILLFOCUS:
ME_CommitUndo(editor); /* End coalesced undos for typed characters */ ME_CommitUndo(editor); /* End coalesced undos for typed characters */
...@@ -4264,6 +4267,8 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, ...@@ -4264,6 +4267,8 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
editor->wheel_remain = 0; editor->wheel_remain = 0;
ME_HideCaret(editor); ME_HideCaret(editor);
ME_SendOldNotify(editor, EN_KILLFOCUS); ME_SendOldNotify(editor, EN_KILLFOCUS);
if (!editor->bHideSelection && !(editor->styleFlags & ES_NOHIDESEL))
ME_InvalidateSelection( editor );
return 0; return 0;
case WM_COMMAND: case WM_COMMAND:
TRACE("editor wnd command = %d\n", LOWORD(wParam)); TRACE("editor wnd command = %d\n", LOWORD(wParam));
......
...@@ -261,7 +261,8 @@ static void draw_space( ME_Context *c, ME_Run *run, int x, int y, ...@@ -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 ); 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) if (c->editor->bEmulateVersion10)
{ {
old_style_selected = selected; old_style_selected = selected;
...@@ -355,7 +356,8 @@ static void ME_DrawTextWithStyle(ME_Context *c, ME_Run *run, int x, int y, ...@@ -355,7 +356,8 @@ static void ME_DrawTextWithStyle(ME_Context *c, ME_Run *run, int x, int y,
HGDIOBJ hOldFont; HGDIOBJ hOldFont;
int yOffset = 0; int yOffset = 0;
BOOL selected = (nSelFrom < run->len && nSelTo >= 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; BOOL old_style_selected = FALSE;
RECT sel_rect; RECT sel_rect;
HRGN clip = NULL, sel_rgn = NULL; HRGN clip = NULL, sel_rgn = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment