From: Toni Wilen Date: Tue, 4 Jul 2017 09:22:58 +0000 (+0300) Subject: Statusbar background color check update. X-Git-Tag: 3600~168 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=296cf1fcb6b73a40f9f2e74f3c96ac0ce78eaecb;p=francis%2Fwinuae.git Statusbar background color check update. --- diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 78ba7916..0fb4eafa 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -1462,7 +1462,7 @@ static void processtouch(HWND hwnd, WPARAM wParam, LPARAM lParam) #if TOUCH_DEBUG write_log(_T("TOUCHED GUI\n"), touch_time); #endif - inputdevice_add_inputcode(AKS_ENTERGUI, 1); + inputdevice_add_inputcode(AKS_ENTERGUI, 1, NULL); } #if TOUCH_DEBUG write_log(_T("RELEASED\n")); @@ -1563,7 +1563,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, case WM_KEYDOWN: if (dinput_wmkey ((uae_u32)lParam)) - inputdevice_add_inputcode (AKS_ENTERGUI, 1); + inputdevice_add_inputcode (AKS_ENTERGUI, 1, NULL); return 0; case WM_LBUTTONUP: @@ -2028,7 +2028,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, } } else if (num == 5) { if (nm->code == NM_CLICK) // POWER - inputdevice_add_inputcode (AKS_ENTERGUI, 1); + inputdevice_add_inputcode (AKS_ENTERGUI, 1, NULL); else uae_reset (0, 1); } else if (num == 4) { @@ -2342,6 +2342,16 @@ static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, { LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT)lParam; if (lpDIS->hwndItem == hStatusWnd) { + HBRUSH b = (HBRUSH)(COLOR_3DFACE + 1); + if (hStatusBkgB == NULL) { + COLORREF c = GetPixel(lpDIS->hDC, lpDIS->rcItem.left + (lpDIS->rcItem.right - lpDIS->rcItem.left) / 2, lpDIS->rcItem.top + (lpDIS->rcItem.bottom - lpDIS->rcItem.top) / 2); + if (c != CLR_INVALID) { + hStatusBkgB = CreateSolidBrush(c); + } + } + if (hStatusBkgB != NULL) { + b = hStatusBkgB; + } if (lpDIS->itemID == window_led_msg_start) { COLORREF oc; int x = lpDIS->rcItem.left + 1; @@ -2349,7 +2359,7 @@ static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, const TCHAR *txt = statusline_fetch(); int flags = DT_VCENTER | DT_SINGLELINE | DT_LEFT; - FillRect(lpDIS->hDC, &lpDIS->rcItem, (HBRUSH)(COLOR_3DFACE + 1)); + FillRect(lpDIS->hDC, &lpDIS->rcItem, hStatusBkgB); if (txt) { SetBkMode(lpDIS->hDC, TRANSPARENT); oc = SetTextColor(lpDIS->hDC, RGB(0x00, 0x00, 0x00)); @@ -2365,7 +2375,7 @@ static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, r.right--; r.top++; r.bottom--; - FillRect (lpDIS->hDC, &r, (HBRUSH)(COLOR_3DFACE + 1)); + FillRect (lpDIS->hDC, &r, hStatusBkgB); for (int i = 0; i < 2; i++) { int buttons = guijoybutton[port + i * 2]; int m = i == 0 ? 1 : 2; @@ -2463,7 +2473,7 @@ static LRESULT CALLBACK HiddenWindowProc (HWND hWnd, UINT message, WPARAM wParam break; case WM_LBUTTONDBLCLK: if (!gui_active) - inputdevice_add_inputcode (AKS_ENTERGUI, 1); + inputdevice_add_inputcode (AKS_ENTERGUI, 1, NULL); break; case WM_RBUTTONDOWN: if (!gui_active) @@ -2477,7 +2487,7 @@ static LRESULT CALLBACK HiddenWindowProc (HWND hWnd, UINT message, WPARAM wParam switch (wParam & 0xffff) { case ID_ST_CONFIGURATION: - inputdevice_add_inputcode (AKS_ENTERGUI, 1); + inputdevice_add_inputcode (AKS_ENTERGUI, 1, NULL); break; case ID_ST_HELP: if (pHtmlHelp) @@ -5078,24 +5088,6 @@ static int betamessage (void) return 1; } -static int dxdetect (void) -{ -#if !defined(WIN64) - /* believe or not but this is MS supported way of detecting DX8+ */ - HMODULE h = LoadLibrary (_T("D3D8.DLL")); - TCHAR szWrongDXVersion[MAX_DPATH]; - if (h) { - FreeLibrary (h); - return 1; - } - WIN32GUI_LoadUIString (IDS_WRONGDXVERSION, szWrongDXVersion, MAX_DPATH); - pre_gui_message (szWrongDXVersion); - return 0; -#else - return 1; -#endif -} - int os_admin, os_64bit, os_win7, os_vista, cpu_number, os_touch; BOOL os_dwm_enabled; @@ -5648,6 +5640,10 @@ static int parseargs (const TCHAR *argx, const TCHAR *np, const TCHAR *np2) console_logging = 1; return 1; } + if (!_tcscmp (arg, _T("logfile"))) { + winuaelog_temporary_enable = true; + return 1; + } #ifdef FILESYS if (!_tcscmp (arg, _T("rdbdump"))) { do_rdbdump = 1; @@ -6253,8 +6249,6 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR if (!osdetect ()) return 0; - if (!dxdetect ()) - return 0; if (os_vista) { max_uae_width = 8192; diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 566b305d..0195b4a8 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -258,7 +258,8 @@ static BOOL doInit (void); int default_freq = 60; -HWND hStatusWnd = NULL; +HWND hStatusWnd; +HBRUSH hStatusBkgB; static uae_u8 *scrlinebuf; @@ -1714,6 +1715,9 @@ static void close_hwnds (void) ShowWindow (hStatusWnd, SW_HIDE); DestroyWindow (hStatusWnd); hStatusWnd = 0; + if (hStatusBkgB) + DeleteObject(hStatusBkgB); + hStatusBkgB = NULL; } if (hAmigaWnd) { addnotifications (hAmigaWnd, TRUE, FALSE); diff --git a/od-win32/win32gfx.h b/od-win32/win32gfx.h index 31624605..770212d9 100644 --- a/od-win32/win32gfx.h +++ b/od-win32/win32gfx.h @@ -22,6 +22,7 @@ int WIN32GFX_AdjustScreenmode (struct MultiDisplay *md, int *pwidth, int *pheigh extern HCURSOR normalcursor; extern HWND hStatusWnd; +extern HBRUSH hStatusBkgB; extern int default_freq; extern int normal_display_change_starting; extern int window_led_drives, window_led_drives_end;