Author: mkupfer
Date: Sat Jul 5 12:55:38 2008
New Revision: 34307
URL:
http://svn.reactos.org/svn/reactos?rev=34307&view=rev
Log:
- converted 1st stage setup stub from message box style to property sheet style
- property page for English and German added
- other languages needs to be translated and enabled in rsrc.rc
Added:
trunk/reactos/base/setup/reactos/res/header.bmp (with props)
trunk/reactos/base/setup/reactos/res/watermark.bmp (with props)
Modified:
trunk/reactos/base/setup/reactos/lang/de-DE.rc
trunk/reactos/base/setup/reactos/lang/en-US.rc
trunk/reactos/base/setup/reactos/reactos.c
trunk/reactos/base/setup/reactos/reactos.rbuild
trunk/reactos/base/setup/reactos/reactos.rc
trunk/reactos/base/setup/reactos/resource.h
trunk/reactos/base/setup/reactos/rsrc.rc
Modified: trunk/reactos/base/setup/reactos/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/reactos/lang/de…
==============================================================================
--- trunk/reactos/base/setup/reactos/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/setup/reactos/lang/de-DE.rc [iso-8859-1] Sat Jul 5 12:55:38 2008
@@ -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 */
Modified: trunk/reactos/base/setup/reactos/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/reactos/lang/en…
==============================================================================
--- trunk/reactos/base/setup/reactos/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/setup/reactos/lang/en-US.rc [iso-8859-1] Sat Jul 5 12:55:38 2008
@@ -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 */
Modified: trunk/reactos/base/setup/reactos/reactos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/reactos/reactos…
==============================================================================
--- trunk/reactos/base/setup/reactos/reactos.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/reactos/reactos.c [iso-8859-1] Sat Jul 5 12:55:38 2008
@@ -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,24 +21,90 @@
* 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 <windows.h>
-#include <tchar.h>
+#include <commctrl.h>
#include "resource.h"
-/* GLOBALS ******************************************************************/
+/* FUNCTIONS ****************************************************************/
-TCHAR szCaption[256];
-TCHAR szText[256];
+static VOID
+CenterWindow(HWND hWnd)
+{
+ HWND hWndParent;
+ RECT rcParent;
+ RECT rcWindow;
-HINSTANCE hInstance;
+ hWndParent = GetParent(hWnd);
+ if (hWndParent == NULL)
+ hWndParent = GetDesktopWindow();
+ GetWindowRect(hWndParent, &rcParent);
+ GetWindowRect(hWnd, &rcWindow);
-/* FUNCTIONS ****************************************************************/
+ 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,
@@ -46,26 +112,38 @@
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 */
Modified: trunk/reactos/base/setup/reactos/reactos.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/reactos/reactos…
==============================================================================
--- trunk/reactos/base/setup/reactos/reactos.rbuild [iso-8859-1] (original)
+++ trunk/reactos/base/setup/reactos/reactos.rbuild [iso-8859-1] Sat Jul 5 12:55:38 2008
@@ -8,6 +8,7 @@
<library>kernel32</library>
<library>gdi32</library>
<library>user32</library>
+ <library>comctl32</library>
<file>reactos.c</file>
<file>reactos.rc</file>
</module>
Modified: trunk/reactos/base/setup/reactos/reactos.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/reactos/reactos…
==============================================================================
--- trunk/reactos/base/setup/reactos/reactos.rc [iso-8859-1] (original)
+++ trunk/reactos/base/setup/reactos/reactos.rc [iso-8859-1] Sat Jul 5 12:55:38 2008
@@ -14,6 +14,9 @@
/* 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"
Added: trunk/reactos/base/setup/reactos/res/header.bmp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/reactos/res/hea…
==============================================================================
Binary file - no diff available.
Propchange: trunk/reactos/base/setup/reactos/res/header.bmp
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/reactos/base/setup/reactos/res/watermark.bmp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/reactos/res/wat…
==============================================================================
Binary file - no diff available.
Propchange: trunk/reactos/base/setup/reactos/res/watermark.bmp
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: trunk/reactos/base/setup/reactos/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/reactos/resourc…
==============================================================================
--- trunk/reactos/base/setup/reactos/resource.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/reactos/resource.h [iso-8859-1] Sat Jul 5 12:55:38 2008
@@ -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
Modified: trunk/reactos/base/setup/reactos/rsrc.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/reactos/rsrc.rc…
==============================================================================
--- trunk/reactos/base/setup/reactos/rsrc.rc [iso-8859-1] (original)
+++ trunk/reactos/base/setup/reactos/rsrc.rc [iso-8859-1] Sat Jul 5 12:55:38 2008
@@ -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"*/