win32_gui: fix text window background color

This commit is contained in:
Alex Kompel
2015-04-29 12:27:01 -07:00
parent ea21088d2a
commit a75b84af77
2 changed files with 18 additions and 2 deletions

View File

@@ -469,7 +469,7 @@ INT_PTR CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
SetTextColor(hdcEdit,
text_fg_brush ? text_fg_color : (COLORREF)GetSysColor(DEFAULT_COLOR_FG_TEXT)
);
return (BOOL)(text_bg_brush
return (INT_PTR)(text_bg_brush
? text_bg_brush : SYSCLR_TO_BRUSH(DEFAULT_COLOR_BG_TEXT));
}
} return FALSE;
@@ -1556,7 +1556,15 @@ LRESULT CALLBACK NHMenuListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
/* Text control window proc - implements scrolling without a cursor */
LRESULT CALLBACK NHMenuTextWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hDC;
RECT rc;
switch(message) {
case WM_ERASEBKGND:
hDC = (HDC) wParam;
GetClientRect(hWnd, &rc);
FillRect(hDC, &rc, text_bg_brush? text_bg_brush : SYSCLR_TO_BRUSH(DEFAULT_COLOR_BG_TEXT));
return 0;
case WM_KEYDOWN:
switch (wParam)

View File

@@ -164,7 +164,7 @@ INT_PTR CALLBACK NHTextWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
SetTextColor(hdcEdit,
text_fg_brush ? text_fg_color : (COLORREF)GetSysColor(DEFAULT_COLOR_FG_TEXT)
);
return (BOOL)(text_bg_brush
return (INT_PTR)(text_bg_brush
? text_bg_brush : SYSCLR_TO_BRUSH(DEFAULT_COLOR_BG_TEXT));
}
} return FALSE;
@@ -242,7 +242,15 @@ void LayoutText(HWND hWnd)
/* Edit box hook */
LRESULT CALLBACK NHEditHookWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hDC;
RECT rc;
switch(message) {
case WM_ERASEBKGND:
hDC = (HDC) wParam;
GetClientRect(hWnd, &rc);
FillRect(hDC, &rc, text_bg_brush? text_bg_brush : SYSCLR_TO_BRUSH(DEFAULT_COLOR_BG_TEXT));
return 1;
case WM_KEYDOWN:
switch (wParam)