Added support for EM_REQUESTRESIZE message, EN_REQUESTRESIZE
notification, and ENM_REQUESTRESIZE event mask.
This commit is contained in:
parent
4770d57a09
commit
a91ba787e2
|
@ -1097,6 +1097,7 @@ BOOL ME_ArrowKey(ME_TextEditor *editor, int nVKey, int nCtrl)
|
|||
editor->bCaretAtEnd = FALSE; /* FIXME or maybe not */
|
||||
ME_DeleteSelection(editor);
|
||||
ME_UpdateRepaint(editor);
|
||||
ME_SendRequestResize(editor, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
if (ME_ArrowLeft(editor, p)) {
|
||||
|
@ -1105,6 +1106,7 @@ BOOL ME_ArrowKey(ME_TextEditor *editor, int nVKey, int nCtrl)
|
|||
ME_MoveCaret(editor);
|
||||
ME_DeleteTextAtCursor(editor, nCursor, 1);
|
||||
ME_UpdateRepaint(editor);
|
||||
ME_SendRequestResize(editor, FALSE);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1117,11 +1119,13 @@ BOOL ME_ArrowKey(ME_TextEditor *editor, int nVKey, int nCtrl)
|
|||
ME_DeleteSelection(editor);
|
||||
ME_ClearTempStyle(editor);
|
||||
ME_UpdateRepaint(editor);
|
||||
ME_SendRequestResize(editor, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
ME_DeleteTextAtCursor(editor, nCursor, 1);
|
||||
ME_ClearTempStyle(editor);
|
||||
ME_UpdateRepaint(editor);
|
||||
ME_SendRequestResize(editor, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
case VK_HOME: {
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
- EM_PASTESPECIAL
|
||||
+ EM_POSFROMCHAR
|
||||
+ EM_REDO 2.0
|
||||
- EM_REQUESTRESIZE
|
||||
+ EM_REQUESTRESIZE
|
||||
+ EM_REPLACESEL (proper style?) ANSI&Unicode
|
||||
- EM_SCROLL
|
||||
- EM_SCROLLCARET
|
||||
|
@ -153,7 +153,7 @@
|
|||
- EN_MSGFILTER
|
||||
- EN_OLEOPFAILED
|
||||
- EN_PROTECTED
|
||||
- EN_REQUESTRESIZE
|
||||
+ EN_REQUESTRESIZE
|
||||
- EN_SAVECLIPBOARD
|
||||
+ EN_SELCHANGE
|
||||
+ EN_SETFOCUS
|
||||
|
@ -633,6 +633,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
|
|||
}
|
||||
ME_MoveCaret(editor);
|
||||
ME_SendSelChange(editor);
|
||||
ME_SendRequestResize(editor, FALSE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1134,7 +1135,6 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
|||
UNSUPPORTED_MSG(EM_HIDESELECTION)
|
||||
UNSUPPORTED_MSG(EM_LIMITTEXT) /* also known as EM_SETLIMITTEXT */
|
||||
UNSUPPORTED_MSG(EM_PASTESPECIAL)
|
||||
UNSUPPORTED_MSG(EM_REQUESTRESIZE)
|
||||
UNSUPPORTED_MSG(EM_SCROLL)
|
||||
UNSUPPORTED_MSG(EM_SCROLLCARET)
|
||||
UNSUPPORTED_MSG(EM_SELECTIONTYPE)
|
||||
|
@ -1974,6 +1974,9 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
|||
ME_RewrapRepaint(editor);
|
||||
return 0;
|
||||
}
|
||||
case EM_REQUESTRESIZE:
|
||||
ME_SendRequestResize(editor, TRUE);
|
||||
return 0;
|
||||
case WM_SETREDRAW:
|
||||
editor->bRedraw = wParam;
|
||||
return 0;
|
||||
|
|
|
@ -173,6 +173,7 @@ ME_DisplayItem *ME_MakeRow(int height, int baseline, int width);
|
|||
void ME_InsertRowStart(ME_WrapContext *wc, ME_DisplayItem *pEnd);
|
||||
void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp);
|
||||
BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor);
|
||||
void ME_SendRequestResize(ME_TextEditor *editor, BOOL force);
|
||||
|
||||
/* para.c */
|
||||
ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *run);
|
||||
|
|
|
@ -90,6 +90,8 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, RECT *rcUpda
|
|||
if (ys == c.pt.y) /* don't overwrite the top bar */
|
||||
ys++;
|
||||
}
|
||||
if (editor->nTotalLength != editor->nLastTotalLength)
|
||||
ME_SendRequestResize(editor, FALSE);
|
||||
editor->nLastTotalLength = editor->nTotalLength;
|
||||
ME_DestroyContext(&c);
|
||||
}
|
||||
|
|
|
@ -448,9 +448,36 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) {
|
|||
}
|
||||
editor->sizeWindow.cx = c.rcView.right-c.rcView.left;
|
||||
editor->sizeWindow.cy = c.rcView.bottom-c.rcView.top;
|
||||
|
||||
editor->nTotalLength = c.pt.y;
|
||||
|
||||
ME_DestroyContext(&c);
|
||||
ReleaseDC(hWnd, hDC);
|
||||
return bModified;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ME_SendRequestResize(ME_TextEditor *editor, BOOL force)
|
||||
{
|
||||
if (editor->nEventMask & ENM_REQUESTRESIZE)
|
||||
{
|
||||
RECT rc;
|
||||
|
||||
GetClientRect(editor->hWnd, &rc);
|
||||
|
||||
if (force || rc.bottom != editor->nTotalLength)
|
||||
{
|
||||
REQRESIZE info;
|
||||
|
||||
info.nmhdr.hwndFrom = editor->hWnd;
|
||||
info.nmhdr.idFrom = GetWindowLongW(editor->hWnd, GWLP_ID);
|
||||
info.nmhdr.code = EN_REQUESTRESIZE;
|
||||
info.rc = rc;
|
||||
info.rc.bottom = editor->nTotalLength;
|
||||
|
||||
SendMessageW(GetParent(editor->hWnd), WM_NOTIFY,
|
||||
info.nmhdr.idFrom, (LPARAM)&info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue