mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:02:56 +00:00
Add generic list scrolling
See issue #3234 for more details. svn path=/trunk/; revision=33451
This commit is contained in:
parent
2199183bbe
commit
906bec0223
1 changed files with 15 additions and 1 deletions
|
@ -46,6 +46,8 @@ typedef struct _GENERIC_LIST
|
||||||
{
|
{
|
||||||
LIST_ENTRY ListHead;
|
LIST_ENTRY ListHead;
|
||||||
|
|
||||||
|
PLIST_ENTRY FirstShown;
|
||||||
|
PLIST_ENTRY LastShown;
|
||||||
SHORT Left;
|
SHORT Left;
|
||||||
SHORT Top;
|
SHORT Top;
|
||||||
SHORT Right;
|
SHORT Right;
|
||||||
|
@ -230,13 +232,14 @@ DrawListEntries(PGENERIC_LIST GenericList)
|
||||||
coPos.Y = GenericList->Top + 1;
|
coPos.Y = GenericList->Top + 1;
|
||||||
Width = GenericList->Right - GenericList->Left - 1;
|
Width = GenericList->Right - GenericList->Left - 1;
|
||||||
|
|
||||||
Entry = GenericList->ListHead.Flink;
|
Entry = GenericList->FirstShown;
|
||||||
while (Entry != &GenericList->ListHead)
|
while (Entry != &GenericList->ListHead)
|
||||||
{
|
{
|
||||||
ListEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
|
ListEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
|
||||||
|
|
||||||
if (coPos.Y == GenericList->Bottom)
|
if (coPos.Y == GenericList->Bottom)
|
||||||
break;
|
break;
|
||||||
|
GenericList->LastShown = Entry;
|
||||||
|
|
||||||
FillConsoleOutputAttribute (StdOutput,
|
FillConsoleOutputAttribute (StdOutput,
|
||||||
(GenericList->CurrentEntry == ListEntry) ?
|
(GenericList->CurrentEntry == ListEntry) ?
|
||||||
|
@ -289,6 +292,7 @@ DrawGenericList(PGENERIC_LIST List,
|
||||||
SHORT Right,
|
SHORT Right,
|
||||||
SHORT Bottom)
|
SHORT Bottom)
|
||||||
{
|
{
|
||||||
|
List->FirstShown = List->ListHead.Flink;
|
||||||
List->Left = Left;
|
List->Left = Left;
|
||||||
List->Top = Top;
|
List->Top = Top;
|
||||||
List->Right = Right;
|
List->Right = Right;
|
||||||
|
@ -314,6 +318,11 @@ ScrollDownGenericList (PGENERIC_LIST List)
|
||||||
if (List->CurrentEntry->Entry.Flink != &List->ListHead)
|
if (List->CurrentEntry->Entry.Flink != &List->ListHead)
|
||||||
{
|
{
|
||||||
Entry = List->CurrentEntry->Entry.Flink;
|
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);
|
List->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
|
||||||
DrawListEntries(List);
|
DrawListEntries(List);
|
||||||
}
|
}
|
||||||
|
@ -331,6 +340,11 @@ ScrollUpGenericList (PGENERIC_LIST List)
|
||||||
if (List->CurrentEntry->Entry.Blink != &List->ListHead)
|
if (List->CurrentEntry->Entry.Blink != &List->ListHead)
|
||||||
{
|
{
|
||||||
Entry = List->CurrentEntry->Entry.Blink;
|
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);
|
List->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
|
||||||
DrawListEntries(List);
|
DrawListEntries(List);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue