Author: cwittich
Date: Wed Jan 23 19:14:50 2008
New Revision: 31960
URL:
http://svn.reactos.org/svn/reactos?rev=31960&view=rev
Log:
improve the generic list by allowing faster navigation with chars [a-z]
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 (original)
+++ trunk/reactos/base/setup/usetup/genlist.c Wed Jan 23 19:14:50 2008
@@ -312,6 +312,29 @@
}
}
+VOID
+GenericListKeyPress (PGENERIC_LIST GenericList, CHAR AsciChar)
+{
+ PGENERIC_LIST_ENTRY ListEntry;
+ PLIST_ENTRY Entry;
+
+ Entry = GenericList->ListHead.Flink;
+ while (Entry != &GenericList->ListHead)
+ {
+ ListEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
+ if (strlen(ListEntry->Text) > 0)
+ {
+ if (tolower(ListEntry->Text[0]) == AsciChar)
+ {
+ GenericList->CurrentEntry = CONTAINING_RECORD (Entry,
GENERIC_LIST_ENTRY, Entry);
+ break;
+ }
+ }
+ Entry = Entry->Flink;
+ }
+ if (Entry)
+ DrawListEntries(GenericList);
+}
PGENERIC_LIST_ENTRY
GetGenericListEntry(PGENERIC_LIST 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 (original)
+++ trunk/reactos/base/setup/usetup/genlist.h Wed Jan 23 19:14:50 2008
@@ -85,6 +85,9 @@
VOID
RestoreGenericListState(PGENERIC_LIST List);
+VOID
+GenericListKeyPress (PGENERIC_LIST List, CHAR AsciChar);
+
#endif /* __GENLIST_H__ */
/* EOF */
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 (original)
+++ trunk/reactos/base/setup/usetup/interface/usetup.c Wed Jan 23 19:14:50 2008
@@ -659,6 +659,11 @@
return INTRO_PAGE;
}
+ else if ((Ir->Event.KeyEvent.uChar.AsciiChar > 0x60) &&
(Ir->Event.KeyEvent.uChar.AsciiChar < 0x7b))
+ {
+ /* a-z */
+ GenericListKeyPress (LanguageList, Ir->Event.KeyEvent.uChar.AsciiChar);
+ }
}
return INTRO_PAGE;