diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 0e5ed1e0c..2a491e5dd 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -55,9 +55,18 @@ #include #include #include +#include extern int cs_test_card(int unit, char * str); +#define TestButtonsCount 3 +const struct button_label TestButtons[/*TestButtonsCount*/] = +{ + { NEUTRINO_ICON_BUTTON_RED , LOCALE_STRINGINPUT_CAPS }, + { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_STRINGINPUT_CLEAR }, + { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_MESSAGEBOX_INFO } +}; + CTestMenu::CTestMenu() { @@ -533,12 +542,21 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (actionKey == "footer"){ int hh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); if (footer == NULL){ - footer = new CComponentsFooter (100, 50, 500, hh, CComponentsHeader::CC_BTN_HELP | CComponentsHeader::CC_BTN_EXIT | CComponentsHeader::CC_BTN_MENU, NULL, true); + footer = new CComponentsFooter (100, 30, 1000, hh, CComponentsFooter::CC_BTN_HELP | CComponentsFooter::CC_BTN_EXIT | CComponentsFooter::CC_BTN_MENU |CComponentsFooter::CC_BTN_MUTE_ZAP_ACTIVE, NULL, true); int start = 5, btnw =90, btnh = 37; - footer->addCCItem(new CComponentsButtonRed(start, 0, btnw, btnh, "Button1")); - footer->addCCItem(new CComponentsButtonGreen(start+=btnw, 0, btnw, btnh, "Button2")); - footer->addCCItem(new CComponentsButtonYellow(start+=btnw, 0, btnw, btnh, "Button3")); - footer->addCCItem(new CComponentsButtonBlue(start+=btnw, 0, btnw, btnh, "Button4")); + footer->setIcon(NEUTRINO_ICON_INFO); + + //add button labels with conventional button label struct + footer->setButtonLabels(TestButtons, TestButtonsCount, 0, 250); + + //also possible: use directly button name and as 2nd parameter string or locale as text +// footer->setButtonLabel(NEUTRINO_ICON_BUTTON_RED, "This is a button label text!", 0, 250); + + //also possible: use Button objects +// footer->addCCItem(new CComponentsButtonRed(start, 0, btnw, btnh, "Button1")); +// footer->addCCItem(new CComponentsButtonGreen(start+=btnw, 0, btnw, btnh, "Button2")); +// footer->addCCItem(new CComponentsButtonYellow(start+=btnw, 0, btnw, btnh, "Button3")); +// footer->addCCItem(new CComponentsButtonBlue(start+=btnw, 0, btnw, btnh, "Button4")); } if (!footer->isPainted()) footer->paint();