mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 19:05:52 +00:00
[NTVDM]
Implement vertical scrolling in BiosScrollWindow. svn path=/branches/ntvdm/; revision=60955
This commit is contained in:
parent
c7a7dbe7e2
commit
b781febbfe
1 changed files with 46 additions and 4 deletions
|
@ -651,8 +651,9 @@ BOOLEAN BiosScrollWindow(INT Direction,
|
||||||
{
|
{
|
||||||
DWORD i;
|
DWORD i;
|
||||||
LPWORD WindowData;
|
LPWORD WindowData;
|
||||||
DWORD WindowSize = (Rectangle.Bottom - Rectangle.Top + 1)
|
WORD WindowWidth = Rectangle.Right - Rectangle.Left + 1;
|
||||||
* (Rectangle.Right - Rectangle.Left + 1);
|
WORD WindowHeight = Rectangle.Bottom - Rectangle.Top + 1;
|
||||||
|
DWORD WindowSize = WindowWidth * WindowHeight;
|
||||||
|
|
||||||
/* Allocate a buffer for the window */
|
/* Allocate a buffer for the window */
|
||||||
WindowData = (LPWORD)HeapAlloc(GetProcessHeap(),
|
WindowData = (LPWORD)HeapAlloc(GetProcessHeap(),
|
||||||
|
@ -663,7 +664,13 @@ BOOLEAN BiosScrollWindow(INT Direction,
|
||||||
/* Read the window data */
|
/* Read the window data */
|
||||||
BiosReadWindow(WindowData, Rectangle, Page);
|
BiosReadWindow(WindowData, Rectangle, Page);
|
||||||
|
|
||||||
if (Amount == 0)
|
if ((Amount == 0)
|
||||||
|
|| (((Direction == SCROLL_DIRECTION_UP)
|
||||||
|
|| (Direction == SCROLL_DIRECTION_DOWN))
|
||||||
|
&& (Amount >= WindowHeight))
|
||||||
|
|| (((Direction == SCROLL_DIRECTION_LEFT)
|
||||||
|
|| (Direction == SCROLL_DIRECTION_RIGHT))
|
||||||
|
&& (Amount >= WindowWidth)))
|
||||||
{
|
{
|
||||||
/* Fill the window */
|
/* Fill the window */
|
||||||
for (i = 0; i < WindowSize; i++)
|
for (i = 0; i < WindowSize; i++)
|
||||||
|
@ -674,7 +681,42 @@ BOOLEAN BiosScrollWindow(INT Direction,
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Scroll the window!
|
switch (Direction)
|
||||||
|
{
|
||||||
|
case SCROLL_DIRECTION_UP:
|
||||||
|
{
|
||||||
|
RtlMoveMemory(WindowData,
|
||||||
|
&WindowData[WindowWidth * Amount],
|
||||||
|
(WindowSize - WindowWidth * Amount) * sizeof(WORD));
|
||||||
|
|
||||||
|
for (i = 0; i < Amount * WindowWidth; i++)
|
||||||
|
{
|
||||||
|
WindowData[WindowSize - i - 1] = MAKEWORD(' ', FillAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case SCROLL_DIRECTION_DOWN:
|
||||||
|
{
|
||||||
|
RtlMoveMemory(&WindowData[WindowWidth * Amount],
|
||||||
|
WindowData,
|
||||||
|
(WindowSize - WindowWidth * Amount) * sizeof(WORD));
|
||||||
|
|
||||||
|
for (i = 0; i < Amount * WindowWidth; i++)
|
||||||
|
{
|
||||||
|
WindowData[i] = MAKEWORD(' ', FillAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
// TODO: NOT IMPLEMENTED!
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Done:
|
Done:
|
||||||
/* Write back the window data */
|
/* Write back the window data */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue