- Implement a generic selection list.

- Use selection list in device settings pages.

svn path=/trunk/; revision=9512
This commit is contained in:
Eric Kohl 2004-05-28 12:14:00 +00:00
parent 69a06d8f31
commit 938ede25cd
4 changed files with 692 additions and 50 deletions

View file

@ -0,0 +1,303 @@
/* genlist.c */
#include <ddk/ntddk.h>
#include <ntdll/rtl.h>
#include <ntos/minmax.h>
#include "usetup.h"
#include "console.h"
#include "genlist.h"
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ****************************************************************/
PGENERIC_LIST
CreateGenericList(VOID)
{
PGENERIC_LIST List;
List = (PGENERIC_LIST)RtlAllocateHeap(ProcessHeap,
0,
sizeof(GENERIC_LIST));
if (List == NULL)
return NULL;
InitializeListHead(&List->ListHead);
List->Left = 0;
List->Top = 0;
List->Right = 0;
List->Bottom = 0;
List->CurrentEntry = NULL;
return List;
}
VOID
DestroyGenericList(PGENERIC_LIST List,
BOOLEAN FreeUserData)
{
PGENERIC_LIST_ENTRY ListEntry;
PLIST_ENTRY Entry;
/* Release list entries */
while (!IsListEmpty (&List->ListHead))
{
Entry = RemoveHeadList (&List->ListHead);
ListEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
/* Release user data */
if (FreeUserData && ListEntry->UserData != NULL)
RtlFreeHeap (ProcessHeap, 0, &ListEntry->UserData);
/* Release list entry */
RtlFreeHeap (ProcessHeap, 0, ListEntry);
}
/* Release list head */
RtlFreeHeap (ProcessHeap, 0, List);
}
BOOLEAN
AppendGenericListEntry(PGENERIC_LIST List,
PCHAR Text,
PVOID UserData,
BOOLEAN Current)
{
PGENERIC_LIST_ENTRY Entry;
Entry = (PGENERIC_LIST_ENTRY)RtlAllocateHeap(ProcessHeap,
0,
sizeof(GENERIC_LIST_ENTRY) + strlen(Text));
if (Entry == NULL)
return FALSE;
strcpy (Entry->Text, Text);
Entry->UserData = UserData;
InsertTailList(&List->ListHead,
&Entry->Entry);
if (Current || List->CurrentEntry == NULL)
{
List->CurrentEntry = Entry;
}
return TRUE;
}
static VOID
DrawListFrame(PGENERIC_LIST GenericList)
{
COORD coPos;
ULONG Written;
SHORT i;
/* Draw upper left corner */
coPos.X = GenericList->Left;
coPos.Y = GenericList->Top;
FillConsoleOutputCharacter (0xDA, // '+',
1,
coPos,
&Written);
/* Draw upper edge */
coPos.X = GenericList->Left + 1;
coPos.Y = GenericList->Top;
FillConsoleOutputCharacter (0xC4, // '-',
GenericList->Right - GenericList->Left - 1,
coPos,
&Written);
/* Draw upper right corner */
coPos.X = GenericList->Right;
coPos.Y = GenericList->Top;
FillConsoleOutputCharacter (0xBF, // '+',
1,
coPos,
&Written);
/* Draw left and right edge */
for (i = GenericList->Top + 1; i < GenericList->Bottom; i++)
{
coPos.X = GenericList->Left;
coPos.Y = i;
FillConsoleOutputCharacter (0xB3, // '|',
1,
coPos,
&Written);
coPos.X = GenericList->Right;
FillConsoleOutputCharacter (0xB3, //'|',
1,
coPos,
&Written);
}
/* Draw lower left corner */
coPos.X = GenericList->Left;
coPos.Y = GenericList->Bottom;
FillConsoleOutputCharacter (0xC0, // '+',
1,
coPos,
&Written);
/* Draw lower edge */
coPos.X = GenericList->Left + 1;
coPos.Y = GenericList->Bottom;
FillConsoleOutputCharacter (0xC4, // '-',
GenericList->Right - GenericList->Left - 1,
coPos,
&Written);
/* Draw lower right corner */
coPos.X = GenericList->Right;
coPos.Y = GenericList->Bottom;
FillConsoleOutputCharacter (0xD9, // '+',
1,
coPos,
&Written);
}
static VOID
DrawListEntries(PGENERIC_LIST GenericList)
{
PGENERIC_LIST_ENTRY ListEntry;
PLIST_ENTRY Entry;
COORD coPos;
ULONG Written;
USHORT Width;
coPos.X = GenericList->Left + 1;
coPos.Y = GenericList->Top + 1;
Width = GenericList->Right - GenericList->Left - 1;
Entry = GenericList->ListHead.Flink;
while (Entry != &GenericList->ListHead)
{
ListEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
if (coPos.Y == GenericList->Bottom)
break;
FillConsoleOutputAttribute ((GenericList->CurrentEntry == ListEntry) ? 0x71 : 0x17,
Width,
coPos,
&Written);
FillConsoleOutputCharacter (' ',
Width,
coPos,
&Written);
coPos.X++;
WriteConsoleOutputCharacters (ListEntry->Text,
min (strlen(ListEntry->Text), Width - 2),
coPos);
coPos.X--;
coPos.Y++;
Entry = Entry->Flink;
}
while (coPos.Y < GenericList->Bottom)
{
FillConsoleOutputAttribute (0x17,
Width,
coPos,
&Written);
FillConsoleOutputCharacter (' ',
Width,
coPos,
&Written);
coPos.Y++;
}
}
VOID
DrawGenericList(PGENERIC_LIST List,
SHORT Left,
SHORT Top,
SHORT Right,
SHORT Bottom)
{
List->Left = Left;
List->Top = Top;
List->Right = Right;
List->Bottom = Bottom;
DrawListFrame(List);
if (IsListEmpty(&List->ListHead))
return;
DrawListEntries(List);
}
VOID
ScrollDownGenericList (PGENERIC_LIST List)
{
PLIST_ENTRY Entry;
if (List->CurrentEntry == NULL)
return;
if (List->CurrentEntry->Entry.Flink != &List->ListHead)
{
Entry = List->CurrentEntry->Entry.Flink;
List->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
DrawListEntries(List);
}
}
VOID
ScrollUpGenericList (PGENERIC_LIST List)
{
PLIST_ENTRY Entry;
if (List->CurrentEntry == NULL)
return;
if (List->CurrentEntry->Entry.Blink != &List->ListHead)
{
Entry = List->CurrentEntry->Entry.Blink;
List->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
DrawListEntries(List);
}
}
PGENERIC_LIST_ENTRY
GetGenericListEntry(PGENERIC_LIST List)
{
return List->CurrentEntry;
}
VOID
SaveGenericListState(PGENERIC_LIST List)
{
List->BackupEntry = List->CurrentEntry;
}
VOID
RestoreGenericListState(PGENERIC_LIST List)
{
List->CurrentEntry = List->BackupEntry;
}
/* EOF */

View file

@ -0,0 +1,86 @@
/*
* ReactOS kernel
* Copyright (C) 2004 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: genlist.h,v 1.1 2004/05/28 12:14:00 ekohl Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/genlist.h
* PURPOSE: Generic list functions
* PROGRAMMER: Eric Kohl
*/
typedef struct _GENERIC_LIST_ENTRY
{
LIST_ENTRY Entry;
PVOID UserData;
CHAR Text[1];
} GENERIC_LIST_ENTRY, *PGENERIC_LIST_ENTRY;
typedef struct _GENERIC_LIST
{
LIST_ENTRY ListHead;
SHORT Left;
SHORT Top;
SHORT Right;
SHORT Bottom;
PGENERIC_LIST_ENTRY CurrentEntry;
PGENERIC_LIST_ENTRY BackupEntry;
} GENERIC_LIST, *PGENERIC_LIST;
PGENERIC_LIST
CreateGenericList(VOID);
VOID
DestroyGenericList(PGENERIC_LIST List,
BOOLEAN FreeUserData);
BOOLEAN
AppendGenericListEntry(PGENERIC_LIST List,
PCHAR Text,
PVOID UserData,
BOOLEAN Current);
VOID
DrawGenericList(PGENERIC_LIST List,
SHORT Left,
SHORT Top,
SHORT Right,
SHORT Bottom);
VOID
ScrollDownGenericList(PGENERIC_LIST List);
VOID
ScrollUpGenericList(PGENERIC_LIST List);
PGENERIC_LIST_ENTRY
GetGenericListEntry(PGENERIC_LIST List);
VOID
SaveGenericListState(PGENERIC_LIST List);
VOID
RestoreGenericListState(PGENERIC_LIST List);
/* EOF */

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.15 2004/02/23 11:58:27 ekohl Exp $
# $Id: makefile,v 1.16 2004/05/28 12:14:00 ekohl Exp $
PATH_TO_TOP = ../../..
@ -18,8 +18,8 @@ TARGET_INSTALLDIR = system32
TARGET_CFLAGS = -D__NTAPP__ -I$(PATH_TO_TOP)/lib/zlib -Wall -Werror -Wno-format
TARGET_OBJECTS = bootsup.o cabinet.o console.o drivesup.o \
filequeue.o filesup.o format.o fslist.o infcache.o \
TARGET_OBJECTS = bootsup.o cabinet.o console.o drivesup.o filequeue.o \
filesup.o format.o fslist.o genlist.o infcache.o \
inicache.o partlist.o progress.o registry.o usetup.o
include $(PATH_TO_TOP)/rules.mak

View file

@ -45,6 +45,7 @@
#include "cabinet.h"
#include "filesup.h"
#include "drivesup.h"
#include "genlist.h"
#define NDEBUG
#include <debug.h>
@ -129,6 +130,12 @@ static HSPFILEQ SetupFileQueue = NULL;
static BOOLEAN WarnLinuxPartitions = TRUE;
static PGENERIC_LIST ComputerList = NULL;
static PGENERIC_LIST DisplayList = NULL;
static PGENERIC_LIST KeyboardList = NULL;
static PGENERIC_LIST LayoutList = NULL;
static PGENERIC_LIST PointerList = NULL;
/* FUNCTIONS ****************************************************************/
@ -553,7 +560,7 @@ StartPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
return QUIT_PAGE;
}
}
}
@ -568,7 +575,7 @@ StartPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
return QUIT_PAGE;
}
}
}
@ -587,7 +594,7 @@ StartPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
return QUIT_PAGE;
}
}
}
@ -619,7 +626,7 @@ StartPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
return QUIT_PAGE;
}
}
}
@ -636,7 +643,7 @@ StartPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
return QUIT_PAGE;
}
}
}
@ -654,7 +661,7 @@ StartPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
return QUIT_PAGE;
}
}
}
@ -671,14 +678,14 @@ StartPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
return QUIT_PAGE;
}
}
}
CheckUnattendedSetup();
return(INTRO_PAGE);
return INTRO_PAGE;
}
@ -756,16 +763,16 @@ EmergencyIntroPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(REBOOT_PAGE);
return REBOOT_PAGE;
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
{
return(INTRO_PAGE);
return INTRO_PAGE;
}
}
return(REPAIR_INTRO_PAGE);
return REPAIR_INTRO_PAGE;
}
@ -789,16 +796,16 @@ RepairIntroPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(REBOOT_PAGE);
return REBOOT_PAGE;
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
{
return(INTRO_PAGE);
return INTRO_PAGE;
}
}
return(REPAIR_INTRO_PAGE);
return REPAIR_INTRO_PAGE;
}
@ -856,6 +863,46 @@ DeviceSettingsPage(PINPUT_RECORD Ir)
{
static ULONG Line = 17;
/* Initialize the computer settings list */
if (ComputerList == NULL)
{
ComputerList = CreateGenericList();
AppendGenericListEntry(ComputerList, "Standard-PC", NULL, TRUE);
}
/* Initialize the display settings list */
if (DisplayList == NULL)
{
DisplayList = CreateGenericList();
AppendGenericListEntry(DisplayList, "VGA display", NULL, FALSE);
AppendGenericListEntry(DisplayList, "VESA display", NULL, FALSE);
AppendGenericListEntry(DisplayList, "Automatic detection", NULL, TRUE);
}
/* Initialize the keyboard settings list */
if (KeyboardList == NULL)
{
KeyboardList = CreateGenericList();
AppendGenericListEntry(KeyboardList, "XT-, AT- or extended keyboard (83-105 keys)", NULL, TRUE);
}
/* Initialize the keyboard settings list */
if (LayoutList == NULL)
{
LayoutList = CreateGenericList();
AppendGenericListEntry(LayoutList, "English (USA)", NULL, TRUE);
AppendGenericListEntry(LayoutList, "French (France)", NULL, FALSE);
AppendGenericListEntry(LayoutList, "German (Germany)", NULL, FALSE);
}
/* Initialize the keyboard settings list */
if (PointerList == NULL)
{
PointerList = CreateGenericList();
AppendGenericListEntry(PointerList, "PS/2 (Mouse port) mouse", NULL, TRUE);
AppendGenericListEntry(PointerList, "Serial mouse", NULL, FALSE);
}
SetTextXY(6, 8, "The list below shows the current device settings.");
SetTextXY(8, 11, " Computer:");
@ -866,12 +913,11 @@ DeviceSettingsPage(PINPUT_RECORD Ir)
SetTextXY(8, 17, " Accept:");
SetTextXY(25, 11, "Standard-PC");
SetTextXY(25, 12, "Automatic detection");
SetTextXY(25, 13, "XT-, AT- or extended keyboard (83-105 keys)");
SetTextXY(25, 14, "English (USA)");
SetTextXY(25, 15, "PS/2 (Mouse port) mouse");
SetTextXY(25, 11, GetGenericListEntry(ComputerList)->Text);
SetTextXY(25, 12, GetGenericListEntry(DisplayList)->Text);
SetTextXY(25, 13, GetGenericListEntry(KeyboardList)->Text);
SetTextXY(25, 14, GetGenericListEntry(LayoutList)->Text);
SetTextXY(25, 15, GetGenericListEntry(PointerList)->Text);
SetTextXY(25, 17, "Accept these device setings");
InvertTextXY (24, Line, 48, 1);
@ -902,8 +948,8 @@ DeviceSettingsPage(PINPUT_RECORD Ir)
Line++;
InvertTextXY (24, Line, 48, 1);
}
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */
{
NormalTextXY (24, Line, 48, 1);
if (Line == 11)
@ -945,22 +991,56 @@ DeviceSettingsPage(PINPUT_RECORD Ir)
static PAGE_NUMBER
ComputerSettingsPage(PINPUT_RECORD Ir)
{
SetTextXY(6, 8, "Computer settings are not implemented yet.");
SHORT xScreen;
SHORT yScreen;
SetTextXY(6, 8, "You want to change the type of computer to be installed.");
SetStatusText(" ENTER = Continue F3 = Quit");
SetTextXY(8, 10, "\x07 Press the UP or DOWN key to select the desired computer type.");
SetTextXY(8, 11, " Then press ENTER.");
SetTextXY(8, 13, "\x07 Press the ESC key to return to the previous page without changing");
SetTextXY(8, 14, " the computer type.");
GetScreenSize(&xScreen, &yScreen);
DrawGenericList(ComputerList,
2,
18,
xScreen - 3,
yScreen - 3);
SetStatusText(" ENTER = Continue ESC = Cancel F3 = Quit");
SaveGenericListState(ComputerList);
while(TRUE)
{
ConInKey(Ir);
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */
{
ScrollDownGenericList (ComputerList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */
{
ScrollUpGenericList (ComputerList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
{
if (ConfirmQuit(Ir) == TRUE)
return QUIT_PAGE;
break;
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
{
RestoreGenericListState(ComputerList);
return DEVICE_SETTINGS_PAGE;
}
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return DEVICE_SETTINGS_PAGE;
@ -974,22 +1054,58 @@ ComputerSettingsPage(PINPUT_RECORD Ir)
static PAGE_NUMBER
DisplaySettingsPage(PINPUT_RECORD Ir)
{
SetTextXY(6, 8, "Display settings are not implemented yet.");
SHORT xScreen;
SHORT yScreen;
SetTextXY(6, 8, "You want to change the type of display to be installed.");
SetStatusText(" ENTER = Continue F3 = Quit");
SetTextXY(8, 10, "\x07 Press the UP or DOWN key to select the desired display type.");
SetTextXY(8, 11, " Then press ENTER.");
SetTextXY(8, 13, "\x07 Press the ESC key to return to the previous page without changing");
SetTextXY(8, 14, " the display type.");
GetScreenSize(&xScreen, &yScreen);
DrawGenericList(DisplayList,
2,
18,
xScreen - 3,
yScreen - 3);
SetStatusText(" ENTER = Continue ESC = Cancel F3 = Quit");
SaveGenericListState(DisplayList);
while(TRUE)
{
ConInKey(Ir);
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */
{
ScrollDownGenericList (DisplayList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */
{
ScrollUpGenericList (DisplayList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
{
if (ConfirmQuit(Ir) == TRUE)
return QUIT_PAGE;
{
return QUIT_PAGE;
}
break;
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
{
RestoreGenericListState(DisplayList);
return DEVICE_SETTINGS_PAGE;
}
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return DEVICE_SETTINGS_PAGE;
@ -1003,22 +1119,56 @@ DisplaySettingsPage(PINPUT_RECORD Ir)
static PAGE_NUMBER
KeyboardSettingsPage(PINPUT_RECORD Ir)
{
SetTextXY(6, 8, "Keyboard settings are not implemented yet.");
SHORT xScreen;
SHORT yScreen;
SetTextXY(6, 8, "You want to change the type of keyboard to be installed.");
SetStatusText(" ENTER = Continue F3 = Quit");
SetTextXY(8, 10, "\x07 Press the UP or DOWN key to select the desired keyboard type.");
SetTextXY(8, 11, " Then press ENTER.");
SetTextXY(8, 13, "\x07 Press the ESC key to return to the previous page without changing");
SetTextXY(8, 14, " the keyboard type.");
GetScreenSize(&xScreen, &yScreen);
DrawGenericList(KeyboardList,
2,
18,
xScreen - 3,
yScreen - 3);
SetStatusText(" ENTER = Continue ESC = Cancel F3 = Quit");
SaveGenericListState(KeyboardList);
while(TRUE)
{
ConInKey(Ir);
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */
{
ScrollDownGenericList (KeyboardList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */
{
ScrollUpGenericList (KeyboardList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
{
if (ConfirmQuit(Ir) == TRUE)
return QUIT_PAGE;
break;
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
{
RestoreGenericListState(KeyboardList);
return DEVICE_SETTINGS_PAGE;
}
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return DEVICE_SETTINGS_PAGE;
@ -1032,22 +1182,56 @@ KeyboardSettingsPage(PINPUT_RECORD Ir)
static PAGE_NUMBER
LayoutSettingsPage(PINPUT_RECORD Ir)
{
SetTextXY(6, 8, "Keyboard layout settings are not implemented yet.");
SHORT xScreen;
SHORT yScreen;
SetTextXY(6, 8, "You want to change the keyboard layout to be installed.");
SetStatusText(" ENTER = Continue F3 = Quit");
SetTextXY(8, 10, "\x07 Press the UP or DOWN key to select the desired keyboard");
SetTextXY(8, 11, " layout. Then press ENTER.");
SetTextXY(8, 13, "\x07 Press the ESC key to return to the previous page without changing");
SetTextXY(8, 14, " the keyboard layout.");
GetScreenSize(&xScreen, &yScreen);
DrawGenericList(LayoutList,
2,
18,
xScreen - 3,
yScreen - 3);
SetStatusText(" ENTER = Continue ESC = Cancel F3 = Quit");
SaveGenericListState(LayoutList);
while(TRUE)
{
ConInKey(Ir);
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */
{
ScrollDownGenericList (LayoutList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */
{
ScrollUpGenericList (LayoutList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
{
if (ConfirmQuit(Ir) == TRUE)
return QUIT_PAGE;
break;
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
{
RestoreGenericListState(LayoutList);
return DEVICE_SETTINGS_PAGE;
}
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return DEVICE_SETTINGS_PAGE;
@ -1061,22 +1245,56 @@ LayoutSettingsPage(PINPUT_RECORD Ir)
static PAGE_NUMBER
PointerSettingsPage(PINPUT_RECORD Ir)
{
SetTextXY(6, 8, "Pointer settings are not implemented yet.");
SHORT xScreen;
SHORT yScreen;
SetTextXY(6, 8, "You want to change the pointing device to be installed.");
SetStatusText(" ENTER = Continue F3 = Quit");
SetTextXY(8, 10, "\x07 Press the UP or DOWN key to select the desired pointing");
SetTextXY(8, 11, " device. Then press ENTER.");
SetTextXY(8, 13, "\x07 Press the ESC key to return to the previous page without changing");
SetTextXY(8, 14, " the pointing device.");
GetScreenSize(&xScreen, &yScreen);
DrawGenericList(PointerList,
2,
18,
xScreen - 3,
yScreen - 3);
SetStatusText(" ENTER = Continue ESC = Cancel F3 = Quit");
SaveGenericListState(PointerList);
while(TRUE)
{
ConInKey(Ir);
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */
{
ScrollDownGenericList(PointerList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */
{
ScrollUpGenericList(PointerList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
{
if (ConfirmQuit(Ir) == TRUE)
return QUIT_PAGE;
break;
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
{
RestoreGenericListState(PointerList);
return DEVICE_SETTINGS_PAGE;
}
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return DEVICE_SETTINGS_PAGE;
@ -3493,7 +3711,7 @@ BootLoaderPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
return QUIT_PAGE;
}
}
}
@ -3518,7 +3736,7 @@ BootLoaderPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
return QUIT_PAGE;
}
}
}
@ -3544,7 +3762,7 @@ BootLoaderPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
return QUIT_PAGE;
}
}
}
@ -3565,12 +3783,12 @@ BootLoaderPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(QUIT_PAGE);
return QUIT_PAGE;
}
}
}
return(SUCCESS_PAGE);
return SUCCESS_PAGE;
}
@ -3600,6 +3818,41 @@ QuitPage(PINPUT_RECORD Ir)
FileSystemList = NULL;
}
/* Destroy computer settings list */
if (ComputerList != NULL)
{
DestroyGenericList(ComputerList, TRUE);
ComputerList = NULL;
}
/* Destroy display settings list */
if (DisplayList != NULL)
{
DestroyGenericList(DisplayList, TRUE);
DisplayList = NULL;
}
/* Destroy keyboard settings list */
if (KeyboardList != NULL)
{
DestroyGenericList(KeyboardList, TRUE);
KeyboardList = NULL;
}
/* Destroy keyboard layout list */
if (LayoutList != NULL)
{
DestroyGenericList(LayoutList, TRUE);
LayoutList = NULL;
}
/* Destroy pointer device list */
if (PointerList != NULL)
{
DestroyGenericList(PointerList, TRUE);
PointerList = NULL;
}
SetStatusText(" ENTER = Reboot computer");
while(TRUE)
@ -3608,7 +3861,7 @@ QuitPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(FLUSH_PAGE);
return FLUSH_PAGE;
}
}
}
@ -3628,7 +3881,7 @@ SuccessPage(PINPUT_RECORD Ir)
if (IsUnattendedSetup)
{
return(FLUSH_PAGE);
return FLUSH_PAGE;
}
while(TRUE)
@ -3637,7 +3890,7 @@ SuccessPage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return(FLUSH_PAGE);
return FLUSH_PAGE;
}
}
}
@ -3653,7 +3906,7 @@ FlushPage(PINPUT_RECORD Ir)
SetStatusText(" Flushing cache");
return(REBOOT_PAGE);
return REBOOT_PAGE;
}