Preparing the input classes for Lua

- Add non locale variants for CExtendedInput, CStringInput,
  CStringInputSMS, CPINInput
  THX Martii
This commit is contained in:
M. Liebmann
2014-01-18 13:32:01 +01:00
parent 0a5a7b3146
commit 31842369cc
21 changed files with 359 additions and 438 deletions

View File

@@ -63,10 +63,10 @@ class CExtendedInput : public CMenuTarget
int selectedChar;
neutrino_locale_t name;
std::string nameString;
neutrino_locale_t hint_1;
neutrino_locale_t hint_2;
char* value;
CChangeObserver* observ;
bool* cancel;
@@ -76,7 +76,8 @@ class CExtendedInput : public CMenuTarget
public:
CExtendedInput(const neutrino_locale_t Name, char* Value, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ = NULL, bool* cancel = NULL);
CExtendedInput(const neutrino_locale_t Name, std::string *Value, const neutrino_locale_t Hint_1 = NONEXISTANT_LOCALE, const neutrino_locale_t Hint_2 = NONEXISTANT_LOCALE, CChangeObserver* Observ = NULL, bool* cancel = NULL);
CExtendedInput(std::string &Name, std::string *Value, const neutrino_locale_t Hint_1 = NONEXISTANT_LOCALE, const neutrino_locale_t Hint_2 = NONEXISTANT_LOCALE, CChangeObserver* Observ = NULL, bool* cancel = NULL);
~CExtendedInput();
void hide();
@@ -155,22 +156,19 @@ class CExtendedInput_Item_Char : public CExtendedInput_Item
class CIPInput : public CExtendedInput
{
char IP[16];
std::string * ip;
protected:
virtual void onBeforeExec();
virtual void onAfterExec();
public:
CIPInput(const neutrino_locale_t Name, std::string & Value, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ = NULL);
CIPInput(const neutrino_locale_t Name, std::string *Value, const neutrino_locale_t Hint_1 = NONEXISTANT_LOCALE, const neutrino_locale_t Hint_2 = NONEXISTANT_LOCALE, CChangeObserver* Observ = NULL);
};
//----------------------------------------------------------------------------------------------------
class CDateInput : public CExtendedInput
{
private:
private:
time_t* time;
protected:
@@ -178,23 +176,19 @@ class CDateInput : public CExtendedInput
virtual void onAfterExec();
public:
CDateInput(const neutrino_locale_t Name, time_t* Time, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ = NULL);
~CDateInput();
CDateInput(const neutrino_locale_t Name, time_t* Time, const neutrino_locale_t Hint_1 = NONEXISTANT_LOCALE, const neutrino_locale_t Hint_2 = NONEXISTANT_LOCALE, CChangeObserver* Observ = NULL);
};
//----------------------------------------------------------------------------------------------------
class CMACInput : public CExtendedInput
{
char MAC[32];
std::string * mac;
protected:
virtual void onBeforeExec();
virtual void onAfterExec();
public:
CMACInput(const neutrino_locale_t Name, std::string & Value, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ = NULL);
CMACInput(const neutrino_locale_t Name, std::string *Value, const neutrino_locale_t Hint_1 = NONEXISTANT_LOCALE, const neutrino_locale_t Hint_2 = NONEXISTANT_LOCALE, CChangeObserver* Observ = NULL);
};
//----------------------------------------------------------------------------------------------------
@@ -204,9 +198,8 @@ class CTimeInput : public CExtendedInput
protected:
virtual void onBeforeExec();
virtual void onAfterExec();
public:
CTimeInput(const neutrino_locale_t Name, char* Value, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ = NULL, bool* cancel=NULL);
CTimeInput(const neutrino_locale_t Name, std::string *Value, const neutrino_locale_t Hint_1 = NONEXISTANT_LOCALE, const neutrino_locale_t Hint_2 = NONEXISTANT_LOCALE, CChangeObserver* Observ = NULL, bool* cancel=NULL);
};
//----------------------------------------------------------------------------------------------------
@@ -215,9 +208,6 @@ class CIntInput : public CExtendedInput
{
#define MAX_CINTINPUT_SIZE 16
char myValueStringInput[MAX_CINTINPUT_SIZE];
char myValueStringOutput[MAX_CINTINPUT_SIZE];
int* myValue;
unsigned int m_size;
protected:
@@ -228,7 +218,7 @@ class CIntInput : public CExtendedInput
/**
*@param Size how many digits can be entered
*/
CIntInput(const neutrino_locale_t Name, int& Value, const unsigned int Size, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ = NULL);
CIntInput(const neutrino_locale_t Name, int *Value, const unsigned int Size, const neutrino_locale_t Hint_1 = NONEXISTANT_LOCALE, const neutrino_locale_t Hint_2 = NONEXISTANT_LOCALE, CChangeObserver* Observ = NULL);
void updateValue() { onBeforeExec(); }
};