- 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

svn path=/trunk/; revision=34307
This commit is contained in:
Matthias Kupfer 2008-07-05 17:55:38 +00:00
parent 2012315e5a
commit d61945b6cc
9 changed files with 143 additions and 42 deletions

View file

@ -2,12 +2,16 @@
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
/* String Tables */ IDD_STARTPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
STRINGTABLE DISCARDABLE CAPTION "ReactOS Setup"
FONT 8, "MS Shell Dlg"
BEGIN BEGIN
IDS_CAPTION "ReactOS Setup" LTEXT "Willkommen beim ReactOS Setup Assistenten.", IDC_STARTTITLE, 115, 8, 195, 24
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 "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 END
/* EOF */ /* EOF */

View file

@ -2,11 +2,16 @@
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
/* String Tables */ IDD_STARTPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193
STRINGTABLE DISCARDABLE STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "ReactOS Setup"
FONT 8, "MS Shell Dlg"
BEGIN BEGIN
IDS_CAPTION "ReactOS Setup" LTEXT "Welcome to the ReactOS Setup Wizard.", IDC_STARTTITLE, 115, 8, 195, 24
IDS_TEXT "You cannot install ReactOS directly from this CD!\n\nPlease restart your computer from this CD in order to install ReactOS." 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 END
/* EOF */ /* EOF */

View file

@ -1,6 +1,6 @@
/* /*
* ReactOS applications * 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 * 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 * 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS GUI first stage setup application * PROJECT: ReactOS GUI first stage setup application
* FILE: subsys/system/reactos/reactos.c * FILE: subsys/system/reactos/reactos.c
* PROGRAMMERS: Eric Kohl * PROGRAMMERS: Eric Kohl, Matthias Kupfer
*/ */
#include <windows.h> #include <windows.h>
#include <tchar.h> #include <commctrl.h>
#include "resource.h" #include "resource.h"
/* GLOBALS ******************************************************************/
TCHAR szCaption[256];
TCHAR szText[256];
HINSTANCE hInstance;
/* FUNCTIONS ****************************************************************/ /* 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 int WINAPI
WinMain(HINSTANCE hInst, WinMain(HINSTANCE hInst,
HINSTANCE hPrevInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdLine, LPSTR lpszCmdLine,
int nCmdShow) int nCmdShow)
{ {
hInstance = hInst; PROPSHEETHEADER psh;
HPROPSHEETPAGE ahpsp[1];
PROPSHEETPAGE psp = {0};
UINT nPages = 0;
if (!LoadString(hInstance, /* Create the Start page */
IDS_CAPTION, psp.dwSize = sizeof(PROPSHEETPAGE);
szCaption, psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
(sizeof szCaption / sizeof szCaption[0]))) psp.hInstance = hInst;
return 0; psp.lParam = 0;
psp.pfnDlgProc = StartDlgProc;
psp.pszTemplate = MAKEINTRESOURCE(IDD_STARTPAGE);
ahpsp[nPages++] = CreatePropertySheetPage(&psp);
if (!LoadString(hInstance, // Here we can add the next pages and switch on later
IDS_TEXT,
szText,
(sizeof szText / sizeof szText[0])))
return 0;
MessageBox(NULL, /* Create the property sheet */
szText, psh.dwSize = sizeof(PROPSHEETHEADER);
szCaption, psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
MB_OK | MB_ICONINFORMATION); 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; return 0;
} }
/* EOF */ /* EOF */

View file

@ -8,6 +8,7 @@
<library>kernel32</library> <library>kernel32</library>
<library>gdi32</library> <library>gdi32</library>
<library>user32</library> <library>user32</library>
<library>comctl32</library>
<file>reactos.c</file> <file>reactos.c</file>
<file>reactos.rc</file> <file>reactos.rc</file>
</module> </module>

View file

@ -14,6 +14,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
/* Icons */ /* Icons */
IDI_MAIN ICON "res/reactos.ico" IDI_MAIN ICON "res/reactos.ico"
/* Bitmaps */
IDB_WATERMARK BITMAP "res/watermark.bmp"
IDB_HEADER BITMAP "res/header.bmp"
/* Language-specific resources */ /* Language-specific resources */
#include "rsrc.rc" #include "rsrc.rc"

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

@ -1,5 +1,15 @@
#define IDS_CAPTION 1000 #ifndef RESOURCE_H
#define IDS_TEXT 1001 #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 #define IDI_MAIN 3000
#endif

View file

@ -2,12 +2,12 @@
#include "resource.h" #include "resource.h"
/* Language-specific resources */ /* Language-specific resources */
#include "lang/bg-BG.rc" /*#include "lang/bg-BG.rc"
#include "lang/cs-CZ.rc" #include "lang/cs-CZ.rc"*/
#include "lang/de-DE.rc" #include "lang/de-DE.rc"
#include "lang/el-GR.rc" //#include "lang/el-GR.rc"
#include "lang/en-US.rc" #include "lang/en-US.rc"
#include "lang/es-ES.rc" /*#include "lang/es-ES.rc"
#include "lang/fi-FI.rc" #include "lang/fi-FI.rc"
#include "lang/fr-FR.rc" #include "lang/fr-FR.rc"
#include "lang/hu-HU.rc" #include "lang/hu-HU.rc"
@ -24,4 +24,4 @@
#include "lang/sv-SE.rc" #include "lang/sv-SE.rc"
#include "lang/th-TH.rc" #include "lang/th-TH.rc"
#include "lang/uk-UA.rc" #include "lang/uk-UA.rc"
#include "lang/zh-CN.rc" #include "lang/zh-CN.rc"*/