Author: mpiulachs
Date: Wed May 14 09:01:06 2008
New Revision: 33512
URL:
http://svn.reactos.org/svn/reactos?rev=33512&view=rev
Log:
- Implement generic list PageUp/PageDown
Modified:
trunk/reactos/base/setup/usetup/genlist.c
trunk/reactos/base/setup/usetup/genlist.h
trunk/reactos/base/setup/usetup/interface/usetup.c
Modified: trunk/reactos/base/setup/usetup/genlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/genlist.…
==============================================================================
--- trunk/reactos/base/setup/usetup/genlist.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/genlist.c [iso-8859-1] Wed May 14 09:01:06 2008
@@ -52,6 +52,7 @@
SHORT Top;
SHORT Right;
SHORT Bottom;
+ BOOL Redraw;
PGENERIC_LIST_ENTRY CurrentEntry;
PGENERIC_LIST_ENTRY BackupEntry;
@@ -74,6 +75,7 @@
List->Top = 0;
List->Right = 0;
List->Bottom = 0;
+ List->Redraw = TRUE;
List->CurrentEntry = NULL;
@@ -351,6 +353,47 @@
DrawScrollBarGenericList(List);
}
+VOID
+ScrollPageDownGenericList (PGENERIC_LIST List)
+{
+ SHORT i;
+
+ /* Suspend auto-redraw */
+ List->Redraw = FALSE;
+
+ for (i = List->Top + 1; i < List->Bottom - 1; i++)
+ {
+ ScrollDownGenericList (List);
+ }
+
+ /* Update user interface */
+ DrawListEntries(List);
+ DrawScrollBarGenericList(List);
+
+ /* Re enable auto-redraw */
+ List->Redraw = TRUE;
+}
+
+VOID
+ScrollPageUpGenericList (PGENERIC_LIST List)
+{
+ SHORT i;
+
+ /* Suspend auto-redraw */
+ List->Redraw = FALSE;
+
+ for (i = List->Bottom - 1; i > List->Top + 1; i--)
+ {
+ ScrollUpGenericList (List);
+ }
+
+ /* Update user interface */
+ DrawListEntries(List);
+ DrawScrollBarGenericList(List);
+
+ /* Re enable auto-redraw */
+ List->Redraw = TRUE;
+}
VOID
ScrollDownGenericList (PGENERIC_LIST List)
@@ -370,8 +413,11 @@
}
List->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
- DrawListEntries(List);
- DrawScrollBarGenericList(List);
+ if (List->Redraw)
+ {
+ DrawListEntries(List);
+ DrawScrollBarGenericList(List);
+ }
}
}
@@ -394,8 +440,11 @@
}
List->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
- DrawListEntries(List);
- DrawScrollBarGenericList(List);
+ if (List->Redraw)
+ {
+ DrawListEntries(List);
+ DrawScrollBarGenericList(List);
+ }
}
}
Modified: trunk/reactos/base/setup/usetup/genlist.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/genlist.…
==============================================================================
--- trunk/reactos/base/setup/usetup/genlist.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/genlist.h [iso-8859-1] Wed May 14 09:01:06 2008
@@ -62,6 +62,12 @@
ScrollUpGenericList(PGENERIC_LIST List);
VOID
+ScrollPageDownGenericList(PGENERIC_LIST List);
+
+VOID
+ScrollPageUpGenericList(PGENERIC_LIST List);
+
+VOID
SetCurrentListEntry(PGENERIC_LIST List, PGENERIC_LIST_ENTRY Entry);
PGENERIC_LIST_ENTRY
Modified: trunk/reactos/base/setup/usetup/interface/usetup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
==============================================================================
--- trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] Wed May 14 09:01:06
2008
@@ -621,20 +621,36 @@
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */
{
-#if 0 //Dynamically update user interface
- SelectedLanguageId = (PWCHAR)LanguageList->CurrentEntry->UserData;
+#if 0
+ SelectedLanguageId =
(PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
+
+ /* Redraw language selection page in native language */
MUIDisplayPage(LANGUAGE_PAGE);
#endif
+
ScrollDownGenericList (LanguageList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */
{
#if 0
- SelectedLanguageId = (PWCHAR)LanguageList->CurrentEntry->UserData;
+ SelectedLanguageId =
(PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
+
+ /* Redraw language selection page in native language */
MUIDisplayPage(LANGUAGE_PAGE);
#endif
+
ScrollUpGenericList (LanguageList);
+ }
+ if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
+ (Ir->Event.KeyEvent.wVirtualKeyCode == VK_NEXT)) /* PAGE DOWN */
+ {
+ ScrollPageDownGenericList (LanguageList);
+ }
+ else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
+ (Ir->Event.KeyEvent.wVirtualKeyCode == VK_PRIOR)) /* PAGE UP */
+ {
+ ScrollPageUpGenericList (LanguageList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
@@ -1269,6 +1285,16 @@
{
ScrollUpGenericList (LayoutList);
}
+ if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
+ (Ir->Event.KeyEvent.wVirtualKeyCode == VK_NEXT)) /* PAGE DOWN */
+ {
+ ScrollPageDownGenericList (LayoutList);
+ }
+ else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
+ (Ir->Event.KeyEvent.wVirtualKeyCode == VK_PRIOR)) /* PAGE UP */
+ {
+ ScrollPageUpGenericList (LayoutList);
+ }
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
{
@@ -1286,6 +1312,11 @@
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return DEVICE_SETTINGS_PAGE;
+ }
+ else if ((Ir->Event.KeyEvent.uChar.AsciiChar > 0x60) &&
(Ir->Event.KeyEvent.uChar.AsciiChar < 0x7b))
+ {
+ /* a-z */
+ GenericListKeyPress (LayoutList , Ir->Event.KeyEvent.uChar.AsciiChar);
}
}