wine/dlls/riched20 wrap.c paint.c editor.h edi ...
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Nov 3 03:52:29 CST 2005
ChangeSet ID: 21068
CVSROOT: /opt/cvs-commit
Module name: wine
Changes by: julliard at winehq.org 2005/11/03 03:52:29
Modified files:
dlls/riched20 : wrap.c paint.c editor.h editor.c caret.c
Log message:
Phil Krylov <phil at newstar.rinet.ru>
Added support for EM_REQUESTRESIZE message, EN_REQUESTRESIZE
notification, and ENM_REQUESTRESIZE event mask.
Patch: http://cvs.winehq.org/patch.py?id=21068
Old revision New revision Changes Path
1.10 1.11 +27 -0 wine/dlls/riched20/wrap.c
1.14 1.15 +2 -0 wine/dlls/riched20/paint.c
1.21 1.22 +1 -0 wine/dlls/riched20/editor.h
1.65 1.66 +6 -3 wine/dlls/riched20/editor.c
1.14 1.15 +4 -0 wine/dlls/riched20/caret.c
Index: wine/dlls/riched20/wrap.c
diff -u -p wine/dlls/riched20/wrap.c:1.10 wine/dlls/riched20/wrap.c:1.11
--- wine/dlls/riched20/wrap.c:1.10 3 Nov 2005 9:52:29 -0000
+++ wine/dlls/riched20/wrap.c 3 Nov 2005 9:52:29 -0000
@@ -448,9 +448,36 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEdit
}
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);
+ }
+ }
+}
Index: wine/dlls/riched20/paint.c
diff -u -p wine/dlls/riched20/paint.c:1.14 wine/dlls/riched20/paint.c:1.15
--- wine/dlls/riched20/paint.c:1.14 3 Nov 2005 9:52:29 -0000
+++ wine/dlls/riched20/paint.c 3 Nov 2005 9:52:29 -0000
@@ -90,6 +90,8 @@ void ME_PaintContent(ME_TextEditor *edit
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);
}
Index: wine/dlls/riched20/editor.h
diff -u -p wine/dlls/riched20/editor.h:1.21 wine/dlls/riched20/editor.h:1.22
--- wine/dlls/riched20/editor.h:1.21 3 Nov 2005 9:52:29 -0000
+++ wine/dlls/riched20/editor.h 3 Nov 2005 9:52:29 -0000
@@ -173,6 +173,7 @@ ME_DisplayItem *ME_MakeRow(int height, i
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);
Index: wine/dlls/riched20/editor.c
diff -u -p wine/dlls/riched20/editor.c:1.65 wine/dlls/riched20/editor.c:1.66
--- wine/dlls/riched20/editor.c:1.65 3 Nov 2005 9:52:29 -0000
+++ wine/dlls/riched20/editor.c 3 Nov 2005 9:52:29 -0000
@@ -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
}
ME_MoveCaret(editor);
ME_SendSelChange(editor);
+ ME_SendRequestResize(editor, FALSE);
return 0;
}
@@ -1134,7 +1135,6 @@ LRESULT WINAPI RichEditANSIWndProc(HWND
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
ME_RewrapRepaint(editor);
return 0;
}
+ case EM_REQUESTRESIZE:
+ ME_SendRequestResize(editor, TRUE);
+ return 0;
case WM_SETREDRAW:
editor->bRedraw = wParam;
return 0;
Index: wine/dlls/riched20/caret.c
diff -u -p wine/dlls/riched20/caret.c:1.14 wine/dlls/riched20/caret.c:1.15
--- wine/dlls/riched20/caret.c:1.14 3 Nov 2005 9:52:29 -0000
+++ wine/dlls/riched20/caret.c 3 Nov 2005 9:52:29 -0000
@@ -1097,6 +1097,7 @@ BOOL ME_ArrowKey(ME_TextEditor *editor,
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,
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,
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: {
More information about the wine-cvs
mailing list