Commit 93805344 authored by Stephane Lussier's avatar Stephane Lussier Committed by Alexandre Julliard

Keep the enable state in the edit structure instead of calling

IsWindowEnabled().
parent 2970067b
...@@ -96,6 +96,7 @@ typedef struct ...@@ -96,6 +96,7 @@ typedef struct
INT line_count; /* number of lines */ INT line_count; /* number of lines */
INT y_offset; /* scroll offset in number of lines */ INT y_offset; /* scroll offset in number of lines */
BOOL bCaptureState; /* flag indicating whether mouse was captured */ BOOL bCaptureState; /* flag indicating whether mouse was captured */
BOOL bEnableState; /* flag keeping the enable state */
/* /*
* only for multi line controls * only for multi line controls
*/ */
...@@ -747,6 +748,7 @@ LRESULT WINAPI EditWndProc( HWND hwnd, UINT msg, ...@@ -747,6 +748,7 @@ LRESULT WINAPI EditWndProc( HWND hwnd, UINT msg,
case WM_ENABLE: case WM_ENABLE:
DPRINTF_EDIT_MSG32("WM_ENABLE"); DPRINTF_EDIT_MSG32("WM_ENABLE");
es->bEnableState = (BOOL) wParam;
InvalidateRect(hwnd, NULL, TRUE); InvalidateRect(hwnd, NULL, TRUE);
break; break;
...@@ -3097,7 +3099,7 @@ static LRESULT EDIT_WM_EraseBkGnd(WND *wnd, EDITSTATE *es, HDC dc) ...@@ -3097,7 +3099,7 @@ static LRESULT EDIT_WM_EraseBkGnd(WND *wnd, EDITSTATE *es, HDC dc)
HBRUSH brush; HBRUSH brush;
RECT rc; RECT rc;
if (!IsWindowEnabled(wnd->hwndSelf) || (es->style & ES_READONLY)) if (!es->bEnableState || (es->style & ES_READONLY))
brush = (HBRUSH)EDIT_SEND_CTLCOLORSTATIC(wnd, dc); brush = (HBRUSH)EDIT_SEND_CTLCOLORSTATIC(wnd, dc);
else else
brush = (HBRUSH)EDIT_SEND_CTLCOLOR(wnd, dc); brush = (HBRUSH)EDIT_SEND_CTLCOLOR(wnd, dc);
...@@ -3660,7 +3662,7 @@ static void EDIT_WM_Paint(WND *wnd, EDITSTATE *es, WPARAM wParam) ...@@ -3660,7 +3662,7 @@ static void EDIT_WM_Paint(WND *wnd, EDITSTATE *es, WPARAM wParam)
RECT rc; RECT rc;
RECT rcLine; RECT rcLine;
RECT rcRgn; RECT rcRgn;
BOOL rev = IsWindowEnabled(wnd->hwndSelf) && BOOL rev = es->bEnableState &&
((es->flags & EF_FOCUSED) || ((es->flags & EF_FOCUSED) ||
(es->style & ES_NOHIDESEL)); (es->style & ES_NOHIDESEL));
...@@ -3689,11 +3691,12 @@ static void EDIT_WM_Paint(WND *wnd, EDITSTATE *es, WPARAM wParam) ...@@ -3689,11 +3691,12 @@ static void EDIT_WM_Paint(WND *wnd, EDITSTATE *es, WPARAM wParam)
} }
if (es->font) if (es->font)
old_font = SelectObject(dc, es->font); old_font = SelectObject(dc, es->font);
if (!IsWindowEnabled(wnd->hwndSelf) || (es->style & ES_READONLY)) if (!es->bEnableState || (es->style & ES_READONLY))
EDIT_SEND_CTLCOLORSTATIC(wnd, dc); EDIT_SEND_CTLCOLORSTATIC(wnd, dc);
else else
EDIT_SEND_CTLCOLOR(wnd, dc); EDIT_SEND_CTLCOLOR(wnd, dc);
if (!IsWindowEnabled(wnd->hwndSelf))
if (!es->bEnableState)
SetTextColor(dc, GetSysColor(COLOR_GRAYTEXT)); SetTextColor(dc, GetSysColor(COLOR_GRAYTEXT));
GetClipBox(dc, &rcRgn); GetClipBox(dc, &rcRgn);
if (es->style & ES_MULTILINE) { if (es->style & ES_MULTILINE) {
......
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