Display of ReactOS bitmap implemented.

svn path=/trunk/; revision=34588
This commit is contained in:
Matthias Kupfer 2008-07-19 17:20:20 +00:00
parent 909b7f0308
commit aa4af5693a
2 changed files with 81 additions and 6 deletions

View file

@ -19,11 +19,11 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYS
CAPTION "ReactOS Setup" CAPTION "ReactOS Setup"
FONT 8, "MS Shell Dlg" FONT 8, "MS Shell Dlg"
BEGIN BEGIN
CONTROL "IDB_LOGO", IDB_ROSLOGO, "Static", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, 18, 7, 290, 74 CONTROL "IDB_LOGO", IDB_ROSLOGO, "Static", WS_CHILD | WS_VISIBLE | SS_OWNERDRAW, 18, 0, 290, 99
CONTROL "Setup language:", IDC_STATIC, "Static", WS_CHILD | WS_VISIBLE | WS_GROUP | SS_RIGHT, 20, 99, 106, 11 CONTROL "Setup language:", IDC_STATIC, "Static", WS_CHILD | WS_VISIBLE | WS_GROUP | SS_RIGHT, 20, 109, 106, 11
CONTROL "", IDC_LANGUAGES,"ComboBox",WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST, 132, 97, 176, 142 CONTROL "", IDC_LANGUAGES, "ComboBox", WS_VSCROLL | WS_TABSTOP | CBS_DROPDOWNLIST, 132, 107, 176, 142
CONTROL "Keyboard or input method:", IDC_STATIC, "Static", WS_CHILD | WS_VISIBLE | WS_GROUP | SS_RIGHT, 20, 132, 106, 11 CONTROL "Keyboard or input method:", IDC_STATIC, "Static", WS_CHILD | WS_VISIBLE | WS_GROUP | SS_RIGHT, 20, 142, 106, 11
CONTROL "", IDC_KEYLAYOUT, "ComboBox", WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST, 132, 131, 176, 81 CONTROL "", IDC_KEYLAYOUT, "ComboBox", WS_VSCROLL | WS_TABSTOP | CBS_DROPDOWNLIST, 132, 141, 176, 81
LTEXT "Click Next to select the setup type.", IDC_STATIC, 10, 180 ,297, 10 LTEXT "Click Next to select the setup type.", IDC_STATIC, 10, 180 ,297, 10
END END

View file

@ -51,7 +51,15 @@ struct
BOOLEAN RepairUpdateFlag; // flag for update/repair an installed reactos BOOLEAN RepairUpdateFlag; // flag for update/repair an installed reactos
} SetupData; } SetupData;
typedef struct _IMGINFO
{
HBITMAP hBitmap;
INT cxSource;
INT cySource;
} IMGINFO, *PIMGINFO;
TCHAR abort_msg[512],abort_title[64]; TCHAR abort_msg[512],abort_title[64];
HINSTANCE hInstance;
BOOL isUnattend; BOOL isUnattend;
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
@ -104,6 +112,29 @@ CreateTitleFont(VOID)
return hFont; return hFont;
} }
static VOID
InitImageInfo(PIMGINFO ImgInfo)
{
BITMAP bitmap;
ZeroMemory(ImgInfo, sizeof(*ImgInfo));
ImgInfo->hBitmap = LoadImage(hInstance,
MAKEINTRESOURCE(IDB_ROSLOGO),
IMAGE_BITMAP,
0,
0,
LR_DEFAULTCOLOR);
if (ImgInfo->hBitmap != NULL)
{
GetObject(ImgInfo->hBitmap, sizeof(BITMAP), &bitmap);
ImgInfo->cxSource = bitmap.bmWidth;
ImgInfo->cySource = bitmap.bmHeight;
}
}
static INT_PTR CALLBACK static INT_PTR CALLBACK
StartDlgProc(HWND hwndDlg, StartDlgProc(HWND hwndDlg,
UINT uMsg, UINT uMsg,
@ -169,6 +200,8 @@ LangSelDlgProc(HWND hwndDlg,
WPARAM wParam, WPARAM wParam,
LPARAM lParam) LPARAM lParam)
{ {
PIMGINFO pImgInfo;
pImgInfo = (PIMGINFO)GetWindowLongPtr(hwndDlg, DWLP_USER);
switch (uMsg) switch (uMsg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
@ -188,14 +221,55 @@ LangSelDlgProc(HWND hwndDlg,
ShowWindow (hwndControl, SW_SHOW); ShowWindow (hwndControl, SW_SHOW);
EnableWindow (hwndControl, TRUE); EnableWindow (hwndControl, TRUE);
pImgInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IMGINFO));
if (pImgInfo == NULL)
{
EndDialog(hwndDlg, 0);
return FALSE;
}
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pImgInfo);
InitImageInfo(pImgInfo);
/* Set title font */ /* Set title font */
/*SendDlgItemMessage(hwndDlg, /*SendDlgItemMessage(hwndDlg,
IDC_STARTTITLE, IDC_STARTTITLE,
WM_SETFONT, WM_SETFONT,
(WPARAM)hTitleFont, (WPARAM)hTitleFont,
(LPARAM)TRUE);*/ (LPARAM)TRUE);*/
} }
break; break;
case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT lpDrawItem;
lpDrawItem = (LPDRAWITEMSTRUCT) lParam;
if (lpDrawItem->CtlID == IDB_ROSLOGO)
{
HDC hdcMem;
LONG left;
/* position image in centre of dialog */
left = (lpDrawItem->rcItem.right - pImgInfo->cxSource) / 2;
hdcMem = CreateCompatibleDC(lpDrawItem->hDC);
if (hdcMem != NULL)
{
SelectObject(hdcMem, pImgInfo->hBitmap);
BitBlt(lpDrawItem->hDC,
left,
lpDrawItem->rcItem.top,
lpDrawItem->rcItem.right - lpDrawItem->rcItem.left,
lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top,
hdcMem,
0,
0,
SRCCOPY);
DeleteDC(hdcMem);
}
}
return TRUE;
}
case WM_NOTIFY: case WM_NOTIFY:
{ {
LPNMHDR lpnm = (LPNMHDR)lParam; LPNMHDR lpnm = (LPNMHDR)lParam;
@ -551,6 +625,7 @@ WinMain(HINSTANCE hInst,
HPROPSHEETPAGE ahpsp[7]; HPROPSHEETPAGE ahpsp[7];
PROPSHEETPAGE psp = {0}; PROPSHEETPAGE psp = {0};
UINT nPages = 0; UINT nPages = 0;
hInstance = hInst;
isUnattend = isUnattendSetup(); isUnattend = isUnattendSetup();
if (!isUnattend) if (!isUnattend)