From 172d3ac5b92e5f65b43119f47d16068a10eeee15 Mon Sep 17 00:00:00 2001 From: "ssu%netscape.com" Date: Sat, 4 Dec 1999 23:21:26 +0000 Subject: [PATCH] fixes bug #17630. allows the control of at most 3 lines of text on the blue setup background to be displayed. Affects only windows platforms. r=sgehani@netscape.com --- xpinstall/wizard/windows/setup/dialogs.c | 2 +- xpinstall/wizard/windows/setup/extra.c | 40 +++++++++++++++++++++--- xpinstall/wizard/windows/setup/extra.h | 2 +- xpinstall/wizard/windows/setup/setup.h | 3 ++ 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/xpinstall/wizard/windows/setup/dialogs.c b/xpinstall/wizard/windows/setup/dialogs.c index ccd9a96fae8..02a245ed1c0 100644 --- a/xpinstall/wizard/windows/setup/dialogs.c +++ b/xpinstall/wizard/windows/setup/dialogs.c @@ -121,7 +121,7 @@ LRESULT CALLBACK DlgProcMain(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) // Add any drawing code here... PaintGradientShade(hWnd, hdc); - OutputTitle(hdc, sgProduct.szProductName); + OutputSetupTitle(hdc); EndPaint(hWnd, &ps); bReturn = FALSE; diff --git a/xpinstall/wizard/windows/setup/extra.c b/xpinstall/wizard/windows/setup/extra.c index 6808c4855ab..9e94ab0f577 100644 --- a/xpinstall/wizard/windows/setup/extra.c +++ b/xpinstall/wizard/windows/setup/extra.c @@ -243,12 +243,18 @@ HRESULT Initialize(HINSTANCE hInstance) return(0); } -void OutputTitle(HDC hDC, LPSTR szString) +void OutputSetupTitle(HDC hDC) { COLORREF crTitle; HFONT hfontTmp; HFONT hfontOld; int nHeight; + int iLine0x; + int iLine0y; + int iLine1x; + int iLine1y; + int iLine2x; + int iLine2y; SetBkMode(hDC, TRANSPARENT); nHeight = -MulDiv(36, GetDeviceCaps(hDC, LOGPIXELSY), 72); @@ -273,19 +279,31 @@ void OutputTitle(HDC hDC, LPSTR szString) } crTitle = GetTextColor(hDC); + iLine0x = 20; + iLine0y = 20; + iLine1x = iLine0x; + iLine1y = iLine0y - nHeight + 5; + iLine2x = iLine1x; + iLine2y = iLine1y - nHeight + 5; /* Set shadow color to black and draw shadow */ if(SetTextColor(hDC, 0) == CLR_INVALID) PrintError("Invalid Color", ERROR_CODE_SHOW); - TextOut(hDC, 10+5, 10+5, szString, lstrlen(szString)); + /* draw shadow */ + TextOut(hDC, iLine0x + 5, iLine0y + 5, sgProduct.szSetupTitle0, lstrlen(sgProduct.szSetupTitle0)); + TextOut(hDC, iLine1x + 5, iLine1y + 5, sgProduct.szSetupTitle1, lstrlen(sgProduct.szSetupTitle1)); + TextOut(hDC, iLine2x + 5, iLine2y + 5, sgProduct.szSetupTitle2, lstrlen(sgProduct.szSetupTitle2)); /* Set font color and draw; color format is 0x00bbggrr - where b is blue, g is green, and r is red */ /* 0x00088808 - green */ if(SetTextColor(hDC, 0x00EEEEEE) == CLR_INVALID) PrintError("Invalid Color", ERROR_CODE_SHOW); - TextOut(hDC, 10, 10, szString, lstrlen(szString)); + /* draw text */ + TextOut(hDC, iLine0x, iLine0y, sgProduct.szSetupTitle0, lstrlen(sgProduct.szSetupTitle0)); + TextOut(hDC, iLine1x, iLine1y, sgProduct.szSetupTitle1, lstrlen(sgProduct.szSetupTitle1)); + TextOut(hDC, iLine2x, iLine2y, sgProduct.szSetupTitle2, lstrlen(sgProduct.szSetupTitle2)); SelectObject(hDC, hfontOld); DeleteObject(hfontTmp); @@ -1093,6 +1111,12 @@ HRESULT InitSetupGeneral() return(1); if((szTempSetupPath = NS_GlobalAlloc(MAX_BUF)) == NULL) return(1); + if((sgProduct.szSetupTitle0 = NS_GlobalAlloc(MAX_BUF)) == NULL) + return(1); + if((sgProduct.szSetupTitle1 = NS_GlobalAlloc(MAX_BUF)) == NULL) + return(1); + if((sgProduct.szSetupTitle2 = NS_GlobalAlloc(MAX_BUF)) == NULL) + return(1); return(0); } @@ -1105,6 +1129,9 @@ void DeInitSetupGeneral() FreeMemory(&(sgProduct.szProgramFolderPath)); FreeMemory(&(sgProduct.szAlternateArchiveSearchPath)); FreeMemory(&(szTempSetupPath)); + FreeMemory(&(sgProduct.szSetupTitle0)); + FreeMemory(&(sgProduct.szSetupTitle1)); + FreeMemory(&(sgProduct.szSetupTitle2)); } HRESULT InitSDObject() @@ -2291,6 +2318,11 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine) GetPrivateProfileString("General", "Program Folder Name", "", szBuf, MAX_BUF, szFileIniConfig); DecriptString(sgProduct.szProgramFolderName, szBuf); + /* get setup title strings */ + GetPrivateProfileString("General", "Setup Title0", "", sgProduct.szSetupTitle0, MAX_BUF, szFileIniConfig); + GetPrivateProfileString("General", "Setup Title1", "", sgProduct.szSetupTitle1, MAX_BUF, szFileIniConfig); + GetPrivateProfileString("General", "Setup Title2", "", sgProduct.szSetupTitle2, MAX_BUF, szFileIniConfig); + /* Welcome dialog */ GetPrivateProfileString("Dialog Welcome", "Show Dialog", "", szShowDialog, MAX_BUF, szFileIniConfig); GetPrivateProfileString("Dialog Welcome", "Title", "", diWelcome.szTitle, MAX_BUF, szFileIniConfig); @@ -2516,7 +2548,7 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine) hdc = GetDC(hWndMain); - OutputTitle(hdc, sgProduct.szProductName); + OutputSetupTitle(hdc); ReleaseDC(hWndMain, hdc); return(0); diff --git a/xpinstall/wizard/windows/setup/extra.h b/xpinstall/wizard/windows/setup/extra.h index fc357bf3322..29fb406b6b7 100644 --- a/xpinstall/wizard/windows/setup/extra.h +++ b/xpinstall/wizard/windows/setup/extra.h @@ -88,7 +88,7 @@ HRESULT DeInitializeSmartDownload(void); HRESULT ParseSetupIni(void); HRESULT GetConfigIni(void); void CleanTempFiles(void); -void OutputTitle(HDC hDC, LPSTR szString); +void OutputSetupTitle(HDC hDC); HRESULT SdArchives(LPSTR szFileIdi, LPSTR szDownloadDir); HRESULT RetrieveArchives(void); /* HRESULT SmartUpdateJars(void); */ diff --git a/xpinstall/wizard/windows/setup/setup.h b/xpinstall/wizard/windows/setup/setup.h index 080696dca3e..0a2492636fe 100644 --- a/xpinstall/wizard/windows/setup/setup.h +++ b/xpinstall/wizard/windows/setup/setup.h @@ -232,6 +232,9 @@ typedef struct setupStruct LPSTR szProgramFolderName; LPSTR szProgramFolderPath; LPSTR szAlternateArchiveSearchPath; + LPSTR szSetupTitle0; + LPSTR szSetupTitle1; + LPSTR szSetupTitle2; } setupGen; typedef struct sinfoSmartDownload