diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2006-07-23 09:48:51 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2006-07-23 09:48:51 +0200 |
commit | 8f2f3e9ac28f3f3380166f94fa297d23463770d6 (patch) | |
tree | ead67ffdd6f3453a1623ed206d555e9a9b608cca /menuitems.c | |
parent | 35884ec7320ed5186d377eed1d9d1e0d8af29802 (diff) | |
download | vdr-8f2f3e9ac28f3f3380166f94fa297d23463770d6.tar.gz vdr-8f2f3e9ac28f3f3380166f94fa297d23463770d6.tar.bz2 |
Menu items derived from cMenuEditIntItem now loop though their values if they have a dedicated minimum or maximum limit1.4.1-2
Diffstat (limited to 'menuitems.c')
-rw-r--r-- | menuitems.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/menuitems.c b/menuitems.c index 517664c7..cbfcf053 100644 --- a/menuitems.c +++ b/menuitems.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menuitems.c 1.45 2006/06/03 13:20:01 kls Exp $ + * $Id: menuitems.c 1.46 2006/07/23 09:42:17 kls Exp $ */ #include "menuitems.h" @@ -75,6 +75,7 @@ eOSState cMenuEditIntItem::ProcessKey(eKeys Key) if (state == osUnknown) { int newValue = *value; + bool IsRepeat = Key & k_Repeat; Key = NORMALKEY(Key); switch (Key) { case kNone: break; @@ -88,10 +89,14 @@ eOSState cMenuEditIntItem::ProcessKey(eKeys Key) case kLeft: // TODO might want to increase the delta if repeated quickly? newValue = *value - 1; fresh = true; + if (!IsRepeat && newValue < min && max != INT_MAX) + newValue = max; break; case kRight: newValue = *value + 1; fresh = true; + if (!IsRepeat && newValue > max && min != INT_MIN) + newValue = min; break; default: if (*value < min) { *value = min; Set(); } |