From 93805344ee0be73d3755e9f5661e1db34f151523 Mon Sep 17 00:00:00 2001 From: Stephane Lussier Date: Fri, 3 Sep 1999 16:37:00 +0000 Subject: [PATCH] Keep the enable state in the edit structure instead of calling IsWindowEnabled(). --- controls/edit.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/controls/edit.c b/controls/edit.c index edfb1879aaa..c90ac11ac12 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -96,6 +96,7 @@ typedef struct INT line_count; /* number of lines */ INT y_offset; /* scroll offset in number of lines */ BOOL bCaptureState; /* flag indicating whether mouse was captured */ + BOOL bEnableState; /* flag keeping the enable state */ /* * only for multi line controls */ @@ -747,6 +748,7 @@ LRESULT WINAPI EditWndProc( HWND hwnd, UINT msg, case WM_ENABLE: DPRINTF_EDIT_MSG32("WM_ENABLE"); + es->bEnableState = (BOOL) wParam; InvalidateRect(hwnd, NULL, TRUE); break; @@ -3097,7 +3099,7 @@ static LRESULT EDIT_WM_EraseBkGnd(WND *wnd, EDITSTATE *es, HDC dc) HBRUSH brush; RECT rc; - if (!IsWindowEnabled(wnd->hwndSelf) || (es->style & ES_READONLY)) + if (!es->bEnableState || (es->style & ES_READONLY)) brush = (HBRUSH)EDIT_SEND_CTLCOLORSTATIC(wnd, dc); else brush = (HBRUSH)EDIT_SEND_CTLCOLOR(wnd, dc); @@ -3660,7 +3662,7 @@ static void EDIT_WM_Paint(WND *wnd, EDITSTATE *es, WPARAM wParam) RECT rc; RECT rcLine; RECT rcRgn; - BOOL rev = IsWindowEnabled(wnd->hwndSelf) && + BOOL rev = es->bEnableState && ((es->flags & EF_FOCUSED) || (es->style & ES_NOHIDESEL)); @@ -3689,11 +3691,12 @@ static void EDIT_WM_Paint(WND *wnd, EDITSTATE *es, WPARAM wParam) } if (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); else EDIT_SEND_CTLCOLOR(wnd, dc); - if (!IsWindowEnabled(wnd->hwndSelf)) + + if (!es->bEnableState) SetTextColor(dc, GetSysColor(COLOR_GRAYTEXT)); GetClipBox(dc, &rcRgn); if (es->style & ES_MULTILINE) {