Author: hpoussin
Date: Sun May 11 16:32:00 2008
New Revision: 33451
URL:
http://svn.reactos.org/svn/reactos?rev=33451&view=rev
Log:
Add generic list scrolling
See issue #3234 for more details.
Modified:
trunk/reactos/base/setup/usetup/genlist.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] Sun May 11 16:32:00 2008
@@ -46,6 +46,8 @@
{
LIST_ENTRY ListHead;
+ PLIST_ENTRY FirstShown;
+ PLIST_ENTRY LastShown;
SHORT Left;
SHORT Top;
SHORT Right;
@@ -230,13 +232,14 @@
coPos.Y = GenericList->Top + 1;
Width = GenericList->Right - GenericList->Left - 1;
- Entry = GenericList->ListHead.Flink;
+ Entry = GenericList->FirstShown;
while (Entry != &GenericList->ListHead)
{
ListEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
if (coPos.Y == GenericList->Bottom)
break;
+ GenericList->LastShown = Entry;
FillConsoleOutputAttribute (StdOutput,
(GenericList->CurrentEntry == ListEntry) ?
@@ -289,6 +292,7 @@
SHORT Right,
SHORT Bottom)
{
+ List->FirstShown = List->ListHead.Flink;
List->Left = Left;
List->Top = Top;
List->Right = Right;
@@ -314,6 +318,11 @@
if (List->CurrentEntry->Entry.Flink != &List->ListHead)
{
Entry = List->CurrentEntry->Entry.Flink;
+ if (List->LastShown == &List->CurrentEntry->Entry)
+ {
+ List->FirstShown = List->FirstShown->Flink;
+ List->LastShown = List->LastShown->Flink;
+ }
List->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
DrawListEntries(List);
}
@@ -331,6 +340,11 @@
if (List->CurrentEntry->Entry.Blink != &List->ListHead)
{
Entry = List->CurrentEntry->Entry.Blink;
+ if (List->FirstShown == &List->CurrentEntry->Entry)
+ {
+ List->FirstShown = List->FirstShown->Blink;
+ List->LastShown = List->LastShown->Blink;
+ }
List->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
DrawListEntries(List);
}