Merge pull request #734 from toehead2001/about-box
Use a standard window for the About dialog
This commit is contained in:
commit
89d6811068
|
@ -157,9 +157,9 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="User Interface\Bitmaps\AboutScreenBottom.bmp" />
|
||||
<Image Include="User Interface\Bitmaps\AboutScreenLogo.bmp" />
|
||||
<Image Include="User Interface\Bitmaps\AboutScreenMiddle.bmp" />
|
||||
<Image Include="User Interface\Bitmaps\AboutScreenTop.bmp" />
|
||||
<Image Include="User Interface\Bitmaps\CloseNormal.bmp" />
|
||||
<Image Include="User Interface\Bitmaps\LangOK.bmp" />
|
||||
<Image Include="User Interface\Bitmaps\LangOK_down.bmp" />
|
||||
<Image Include="User Interface\Icons\left.ico" />
|
||||
|
|
|
@ -431,9 +431,6 @@
|
|||
<Image Include="User Interface\Bitmaps\AboutScreenTop.bmp">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Image>
|
||||
<Image Include="User Interface\Bitmaps\CloseNormal.bmp">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Image>
|
||||
<Image Include="User Interface\Bitmaps\LangOK.bmp">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Image>
|
||||
|
@ -455,6 +452,9 @@
|
|||
<Image Include="User Interface\Bitmaps\tri-state.bmp">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Image>
|
||||
<Image Include="User Interface\Bitmaps\AboutScreenLogo.bmp">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="User Interface\Icons\divider.cur">
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 123 KiB |
|
@ -149,7 +149,7 @@ void CMainGui::ChangeWinSize(long width, long height)
|
|||
|
||||
void CMainGui::AboutBox(void)
|
||||
{
|
||||
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_About), m_hMainWindow, (DLGPROC)AboutBoxProc, (LPARAM)this);
|
||||
DialogBoxParamW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_About), m_hMainWindow, (DLGPROC)AboutBoxProc, (LPARAM)this);
|
||||
}
|
||||
|
||||
void CMainGui::AboutIniBox(void)
|
||||
|
@ -973,45 +973,9 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
WNDPROC pfnWndAboutBoxCancelProc = NULL;
|
||||
HBITMAP hCloseButton = NULL;
|
||||
|
||||
DWORD CALLBACK AboutBoxCancelProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam)
|
||||
{
|
||||
switch (uMsg) {
|
||||
case WM_PAINT:
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
|
||||
if (BeginPaint(hWnd, &ps))
|
||||
{
|
||||
if (hCloseButton)
|
||||
{
|
||||
RECT rcClient;
|
||||
GetClientRect(hWnd, &rcClient);
|
||||
|
||||
BITMAP bmTL1;
|
||||
GetObject(hCloseButton, sizeof(BITMAP), &bmTL1);
|
||||
HDC memdc = CreateCompatibleDC(ps.hdc);
|
||||
HGDIOBJ save = SelectObject(memdc, hCloseButton);
|
||||
BitBlt(ps.hdc, 0, 0, bmTL1.bmWidth, bmTL1.bmHeight, memdc, 0, 0, SRCCOPY);
|
||||
SelectObject(memdc, save);
|
||||
DeleteDC(memdc);
|
||||
}
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return CallWindowProc(pfnWndAboutBoxCancelProc, hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam)
|
||||
{
|
||||
static HBITMAP hbmpBackgroundTop = NULL;
|
||||
static HBITMAP hbmpBackgroundBottom = NULL;
|
||||
static HBITMAP hbmpBackgroundMiddle = NULL;
|
||||
static HFONT hPageHeadingFont = NULL;
|
||||
static HFONT hTextFont = NULL;
|
||||
static HFONT hAuthorFont = NULL;
|
||||
|
@ -1019,43 +983,15 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam)
|
|||
switch (uMsg) {
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
enum { ROUND_EDGE = 15 };
|
||||
|
||||
DWORD dwStyle = GetWindowLong(hWnd, GWL_STYLE);
|
||||
dwStyle &= ~(WS_CAPTION | WS_SIZEBOX);
|
||||
SetWindowLong(hWnd, GWL_STYLE, dwStyle);
|
||||
//Title
|
||||
SetWindowTextW(hWnd, GS(PLUG_ABOUT));
|
||||
|
||||
// Use the size of the image
|
||||
hbmpBackgroundTop = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT_TOP));
|
||||
hbmpBackgroundBottom = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT_BOTTOM));
|
||||
hbmpBackgroundMiddle = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT_MIDDLE));
|
||||
hbmpBackgroundTop = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT_LOGO));
|
||||
|
||||
BITMAP bmTL;
|
||||
GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL);
|
||||
|
||||
hCloseButton = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_CLOSE_NORMAL));
|
||||
pfnWndAboutBoxCancelProc = (WNDPROC)::GetWindowLongPtr(GetDlgItem(hWnd, IDCANCEL), GWLP_WNDPROC);
|
||||
::SetWindowLongPtr(GetDlgItem(hWnd, IDCANCEL), GWLP_WNDPROC, (LONG_PTR)AboutBoxCancelProc);
|
||||
|
||||
if (hbmpBackgroundTop)
|
||||
{
|
||||
// int iHeight = bmTL.bmHeight;
|
||||
int iWidth = bmTL.bmWidth;
|
||||
|
||||
RECT rect;
|
||||
GetWindowRect(hWnd, &rect);
|
||||
rect.left -= rect.left;
|
||||
rect.bottom -= rect.top;
|
||||
rect.top -= rect.top;
|
||||
|
||||
HRGN hWindowRegion = CreateRoundRectRgn(rect.left, rect.top, rect.left + iWidth + GetSystemMetrics(SM_CXEDGE) - 1, rect.bottom + GetSystemMetrics(SM_CYEDGE) - 1, ROUND_EDGE, ROUND_EDGE);
|
||||
if (hWindowRegion)
|
||||
{
|
||||
SetWindowRgn(hWnd, hWindowRegion, TRUE);
|
||||
DeleteObject(hWindowRegion);
|
||||
}
|
||||
}
|
||||
|
||||
hTextFont = ::CreateFont(18, 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial");
|
||||
hAuthorFont = ::CreateFont(18, 0, 0, 0, FW_BOLD, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial");
|
||||
|
||||
|
@ -1114,6 +1050,22 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam)
|
|||
return (LONG)(LRESULT)((HBRUSH)GetStockObject(NULL_BRUSH));
|
||||
}
|
||||
break;
|
||||
case WM_ERASEBKGND:
|
||||
{
|
||||
HPEN outline;
|
||||
HBRUSH fill;
|
||||
RECT rect;
|
||||
|
||||
outline = CreatePen(PS_SOLID, 1, 0x00FFFFFF);
|
||||
fill = CreateSolidBrush(0x00FFFFFF);
|
||||
SelectObject((HDC)wParam, outline);
|
||||
SelectObject((HDC)wParam, fill);
|
||||
|
||||
GetClientRect(hWnd, &rect);
|
||||
|
||||
Rectangle((HDC)wParam, rect.left, rect.top, rect.right, rect.bottom);
|
||||
}
|
||||
break;
|
||||
case WM_PAINT:
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
|
@ -1123,10 +1075,8 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam)
|
|||
RECT rcClient;
|
||||
GetClientRect(hWnd, &rcClient);
|
||||
|
||||
BITMAP bmTL_top, bmTL_bottom, bmTL_Middle;
|
||||
BITMAP bmTL_top;
|
||||
GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL_top);
|
||||
GetObject(hbmpBackgroundBottom, sizeof(BITMAP), &bmTL_bottom);
|
||||
GetObject(hbmpBackgroundMiddle, sizeof(BITMAP), &bmTL_Middle);
|
||||
|
||||
HDC memdc = CreateCompatibleDC(ps.hdc);
|
||||
HGDIOBJ save = SelectObject(memdc, hbmpBackgroundTop);
|
||||
|
@ -1134,24 +1084,6 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam)
|
|||
SelectObject(memdc, save);
|
||||
DeleteDC(memdc);
|
||||
|
||||
memdc = CreateCompatibleDC(ps.hdc);
|
||||
save = SelectObject(memdc, hbmpBackgroundMiddle);
|
||||
for (int x = bmTL_top.bmHeight; x < rcClient.bottom; x += bmTL_Middle.bmHeight)
|
||||
{
|
||||
BitBlt(ps.hdc, 0, x, bmTL_Middle.bmWidth, bmTL_Middle.bmHeight, memdc, 0, 0, SRCCOPY);
|
||||
}
|
||||
SelectObject(memdc, save);
|
||||
DeleteDC(memdc);
|
||||
|
||||
BITMAP;
|
||||
memdc = CreateCompatibleDC(ps.hdc);
|
||||
save = SelectObject(memdc, hbmpBackgroundBottom);
|
||||
BitBlt(ps.hdc, 0, rcClient.bottom - bmTL_bottom.bmHeight, bmTL_bottom.bmWidth, bmTL_bottom.bmHeight, memdc, 0, 0, SRCCOPY);
|
||||
SelectObject(memdc, save);
|
||||
DeleteDC(memdc);
|
||||
|
||||
BITMAP;
|
||||
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
}
|
||||
|
@ -1165,14 +1097,6 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam)
|
|||
{
|
||||
DeleteObject(hbmpBackgroundTop);
|
||||
}
|
||||
if (hbmpBackgroundBottom)
|
||||
{
|
||||
DeleteObject(hbmpBackgroundBottom);
|
||||
}
|
||||
if (hbmpBackgroundMiddle)
|
||||
{
|
||||
DeleteObject(hbmpBackgroundMiddle);
|
||||
}
|
||||
if (hTextFont)
|
||||
{
|
||||
::DeleteObject(hTextFont);
|
||||
|
|
|
@ -383,12 +383,10 @@ BEGIN
|
|||
PUSHBUTTON "OK",IDOK,134,230,47,13
|
||||
END
|
||||
|
||||
IDD_About DIALOGEX 0, 0, 254, 258
|
||||
STYLE DS_SETFONT | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||
EXSTYLE WS_EX_RIGHT | WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR
|
||||
IDD_About DIALOGEX 0, 0, 233, 265
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
PUSHBUTTON "X",IDCANCEL,211,8,14,13,BS_LEFT,WS_EX_RIGHT | WS_EX_RTLREADING
|
||||
LTEXT "Core Project 64 Team:",IDC_TEAM,15,87,168,17
|
||||
LTEXT "Zilmar",IDC_ZILMAR,15,108,49,11
|
||||
LTEXT "founder. Core and application programmer. Web site.",IDC_ZILMAR_DETAILS,69,107,151,24
|
||||
|
@ -889,7 +887,7 @@ END
|
|||
|
||||
IDB_TRI_STATE BITMAP "Bitmaps\\tri-state.bmp"
|
||||
IDB_LISTITEMS BITMAP "Bitmaps\\ListItems.bmp"
|
||||
IDB_CLOSE_NORMAL BITMAP "Bitmaps\\CloseNormal.bmp"
|
||||
IDB_ABOUT_LOGO BITMAP "Bitmaps\\AboutScreenLogo.bmp"
|
||||
IDB_ABOUT_TOP BITMAP "Bitmaps\\AboutScreenTop.bmp"
|
||||
IDB_ABOUT_BOTTOM BITMAP "Bitmaps\\AboutScreenBottom.bmp"
|
||||
IDB_ABOUT_MIDDLE BITMAP "Bitmaps\\AboutScreenMiddle.bmp"
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#define IDD_Settings_RomBrowser 140
|
||||
#define IDD_About_UserInfo 141
|
||||
#define IDD_About_Ini 143
|
||||
#define IDB_CLOSE_NORMAL 143
|
||||
#define IDB_ABOUT_LOGO 143
|
||||
#define IDD_Settings_General 144
|
||||
#define IDB_ABOUT_TOP 144
|
||||
#define IDD_Settings_Accelerator 145
|
||||
|
|
Loading…
Reference in New Issue