mirror of
https://github.com/reactos/reactos.git
synced 2025-05-20 09:36:16 +00:00
- Implement generic list PageUp/PageDown
svn path=/trunk/; revision=33512
This commit is contained in:
parent
5e27385583
commit
57a0b9d688
3 changed files with 93 additions and 7 deletions
|
@ -52,6 +52,7 @@ typedef struct _GENERIC_LIST
|
|||
SHORT Top;
|
||||
SHORT Right;
|
||||
SHORT Bottom;
|
||||
BOOL Redraw;
|
||||
|
||||
PGENERIC_LIST_ENTRY CurrentEntry;
|
||||
PGENERIC_LIST_ENTRY BackupEntry;
|
||||
|
@ -74,6 +75,7 @@ CreateGenericList(VOID)
|
|||
List->Top = 0;
|
||||
List->Right = 0;
|
||||
List->Bottom = 0;
|
||||
List->Redraw = TRUE;
|
||||
|
||||
List->CurrentEntry = NULL;
|
||||
|
||||
|
@ -351,6 +353,47 @@ DrawGenericList(PGENERIC_LIST List,
|
|||
DrawScrollBarGenericList(List);
|
||||
}
|
||||
|
||||
VOID
|
||||
ScrollPageDownGenericList (PGENERIC_LIST List)
|
||||
{
|
||||
SHORT i;
|
||||
|
||||
/* Suspend auto-redraw */
|
||||
List->Redraw = FALSE;
|
||||
|
||||
for (i = List->Top + 1; i < List->Bottom - 1; i++)
|
||||
{
|
||||
ScrollDownGenericList (List);
|
||||
}
|
||||
|
||||
/* Update user interface */
|
||||
DrawListEntries(List);
|
||||
DrawScrollBarGenericList(List);
|
||||
|
||||
/* Re enable auto-redraw */
|
||||
List->Redraw = TRUE;
|
||||
}
|
||||
|
||||
VOID
|
||||
ScrollPageUpGenericList (PGENERIC_LIST List)
|
||||
{
|
||||
SHORT i;
|
||||
|
||||
/* Suspend auto-redraw */
|
||||
List->Redraw = FALSE;
|
||||
|
||||
for (i = List->Bottom - 1; i > List->Top + 1; i--)
|
||||
{
|
||||
ScrollUpGenericList (List);
|
||||
}
|
||||
|
||||
/* Update user interface */
|
||||
DrawListEntries(List);
|
||||
DrawScrollBarGenericList(List);
|
||||
|
||||
/* Re enable auto-redraw */
|
||||
List->Redraw = TRUE;
|
||||
}
|
||||
|
||||
VOID
|
||||
ScrollDownGenericList (PGENERIC_LIST List)
|
||||
|
@ -370,8 +413,11 @@ ScrollDownGenericList (PGENERIC_LIST List)
|
|||
}
|
||||
List->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
|
||||
|
||||
DrawListEntries(List);
|
||||
DrawScrollBarGenericList(List);
|
||||
if (List->Redraw)
|
||||
{
|
||||
DrawListEntries(List);
|
||||
DrawScrollBarGenericList(List);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -394,8 +440,11 @@ ScrollUpGenericList (PGENERIC_LIST List)
|
|||
}
|
||||
List->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
|
||||
|
||||
DrawListEntries(List);
|
||||
DrawScrollBarGenericList(List);
|
||||
if (List->Redraw)
|
||||
{
|
||||
DrawListEntries(List);
|
||||
DrawScrollBarGenericList(List);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,12 @@ ScrollDownGenericList(PGENERIC_LIST List);
|
|||
VOID
|
||||
ScrollUpGenericList(PGENERIC_LIST List);
|
||||
|
||||
VOID
|
||||
ScrollPageDownGenericList(PGENERIC_LIST List);
|
||||
|
||||
VOID
|
||||
ScrollPageUpGenericList(PGENERIC_LIST List);
|
||||
|
||||
VOID
|
||||
SetCurrentListEntry(PGENERIC_LIST List, PGENERIC_LIST_ENTRY Entry);
|
||||
|
||||
|
|
|
@ -621,21 +621,37 @@ LanguagePage(PINPUT_RECORD Ir)
|
|||
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
|
||||
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */
|
||||
{
|
||||
#if 0 //Dynamically update user interface
|
||||
SelectedLanguageId = (PWCHAR)LanguageList->CurrentEntry->UserData;
|
||||
#if 0
|
||||
SelectedLanguageId = (PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
|
||||
|
||||
/* Redraw language selection page in native language */
|
||||
MUIDisplayPage(LANGUAGE_PAGE);
|
||||
#endif
|
||||
|
||||
ScrollDownGenericList (LanguageList);
|
||||
}
|
||||
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
|
||||
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */
|
||||
{
|
||||
#if 0
|
||||
SelectedLanguageId = (PWCHAR)LanguageList->CurrentEntry->UserData;
|
||||
SelectedLanguageId = (PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
|
||||
|
||||
/* Redraw language selection page in native language */
|
||||
MUIDisplayPage(LANGUAGE_PAGE);
|
||||
#endif
|
||||
|
||||
ScrollUpGenericList (LanguageList);
|
||||
}
|
||||
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
|
||||
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_NEXT)) /* PAGE DOWN */
|
||||
{
|
||||
ScrollPageDownGenericList (LanguageList);
|
||||
}
|
||||
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
|
||||
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_PRIOR)) /* PAGE UP */
|
||||
{
|
||||
ScrollPageUpGenericList (LanguageList);
|
||||
}
|
||||
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
|
||||
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
|
||||
{
|
||||
|
@ -1269,6 +1285,16 @@ LayoutSettingsPage(PINPUT_RECORD Ir)
|
|||
{
|
||||
ScrollUpGenericList (LayoutList);
|
||||
}
|
||||
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
|
||||
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_NEXT)) /* PAGE DOWN */
|
||||
{
|
||||
ScrollPageDownGenericList (LayoutList);
|
||||
}
|
||||
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
|
||||
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_PRIOR)) /* PAGE UP */
|
||||
{
|
||||
ScrollPageUpGenericList (LayoutList);
|
||||
}
|
||||
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
|
||||
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
|
||||
{
|
||||
|
@ -1287,6 +1313,11 @@ LayoutSettingsPage(PINPUT_RECORD Ir)
|
|||
{
|
||||
return DEVICE_SETTINGS_PAGE;
|
||||
}
|
||||
else if ((Ir->Event.KeyEvent.uChar.AsciiChar > 0x60) && (Ir->Event.KeyEvent.uChar.AsciiChar < 0x7b))
|
||||
{
|
||||
/* a-z */
|
||||
GenericListKeyPress (LayoutList , Ir->Event.KeyEvent.uChar.AsciiChar);
|
||||
}
|
||||
}
|
||||
|
||||
return DISPLAY_SETTINGS_PAGE;
|
||||
|
|
Loading…
Reference in a new issue