mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
neutrino: add a input object for Enquiry Objects from CI. They specify if the
input has to be blind.
This commit is contained in:
@@ -147,7 +147,9 @@ void CStringInput::init()
|
|||||||
|
|
||||||
if (width<420)
|
if (width<420)
|
||||||
width = 420;
|
width = 420;
|
||||||
|
#ifdef DEBUG_STRINGINPUT
|
||||||
|
printf("HEAD: %s (len: %d)\n", head, strlen(head));
|
||||||
|
#endif
|
||||||
int neededWidth;
|
int neededWidth;
|
||||||
if(head) {
|
if(head) {
|
||||||
neededWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(head, true); // UTF-8
|
neededWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(head, true); // UTF-8
|
||||||
@@ -856,6 +858,14 @@ int CPINInput::exec( CMenuTarget* parent, const std::string & )
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CEnquiryInput::paintChar(int pos)
|
||||||
|
{
|
||||||
|
if (blind)
|
||||||
|
CStringInput::paintChar(pos, (value[pos] == ' ') ? ' ' : '*');
|
||||||
|
else
|
||||||
|
CStringInput::paintChar(pos, value[pos]);
|
||||||
|
}
|
||||||
|
|
||||||
int CPLPINInput::handleOthers(neutrino_msg_t msg, neutrino_msg_data_t data)
|
int CPLPINInput::handleOthers(neutrino_msg_t msg, neutrino_msg_data_t data)
|
||||||
{
|
{
|
||||||
int res = messages_return::unhandled;
|
int res = messages_return::unhandled;
|
||||||
|
@@ -140,6 +140,21 @@ class CPINInput : public CStringInput
|
|||||||
int exec( CMenuTarget* parent, const std::string & actionKey );
|
int exec( CMenuTarget* parent, const std::string & actionKey );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// For CI
|
||||||
|
class CEnquiryInput : public CPINInput
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
bool blind;
|
||||||
|
protected:
|
||||||
|
virtual void paintChar(int pos);
|
||||||
|
public:
|
||||||
|
CEnquiryInput(const neutrino_locale_t Name, char* Value, int Size, bool Blind, const neutrino_locale_t Hint_1 = NONEXISTANT_LOCALE, const neutrino_locale_t Hint_2 = NONEXISTANT_LOCALE, const char * const Valid_Chars= (const char *)"0123456789", CChangeObserver* Observ = NULL)
|
||||||
|
: CPINInput(Name, (char *)Value, Size, Hint_1, Hint_2, Valid_Chars, Observ) { blind = Blind; }
|
||||||
|
CEnquiryInput(char * Head, char* Value, int Size, bool Blind, const neutrino_locale_t Hint_1 = NONEXISTANT_LOCALE, const neutrino_locale_t Hint_2 = NONEXISTANT_LOCALE, const char * const Valid_Chars= (const char *)"0123456789", CChangeObserver* Observ = NULL)
|
||||||
|
: CPINInput(Head, (char *)Value, Size, Hint_1, Hint_2, Valid_Chars, Observ) { blind = Blind; }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class CPLPINInput : public CPINInput
|
class CPLPINInput : public CPINInput
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
Reference in New Issue
Block a user