Commit 3405f5c6 authored by Pascal Lessard's avatar Pascal Lessard Committed by Alexandre Julliard

The format rect is recalculated for each font change. MoveEnd &

MoveHome improved.
parent 41875795
...@@ -1463,8 +1463,9 @@ static void EDIT_MoveEnd(WND *wnd, EDITSTATE *es, BOOL extend) ...@@ -1463,8 +1463,9 @@ static void EDIT_MoveEnd(WND *wnd, EDITSTATE *es, BOOL extend)
BOOL after_wrap = FALSE; BOOL after_wrap = FALSE;
INT e; INT e;
/* Pass a high value in x to make sure of receiving the en of the line */
if (es->style & ES_MULTILINE) if (es->style & ES_MULTILINE)
e = EDIT_CharFromPos(wnd, es, 0x7fffffff, e = EDIT_CharFromPos(wnd, es, 0x3fffffff,
HIWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, es->flags & EF_AFTER_WRAP)), &after_wrap); HIWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, es->flags & EF_AFTER_WRAP)), &after_wrap);
else else
e = lstrlenA(es->text); e = lstrlenA(es->text);
...@@ -1507,8 +1508,9 @@ static void EDIT_MoveHome(WND *wnd, EDITSTATE *es, BOOL extend) ...@@ -1507,8 +1508,9 @@ static void EDIT_MoveHome(WND *wnd, EDITSTATE *es, BOOL extend)
{ {
INT e; INT e;
/* Pass the x_offset in x to make sure of receiving the first position of the line */
if (es->style & ES_MULTILINE) if (es->style & ES_MULTILINE)
e = EDIT_CharFromPos(wnd, es, 0x80000000, e = EDIT_CharFromPos(wnd, es, -es->x_offset,
HIWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, es->flags & EF_AFTER_WRAP)), NULL); HIWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, es->flags & EF_AFTER_WRAP)), NULL);
else else
e = 0; e = 0;
...@@ -3665,7 +3667,6 @@ static void EDIT_WM_Paint(WND *wnd, EDITSTATE *es, WPARAM wParam) ...@@ -3665,7 +3667,6 @@ static void EDIT_WM_Paint(WND *wnd, EDITSTATE *es, WPARAM wParam)
BOOL rev = es->bEnableState && BOOL rev = es->bEnableState &&
((es->flags & EF_FOCUSED) || ((es->flags & EF_FOCUSED) ||
(es->style & ES_NOHIDESEL)); (es->style & ES_NOHIDESEL));
if (es->flags & EF_UPDATE) if (es->flags & EF_UPDATE)
EDIT_NOTIFY_PARENT(wnd, EN_UPDATE, "EN_UPDATE"); EDIT_NOTIFY_PARENT(wnd, EN_UPDATE, "EN_UPDATE");
...@@ -3800,6 +3801,7 @@ static void EDIT_WM_SetFont(WND *wnd, EDITSTATE *es, HFONT font, BOOL redraw) ...@@ -3800,6 +3801,7 @@ static void EDIT_WM_SetFont(WND *wnd, EDITSTATE *es, HFONT font, BOOL redraw)
TEXTMETRICA tm; TEXTMETRICA tm;
HDC dc; HDC dc;
HFONT old_font = 0; HFONT old_font = 0;
RECT r;
es->font = font; es->font = font;
dc = GetDC(wnd->hwndSelf); dc = GetDC(wnd->hwndSelf);
...@@ -3814,13 +3816,14 @@ static void EDIT_WM_SetFont(WND *wnd, EDITSTATE *es, HFONT font, BOOL redraw) ...@@ -3814,13 +3816,14 @@ static void EDIT_WM_SetFont(WND *wnd, EDITSTATE *es, HFONT font, BOOL redraw)
if (font && (TWEAK_WineLook > WIN31_LOOK)) if (font && (TWEAK_WineLook > WIN31_LOOK))
EDIT_EM_SetMargins(wnd, es, EC_LEFTMARGIN | EC_RIGHTMARGIN, EDIT_EM_SetMargins(wnd, es, EC_LEFTMARGIN | EC_RIGHTMARGIN,
EC_USEFONTINFO, EC_USEFONTINFO); EC_USEFONTINFO, EC_USEFONTINFO);
/* Force the recalculation of the format rect for each font change */
GetClientRect(wnd->hwndSelf, &r);
EDIT_SetRectNP(wnd, es, &r);
if (es->style & ES_MULTILINE) if (es->style & ES_MULTILINE)
EDIT_BuildLineDefs_ML(wnd, es); EDIT_BuildLineDefs_ML(wnd, es);
else {
RECT r;
GetClientRect(wnd->hwndSelf, &r);
EDIT_SetRectNP(wnd, es, &r);
}
if (redraw) if (redraw)
InvalidateRect(wnd->hwndSelf, NULL, TRUE); InvalidateRect(wnd->hwndSelf, NULL, TRUE);
if (es->flags & EF_FOCUSED) { if (es->flags & EF_FOCUSED) {
......
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