diff --git a/reactos/base/setup/reactos/lang/de-DE.rc b/reactos/base/setup/reactos/lang/de-DE.rc index 7fd838eba19..615b47722cb 100644 --- a/reactos/base/setup/reactos/lang/de-DE.rc +++ b/reactos/base/setup/reactos/lang/de-DE.rc @@ -2,12 +2,16 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL -/* String Tables */ - -STRINGTABLE DISCARDABLE +IDD_STARTPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "ReactOS Setup" +FONT 8, "MS Shell Dlg" BEGIN - IDS_CAPTION "ReactOS Setup" - IDS_TEXT "ReactOS kann nicht direkt von dieser CD installiert werden!\n\nBitte starten Sie Ihren Computer mit dieser CD um ReactOS zu installieren." + LTEXT "Willkommen beim ReactOS Setup Assistenten.", IDC_STARTTITLE, 115, 8, 195, 24 + LTEXT "ReactOS kann noch nicht direkt von dieser CD installiert werden! "\ + "Bitte starten Sie Ihren Computer mit dieser CD um ReactOS zu "\ + "installieren.", IDC_STATIC, 115, 40, 195, 100 + LTEXT "Klicken Sie auf Beenden um das Setup zu verlassen.", IDC_STATIC, 115, 169, 195, 17 END /* EOF */ diff --git a/reactos/base/setup/reactos/lang/en-US.rc b/reactos/base/setup/reactos/lang/en-US.rc index 180f36405a4..3d879bf5bd2 100644 --- a/reactos/base/setup/reactos/lang/en-US.rc +++ b/reactos/base/setup/reactos/lang/en-US.rc @@ -2,11 +2,16 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -/* String Tables */ -STRINGTABLE DISCARDABLE +IDD_STARTPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "ReactOS Setup" +FONT 8, "MS Shell Dlg" BEGIN - IDS_CAPTION "ReactOS Setup" - IDS_TEXT "You cannot install ReactOS directly from this CD!\n\nPlease restart your computer from this CD in order to install ReactOS." + LTEXT "Welcome to the ReactOS Setup Wizard.", IDC_STARTTITLE, 115, 8, 195, 24 + LTEXT "You cannot install ReactOS directly from this CD yet! "\ + "Please restart your computer from this CD in order to "\ + "install ReactOS.", IDC_STATIC, 115, 40, 195, 100 + LTEXT "Click Finish to exit the Setup.", IDC_STATIC, 115, 169, 195, 17 END /* EOF */ diff --git a/reactos/base/setup/reactos/reactos.c b/reactos/base/setup/reactos/reactos.c index 0a24f10da34..31c71c5bc96 100644 --- a/reactos/base/setup/reactos/reactos.c +++ b/reactos/base/setup/reactos/reactos.c @@ -1,6 +1,6 @@ /* * ReactOS applications - * Copyright (C) 2004 ReactOS Team + * Copyright (C) 2004-2008 ReactOS Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,51 +21,129 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS GUI first stage setup application * FILE: subsys/system/reactos/reactos.c - * PROGRAMMERS: Eric Kohl + * PROGRAMMERS: Eric Kohl, Matthias Kupfer */ #include -#include +#include #include "resource.h" -/* GLOBALS ******************************************************************/ - -TCHAR szCaption[256]; -TCHAR szText[256]; - -HINSTANCE hInstance; - - /* FUNCTIONS ****************************************************************/ +static VOID +CenterWindow(HWND hWnd) +{ + HWND hWndParent; + RECT rcParent; + RECT rcWindow; + + hWndParent = GetParent(hWnd); + if (hWndParent == NULL) + hWndParent = GetDesktopWindow(); + + GetWindowRect(hWndParent, &rcParent); + GetWindowRect(hWnd, &rcWindow); + + SetWindowPos(hWnd, + HWND_TOP, + ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2, + ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2, + 0, + 0, + SWP_NOSIZE); +} + +static INT_PTR CALLBACK +StartDlgProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hwndControl; + DWORD dwStyle; + + hwndControl = GetParent(hwndDlg); + + /* Center the wizard window */ + CenterWindow (hwndControl); + + dwStyle = GetWindowLong(hwndControl, GWL_STYLE); + SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); + + /* Hide and disable the 'Cancel' button at the moment, + * later we use this button to cancel the setup process + * like F3 in usetup + */ + hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL); + ShowWindow (hwndControl, SW_HIDE); + EnableWindow (hwndControl, FALSE); + } + break; + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: // Only "Finish" for closing the App + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_FINISH); + break; + default: + break; + } + break; + default: + break; + } + + } + return FALSE; +} + int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) { - hInstance = hInst; + PROPSHEETHEADER psh; + HPROPSHEETPAGE ahpsp[1]; + PROPSHEETPAGE psp = {0}; + UINT nPages = 0; - if (!LoadString(hInstance, - IDS_CAPTION, - szCaption, - (sizeof szCaption / sizeof szCaption[0]))) - return 0; + /* Create the Start page */ + psp.dwSize = sizeof(PROPSHEETPAGE); + psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; + psp.hInstance = hInst; + psp.lParam = 0; + psp.pfnDlgProc = StartDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_STARTPAGE); + ahpsp[nPages++] = CreatePropertySheetPage(&psp); - if (!LoadString(hInstance, - IDS_TEXT, - szText, - (sizeof szText / sizeof szText[0]))) - return 0; + // Here we can add the next pages and switch on later - MessageBox(NULL, - szText, - szCaption, - MB_OK | MB_ICONINFORMATION); + /* Create the property sheet */ + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER; + psh.hInstance = hInst; + psh.hwndParent = NULL; + psh.nPages = nPages; + psh.nStartPage = 0; + psh.phpage = ahpsp; + psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK); + psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER); + + /* Display the wizard */ + PropertySheet(&psh); return 0; + } /* EOF */ diff --git a/reactos/base/setup/reactos/reactos.rbuild b/reactos/base/setup/reactos/reactos.rbuild index 073d6811f53..d1f477412c7 100644 --- a/reactos/base/setup/reactos/reactos.rbuild +++ b/reactos/base/setup/reactos/reactos.rbuild @@ -8,6 +8,7 @@ kernel32 gdi32 user32 + comctl32 reactos.c reactos.rc diff --git a/reactos/base/setup/reactos/reactos.rc b/reactos/base/setup/reactos/reactos.rc index 093c683bf46..58040d8e17a 100644 --- a/reactos/base/setup/reactos/reactos.rc +++ b/reactos/base/setup/reactos/reactos.rc @@ -14,6 +14,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL /* Icons */ IDI_MAIN ICON "res/reactos.ico" +/* Bitmaps */ +IDB_WATERMARK BITMAP "res/watermark.bmp" +IDB_HEADER BITMAP "res/header.bmp" /* Language-specific resources */ #include "rsrc.rc" diff --git a/reactos/base/setup/reactos/res/header.bmp b/reactos/base/setup/reactos/res/header.bmp new file mode 100644 index 00000000000..af7bf7a5935 Binary files /dev/null and b/reactos/base/setup/reactos/res/header.bmp differ diff --git a/reactos/base/setup/reactos/res/watermark.bmp b/reactos/base/setup/reactos/res/watermark.bmp new file mode 100644 index 00000000000..1b42e5b4bd0 Binary files /dev/null and b/reactos/base/setup/reactos/res/watermark.bmp differ diff --git a/reactos/base/setup/reactos/resource.h b/reactos/base/setup/reactos/resource.h index ffb9c7a9b1d..4dd48132c40 100644 --- a/reactos/base/setup/reactos/resource.h +++ b/reactos/base/setup/reactos/resource.h @@ -1,5 +1,15 @@ -#define IDS_CAPTION 1000 -#define IDS_TEXT 1001 +#ifndef RESOURCE_H +#define RESOURCE_H + +#define IDB_WATERMARK 100 +#define IDB_HEADER 101 + +#define IDC_STATIC -1 + +#define IDD_STARTPAGE 2000 +#define IDC_STARTTITLE 2001 #define IDI_MAIN 3000 + +#endif diff --git a/reactos/base/setup/reactos/rsrc.rc b/reactos/base/setup/reactos/rsrc.rc index 31d1b9cc40b..b333f8889e5 100644 --- a/reactos/base/setup/reactos/rsrc.rc +++ b/reactos/base/setup/reactos/rsrc.rc @@ -2,12 +2,12 @@ #include "resource.h" /* Language-specific resources */ -#include "lang/bg-BG.rc" -#include "lang/cs-CZ.rc" +/*#include "lang/bg-BG.rc" +#include "lang/cs-CZ.rc"*/ #include "lang/de-DE.rc" -#include "lang/el-GR.rc" +//#include "lang/el-GR.rc" #include "lang/en-US.rc" -#include "lang/es-ES.rc" +/*#include "lang/es-ES.rc" #include "lang/fi-FI.rc" #include "lang/fr-FR.rc" #include "lang/hu-HU.rc" @@ -24,4 +24,4 @@ #include "lang/sv-SE.rc" #include "lang/th-TH.rc" #include "lang/uk-UA.rc" -#include "lang/zh-CN.rc" +#include "lang/zh-CN.rc"*/