Author: mpiulachs
Date: Tue May 13 06:29:56 2008
New Revision: 33493
URL:
http://svn.reactos.org/svn/reactos?rev=33493&view=rev
Log:
- fixed and simplified scroll behavior
Modified:
trunk/reactos/base/setup/usetup/genlist.c
trunk/reactos/base/setup/usetup/genlist.h
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] Tue May 13 06:29:56 2008
@@ -238,25 +238,7 @@
ListEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
if (coPos.Y == GenericList->Bottom)
- {
- coPos.X = GenericList->Right - 4;
- coPos.Y = GenericList->Top;
- WriteConsoleOutputCharacterA (StdOutput,
- (LPCTSTR)"(\x18)",
- 3,
- coPos,
- &Written);
-
- coPos.X = GenericList->Right - 4;
- coPos.Y = GenericList->Bottom;
- WriteConsoleOutputCharacterA (StdOutput,
- (LPCTSTR)"(\x19)",
- 3,
- coPos,
- &Written);
break;
- }
-
GenericList->LastShown = Entry;
FillConsoleOutputAttribute (StdOutput,
@@ -302,6 +284,50 @@
}
}
+static VOID
+DrawScrollBarGenericList(PGENERIC_LIST GenericList)
+{
+ COORD coPos;
+ DWORD Written;
+
+ coPos.X = GenericList->Right + 1;
+ coPos.Y = GenericList->Top;
+
+ if (GenericList->FirstShown != GenericList->ListHead.Flink)
+ {
+ FillConsoleOutputCharacterA (StdOutput,
+ '\x18',
+ 1,
+ coPos,
+ &Written);
+ }
+ else
+ {
+ FillConsoleOutputCharacterA (StdOutput,
+ ' ',
+ 1,
+ coPos,
+ &Written);
+ }
+
+ coPos.Y = GenericList->Bottom;
+ if (GenericList->LastShown != GenericList->ListHead.Blink)
+ {
+ FillConsoleOutputCharacterA (StdOutput,
+ '\x19',
+ 1,
+ coPos,
+ &Written);
+ }
+ else
+ {
+ FillConsoleOutputCharacterA (StdOutput,
+ ' ',
+ 1,
+ coPos,
+ &Written);
+ }
+}
VOID
DrawGenericList(PGENERIC_LIST List,
@@ -322,6 +348,7 @@
return;
DrawListEntries(List);
+ DrawScrollBarGenericList(List);
}
@@ -329,26 +356,12 @@
ScrollDownGenericList (PGENERIC_LIST List)
{
PLIST_ENTRY Entry;
- COORD coPos;
- DWORD Written;
if (List->CurrentEntry == NULL)
return;
if (List->CurrentEntry->Entry.Flink != &List->ListHead)
{
- if (List->LastShown != &List->ListHead)
- {
- /* Draw lower edge */
- coPos.X = List->Left + 1;
- coPos.Y = List->Bottom;
- FillConsoleOutputCharacterA (StdOutput,
- 0xC4, // '-',
- List->Right - List->Left - 1,
- coPos,
- &Written);
- }
-
Entry = List->CurrentEntry->Entry.Flink;
if (List->LastShown == &List->CurrentEntry->Entry)
{
@@ -357,6 +370,7 @@
}
List->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
DrawListEntries(List);
+ DrawScrollBarGenericList(List);
}
}
@@ -365,8 +379,6 @@
ScrollUpGenericList (PGENERIC_LIST List)
{
PLIST_ENTRY Entry;
- COORD coPos;
- DWORD Written;
if (List->CurrentEntry == NULL)
return;
@@ -381,17 +393,7 @@
}
List->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
DrawListEntries(List);
- }
- else
- {
- /* Draw upper edge */
- coPos.X = List->Left + 1;
- coPos.Y = List->Top;
- FillConsoleOutputCharacterA (StdOutput,
- 0xC4, // '-',
- List->Right - List->Left - 1,
- coPos,
- &Written);
+ 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] Tue May 13 06:29:56 2008
@@ -53,6 +53,9 @@
SHORT Bottom);
VOID
+DrawScrollBarGenericLis(PGENERIC_LIST List);
+
+VOID
ScrollDownGenericList(PGENERIC_LIST List);
VOID