|
SASC-NG
DVBSoftCAM
|
Inheritance diagram for cMenuEditHexItem:Public Member Functions | |
| cMenuEditHexItem (const char *Name, int *Value, int Min=0, int Max=INT_MAX) | |
| virtual eOSState | ProcessKey (eKeys Key) |
Protected Member Functions | |
| virtual void | Set (void) |
Protected Attributes | |
| int * | value |
| int | min |
| int | max |
| cMenuEditHexItem::cMenuEditHexItem | ( | const char * | Name, |
| int * | Value, | ||
| int | Min = 0, |
||
| int | Max = INT_MAX |
||
| ) |
Reimplemented from cOsdItem.
Definition at line 163 of file sc.c.
References cOsdItem::fresh, k0, k9, k_Repeat, kBlue, kDown, kGreen, kLeft, kRed, kRight, kUp, kYellow, max, min, NORMALKEY, osContinue, osUnknown, Set(), and value.
{
switch(NORMALKEY(Key)) {
case kUp:
case kDown:
if(isOn) SetButtons(false);
break;
default:
if(!isOn) SetButtons(true);
break;
}
eOSState state=cMenuEditItem::ProcessKey(Key);
if(state!=osUnknown) return state;
int newValue=*value;
bool IsRepeat=Key & k_Repeat;
Key=NORMALKEY(Key);
switch(Key) {
case kBlue:
abc=!abc; SetButtons(true);
break;
case kRed:
case kGreen:
case kYellow:
case k0 ... k9:
{
if(fresh) { newValue=0; fresh=false; }
int add;
if(Key>=kRed && Key<=kYellow) add=(abc ? 10:13)+(Key-kRed);
else add=(Key-k0);
newValue=newValue*16+add;
break;
}
case kLeft:
newValue=*value-1; fresh=true;
if(!IsRepeat && newValue<min) newValue=max;
break;
case kRight:
newValue=*value+1; fresh=true;
if(!IsRepeat && newValue>max) newValue=min;
break;
default:
if(*value<min) { *value=min; Set(); }
if(*value>max) { *value=max; Set(); }
return osUnknown;
}
if(newValue!=*value && (!fresh || min<=newValue) && newValue<=max) {
*value=newValue;
Set();
}
return osContinue;
}
| void cMenuEditHexItem::Set | ( | void | ) | [protected, virtual] |
Reimplemented from cOsdItem.
Definition at line 156 of file sc.c.
References cMenuEditItem::SetValue(), and value.
Referenced by cMenuEditHexItem(), and ProcessKey().
int cMenuEditHexItem::max [protected] |
Definition at line 125 of file sc.c.
Referenced by cMenuEditHexItem(), and ProcessKey().
int cMenuEditHexItem::min [protected] |
Definition at line 125 of file sc.c.
Referenced by cMenuEditHexItem(), and ProcessKey().
int* cMenuEditHexItem::value [protected] |
Definition at line 124 of file sc.c.
Referenced by cMenuEditHexItem(), ProcessKey(), and Set().