- keychooser: just small renamings for a better view

This commit is contained in:
vanhofen
2017-09-15 19:04:57 +02:00
committed by Jacek Jendrzej
parent 38f80a5ca6
commit 2cc8978f4b
2 changed files with 24 additions and 22 deletions

View File

@@ -36,8 +36,8 @@ CKeyChooser::CKeyChooser(unsigned int * const Key, const neutrino_locale_t title
keyName = CRCInput::getKeyName(*key);
addIntroItems();
addItem(new CMenuDForwarder(LOCALE_KEYCHOOSERMENU_SETNEW, true, NULL, new CKeyChooserItem(LOCALE_KEYCHOOSER_HEAD, key)));
addItem(new CMenuDForwarder(LOCALE_KEYCHOOSERMENU_SETNONE, true, NULL, new CKeyChooserItemNoKey(key)));
addItem(new CMenuDForwarder(LOCALE_KEYCHOOSERMENU_SETNEW, true, NULL, new CKeyChooserItem(key, LOCALE_KEYCHOOSER_HEAD)));
addItem(new CMenuDForwarder(LOCALE_KEYCHOOSERMENU_SETNONE, true, NULL, new CKeyRemoverItem(key)));
addItem(GenericMenuSeparatorLine);
addItem(new CMenuForwarder(LOCALE_KEYCHOOSERMENU_CURRENTKEY, false, keyName));
}
@@ -52,12 +52,6 @@ void CKeyChooser::paint()
CMenuWidget::paint();
}
CKeyChooserItem::CKeyChooserItem(const neutrino_locale_t Name, unsigned int * Key)
{
name = Name;
key = Key;
}
int CKeyChooserItem::exec(CMenuTarget* parent, const std::string &)
{
neutrino_msg_t msg;
@@ -84,7 +78,7 @@ int CKeyChooserItem::exec(CMenuTarget* parent, const std::string &)
timeoutEnd = CRCInput::calcTimeoutEnd(timeout);
get_Message:
get_Message:
g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd );
if (msg != CRCInput::RC_timeout)
@@ -101,3 +95,9 @@ int CKeyChooserItem::exec(CMenuTarget* parent, const std::string &)
hintbox->hide();
return res;
}
int CKeyRemoverItem::exec(CMenuTarget* /*parent*/, const std::string &)
{
*key = (unsigned int)CRCInput::RC_nokey;
return menu_return::RETURN_REPAINT;
}

View File

@@ -47,29 +47,31 @@ class CKeyChooser : public CMenuWidget
class CKeyChooserItem : public CMenuTarget
{
private:
neutrino_locale_t name;
unsigned int *key;
public:
CKeyChooserItem(const neutrino_locale_t Name, unsigned int *Key);
neutrino_locale_t name;
int exec(CMenuTarget* parent, const std::string & actionKey);
public:
CKeyChooserItem(unsigned int *Key, const neutrino_locale_t Name)
{
key = Key;
name = Name;
}
int exec(CMenuTarget* parent, const std::string & /*actionKey*/);
};
class CKeyChooserItemNoKey : public CMenuTarget
class CKeyRemoverItem : public CMenuTarget
{
unsigned int *key;
private:
unsigned int *key;
public:
CKeyChooserItemNoKey(unsigned int *Key)
CKeyRemoverItem(unsigned int *Key)
{
key = Key;
};
int exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/)
{
*key = (unsigned int)CRCInput::RC_nokey;
return menu_return::RETURN_REPAINT;
}
int exec(CMenuTarget* parent, const std::string & /*actionKey*/);
};
#endif