|
SASC
DVBSoftCAM
|
#include <menuitems.h>
Inheritance diagram for cMenuEditIntItem:Public Member Functions | |
| cMenuEditIntItem (const char *Name, int *Value, int Min=0, int Max=INT_MAX, const char *MinString=NULL, const char *MaxString=NULL) | |
| virtual eOSState | ProcessKey (eKeys Key) |
Protected Member Functions | |
| virtual void | Set (void) |
Protected Attributes | |
| int * | value |
| int | min |
| int | max |
| const char * | minString |
| const char * | maxString |
Definition at line 26 of file menuitems.h.
| cMenuEditIntItem::cMenuEditIntItem | ( | const char * | Name, |
| int * | Value, | ||
| int | Min = 0, |
||
| int | Max = INT_MAX, |
||
| const char * | MinString = NULL, |
||
| const char * | MaxString = NULL |
||
| ) |
Reimplemented from cOsdItem.
Reimplemented in cMenuEditChanItem, cMenuEditTranItem, cMenuEditCapItem, and cMenuEditCapItem.
Definition at line 68 of file menuitems.cpp.
References cOsdItem::fresh, k0, k9, kLeft, kNone, kRight, max, min, NORMALKEY, osContinue, osUnknown, Set(), and value.
{
eOSState state = cMenuEditItem::ProcessKey(Key);
if (state == osUnknown) {
int newValue = *value;
Key = NORMALKEY(Key);
switch (Key) {
case kNone: break;
case k0 ... k9:
if (fresh) {
*value = 0;
fresh = false;
}
newValue = *value * 10 + (Key - k0);
break;
case kLeft: // TODO might want to increase the delta if repeated quickly?
newValue = *value - 1;
fresh = true;
break;
case kRight:
newValue = *value + 1;
fresh = true;
break;
default:
if (*value < min) { *value = min; Set(); }
if (*value > max) { *value = max; Set(); }
return state;
}
if ((!fresh || min <= newValue) && newValue <= max) {
*value = newValue;
Set();
}
state = osContinue;
}
return state;
}
| void cMenuEditIntItem::Set | ( | void | ) | [protected, virtual] |
Reimplemented from cOsdItem.
Reimplemented in cMenuEditBoolItem, cMenuEditBitItem, cMenuEditStraItem, cMenuEditChanItem, cMenuEditCapItem, and cMenuEditCapItem.
Definition at line 55 of file menuitems.cpp.
References max, maxString, min, minString, cMenuEditItem::SetValue(), and value.
Referenced by cMenuEditIntItem(), and ProcessKey().
int cMenuEditIntItem::max [protected] |
Definition at line 29 of file menuitems.h.
Referenced by cMenuEditIntItem(), ProcessKey(), and Set().
const char * cMenuEditIntItem::maxString [protected] |
Definition at line 30 of file menuitems.h.
Referenced by cMenuEditIntItem(), and Set().
int cMenuEditIntItem::min [protected] |
Definition at line 29 of file menuitems.h.
Referenced by cMenuEditIntItem(), ProcessKey(), and Set().
const char* cMenuEditIntItem::minString [protected] |
Definition at line 30 of file menuitems.h.
Referenced by cMenuEditIntItem(), and Set().
int* cMenuEditIntItem::value [protected] |
Reimplemented in cMenuEditBitItem.
Definition at line 28 of file menuitems.h.
Referenced by cMenuEditIntItem(), ProcessKey(), cMenuEditCapItem::Set(), cMenuEditBoolItem::Set(), and Set().