1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Menu items derived from cMenuEditIntItem now loop though their values if they have a dedicated minimum or maximum limit

This commit is contained in:
Klaus Schmidinger 2006-07-23 09:48:51 +02:00
parent 35884ec732
commit 8f2f3e9ac2
3 changed files with 12 additions and 1 deletions

View File

@ -341,6 +341,8 @@ Andy Grobb <Charly98@01019freenet.de>
for reporting a bug in handling min/max borders when entering integer values for reporting a bug in handling min/max borders when entering integer values
for reporting a problem with replaying in fast forward mode if the video directory for reporting a problem with replaying in fast forward mode if the video directory
is mounted via a Samba share is mounted via a Samba share
for suggesting to make menu items that are derived from cMenuEditIntItem loop
though their values if they have a dedicated minimum or maximum limit
Thomas Heiligenmann <thomas@heiligenmann.de> Thomas Heiligenmann <thomas@heiligenmann.de>
for implementing the SVDRP commands LSTR and DELR for implementing the SVDRP commands LSTR and DELR

View File

@ -4830,3 +4830,7 @@ Video Disk Recorder Revision History
require detatching receivers (suggested by Anssi Hannula). require detatching receivers (suggested by Anssi Hannula).
- Fixed handling numeric keys in the channel display after switching channel groups - Fixed handling numeric keys in the channel display after switching channel groups
(thanks to Andreas Regel). (thanks to Andreas Regel).
- Menu items derived from cMenuEditIntItem now loop though their values if they
have a dedicated minimum or maximum limit (suggested by Andy Grobb). Looping is
only done for normal keypresses, not for repeated ones. This allows the user to
scroll the value all the way to the limit by keeping the key pressed.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "menuitems.h"
@ -75,6 +75,7 @@ eOSState cMenuEditIntItem::ProcessKey(eKeys Key)
if (state == osUnknown) { if (state == osUnknown) {
int newValue = *value; int newValue = *value;
bool IsRepeat = Key & k_Repeat;
Key = NORMALKEY(Key); Key = NORMALKEY(Key);
switch (Key) { switch (Key) {
case kNone: break; case kNone: break;
@ -88,10 +89,14 @@ eOSState cMenuEditIntItem::ProcessKey(eKeys Key)
case kLeft: // TODO might want to increase the delta if repeated quickly? case kLeft: // TODO might want to increase the delta if repeated quickly?
newValue = *value - 1; newValue = *value - 1;
fresh = true; fresh = true;
if (!IsRepeat && newValue < min && max != INT_MAX)
newValue = max;
break; break;
case kRight: case kRight:
newValue = *value + 1; newValue = *value + 1;
fresh = true; fresh = true;
if (!IsRepeat && newValue > max && min != INT_MIN)
newValue = min;
break; break;
default: default:
if (*value < min) { *value = min; Set(); } if (*value < min) { *value = min; Set(); }