SASC
DVBSoftCAM

cMenuEditNumItem Class Reference

#include <menuitems.h>

Inheritance diagram for cMenuEditNumItem:

List of all members.

Public Member Functions

 cMenuEditNumItem (const char *Name, char *Value, int Length, bool Blind=false)
virtual eOSState ProcessKey (eKeys Key)

Protected Member Functions

virtual void Set (void)

Protected Attributes

char * value
int length
bool blind

Detailed Description

Definition at line 55 of file menuitems.h.


Constructor & Destructor Documentation

cMenuEditNumItem::cMenuEditNumItem ( const char *  Name,
char *  Value,
int  Length,
bool  Blind = false 
)

Definition at line 142 of file menuitems.cpp.

References blind, length, Set(), and value.

:cMenuEditItem(Name)
{
  value = Value;
  length = Length;
  blind = Blind;
  Set();
}

Member Function Documentation

eOSState cMenuEditNumItem::ProcessKey ( eKeys  Key) [virtual]

Reimplemented from cOsdItem.

Definition at line 165 of file menuitems.cpp.

References k0, k9, kLeft, length, NORMALKEY, osContinue, osUnknown, Set(), and value.

{
  eOSState state = cMenuEditItem::ProcessKey(Key);

  if (state == osUnknown) {
     Key = NORMALKEY(Key);
     switch (Key) {
       case kLeft: {
            int l = strlen(value);
            if (l > 0)
               value[l - 1] = 0;
            }
            break;
       case k0 ... k9: {
            int l = strlen(value);
            if (l < length) {
               value[l] = Key - k0 + '0';
               value[l + 1] = 0;
               }
            }
            break;
       default: return state;
       }
     Set();
     state = osContinue;
     }
  return state;
}
void cMenuEditNumItem::Set ( void  ) [protected, virtual]

Reimplemented from cOsdItem.

Definition at line 151 of file menuitems.cpp.

References blind, i, length, cMenuEditItem::SetValue(), and value.

Referenced by cMenuEditNumItem(), and ProcessKey().

{
  if (blind) {
     char buf[length + 1];
     int i;
     for (i = 0; i < length && value[i]; i++)
         buf[i] = '*';
     buf[i] = 0;
     SetValue(buf);
     }
  else
     SetValue(value);
}

Member Data Documentation

bool cMenuEditNumItem::blind [protected]

Definition at line 59 of file menuitems.h.

Referenced by cMenuEditNumItem(), and Set().

int cMenuEditNumItem::length [protected]

Definition at line 58 of file menuitems.h.

Referenced by cMenuEditNumItem(), ProcessKey(), and Set().

char* cMenuEditNumItem::value [protected]

Definition at line 57 of file menuitems.h.

Referenced by cMenuEditNumItem(), ProcessKey(), and Set().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines