summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-03-16 14:08:12 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-03-16 14:08:12 +0100
commit25abe47a3b3ba1e518e96d9c4cbccadeff1bc480 (patch)
tree929ffd510aec371c73f42f5b7d07e0a694e79e52 /menu.c
parent45180b762fbb9f51352e75cf55d1672c1b1f961e (diff)
downloadvdr-25abe47a3b3ba1e518e96d9c4cbccadeff1bc480.tar.gz
vdr-25abe47a3b3ba1e518e96d9c4cbccadeff1bc480.tar.bz2
The 'Left' and 'Right' keys are now used to page up and down in text displays
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/menu.c b/menu.c
index 2ffd62ed..a6d51dc8 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.167 2002/03/16 11:29:58 kls Exp $
+ * $Id: menu.c 1.168 2002/03/16 14:03:38 kls Exp $
*/
#include "menu.h"
@@ -933,8 +933,8 @@ public:
virtual void Display(int Offset = -1, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBackground);
bool CanScrollUp(void) { return offset > 0; }
bool CanScrollDown(void) { return h + offset < lines; }
- void ScrollUp(void);
- void ScrollDown(void);
+ void ScrollUp(bool Page);
+ void ScrollDown(bool Page);
virtual eOSState ProcessKey(eKeys Key);
};
@@ -993,20 +993,20 @@ void cMenuTextItem::Display(int Offset, eDvbColor FgColor, eDvbColor BgColor)
if (CanScrollDown()) Interface->Write(x + w - 1, y + h - 1, "v", bgColor, fgColor);
}
-void cMenuTextItem::ScrollUp(void)
+void cMenuTextItem::ScrollUp(bool Page)
{
if (CanScrollUp()) {
Clear();
- offset--;
+ offset = max(offset - (Page ? h : 1), 0);
Display();
}
}
-void cMenuTextItem::ScrollDown(void)
+void cMenuTextItem::ScrollDown(bool Page)
{
if (CanScrollDown()) {
Clear();
- offset++;
+ offset = min(offset + (Page ? h : 1), lines - h);
Display();
}
}
@@ -1014,10 +1014,14 @@ void cMenuTextItem::ScrollDown(void)
eOSState cMenuTextItem::ProcessKey(eKeys Key)
{
switch (Key) {
+ case kLeft|k_Repeat:
+ case kLeft:
case kUp|k_Repeat:
- case kUp: ScrollUp(); break;
+ case kUp: ScrollUp(NORMALKEY(Key) == kLeft); break;
+ case kRight|k_Repeat:
+ case kRight:
case kDown|k_Repeat:
- case kDown: ScrollDown(); break;
+ case kDown: ScrollDown(NORMALKEY(Key) == kRight); break;
default: return osUnknown;
}
return osContinue;