riched20: EM_HIDESELECTION implementation.

This commit is contained in:
Hamza Lakhani 2006-02-24 13:31:25 -08:00 committed by Alexandre Julliard
parent 07fe82dd55
commit 6979719a90
3 changed files with 14 additions and 4 deletions

View File

@ -76,7 +76,7 @@
- EM_GETWORDBREAKPROCEX
- EM_GETWORDWRAPMODE 1.0asian
+ EM_GETZOOM 3.0
- EM_HIDESELECTION
+ EM_HIDESELECTION
- EM_LIMITTEXT
+ EM_LINEFROMCHAR
+ EM_LINEINDEX
@ -1022,6 +1022,7 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
ed->nScrollPosY = 0;
ed->nZoomNumerator = ed->nZoomDenominator = 0;
ed->bRedraw = TRUE;
ed->bHideSelection = FALSE;
ed->nInvalidOfs = -1;
ed->pfnWordBreak = NULL;
ed->lpOleCallback = NULL;
@ -1200,7 +1201,7 @@ static const char * const richedit_messages[] = {
"EM_GETOLEINTERFACE",
"EM_GETPARAFORMAT",
"EM_GETSELTEXT",
"EM_HIDESELECTION",
"EM_HIDESELECTION",
"EM_PASTESPECIAL",
"EM_REQUESTRESIZE",
"EM_SELECTIONTYPE",
@ -1310,7 +1311,6 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
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)
@ -1611,6 +1611,12 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
}
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;

View File

@ -316,6 +316,7 @@ typedef struct tagME_TextEditor
*TM_SINGLELEVELUNDO or TM_MULTILEVELUNDO
*TM_SINGLECODEPAGE or TM_MULTICODEPAGE*/
int mode;
BOOL bHideSelection;
} ME_TextEditor;
typedef struct tagME_Context

View File

@ -175,7 +175,10 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, in
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);