Commit c2cb39b8 authored by Phil Krylov's avatar Phil Krylov Committed by Alexandre Julliard

Implemented EM_CHARFROMPOS RichEdit message.

parent 2b6b09f5
...@@ -584,6 +584,22 @@ int ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *result, BOOL ...@@ -584,6 +584,22 @@ int ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *result, BOOL
return 0; return 0;
} }
int
ME_CharFromPos(ME_TextEditor *editor, int x, int y)
{
ME_Cursor cursor;
RECT rc;
GetClientRect(editor->hWnd, &rc);
if (x < 0 || y < 0 || x >= rc.right || y >= rc.bottom)
return -1;
ME_FindPixelPos(editor, x, y, &cursor, NULL);
return (ME_GetParagraph(cursor.pRun)->member.para.nCharOfs
+ cursor.pRun->member.run.nCharOfs + cursor.nOffset);
}
void ME_LButtonDown(ME_TextEditor *editor, int x, int y) void ME_LButtonDown(ME_TextEditor *editor, int x, int y)
{ {
ME_Cursor tmp_cursor; ME_Cursor tmp_cursor;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
+ EM_CANPASTE + EM_CANPASTE
+ EM_CANREDO 2.0 + EM_CANREDO 2.0
+ EM_CANUNDO + EM_CANUNDO
- EM_CHARFROMPOS + EM_CHARFROMPOS
- EM_DISPLAYBAND - EM_DISPLAYBAND
+ EM_EMPTYUNDOBUFFER + EM_EMPTYUNDOBUFFER
+ EM_EXGETSEL + EM_EXGETSEL
...@@ -1026,7 +1026,6 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP ...@@ -1026,7 +1026,6 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
switch(msg) { switch(msg) {
UNSUPPORTED_MSG(EM_AUTOURLDETECT) UNSUPPORTED_MSG(EM_AUTOURLDETECT)
UNSUPPORTED_MSG(EM_CHARFROMPOS)
UNSUPPORTED_MSG(EM_DISPLAYBAND) UNSUPPORTED_MSG(EM_DISPLAYBAND)
UNSUPPORTED_MSG(EM_EXLIMITTEXT) UNSUPPORTED_MSG(EM_EXLIMITTEXT)
UNSUPPORTED_MSG(EM_FINDWORDBREAK) UNSUPPORTED_MSG(EM_FINDWORDBREAK)
...@@ -1587,6 +1586,8 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP ...@@ -1587,6 +1586,8 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
return TRUE; return TRUE;
case EM_SETZOOM: case EM_SETZOOM:
return ME_SetZoom(editor, wParam, lParam); return ME_SetZoom(editor, wParam, lParam);
case EM_CHARFROMPOS:
return ME_CharFromPos(editor, ((POINTL *)lParam)->x, ((POINTL *)lParam)->y);
case WM_CREATE: case WM_CREATE:
ME_CommitUndo(editor); ME_CommitUndo(editor);
ME_WrapMarkedParagraphs(editor); ME_WrapMarkedParagraphs(editor);
......
...@@ -141,6 +141,7 @@ void ME_HideCaret(ME_TextEditor *ed); ...@@ -141,6 +141,7 @@ void ME_HideCaret(ME_TextEditor *ed);
void ME_ShowCaret(ME_TextEditor *ed); void ME_ShowCaret(ME_TextEditor *ed);
void ME_MoveCaret(ME_TextEditor *ed); void ME_MoveCaret(ME_TextEditor *ed);
int ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *result, BOOL *is_eol); int ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *result, BOOL *is_eol);
int ME_CharFromPos(ME_TextEditor *editor, int x, int y);
void ME_LButtonDown(ME_TextEditor *editor, int x, int y); void ME_LButtonDown(ME_TextEditor *editor, int x, int y);
void ME_MouseMove(ME_TextEditor *editor, int x, int y); void ME_MouseMove(ME_TextEditor *editor, int x, int y);
void ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, int nChars); void ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, int nChars);
......
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