diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index b41d64490..c9992a55b 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -69,6 +69,7 @@ CTestMenu::CTestMenu() form = NULL; txt = NULL; header = NULL; + iconform = NULL; } CTestMenu::~CTestMenu() @@ -80,6 +81,7 @@ CTestMenu::~CTestMenu() delete form; delete txt; delete header; + delete iconform; } int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) @@ -418,7 +420,10 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else if (actionKey == "header"){ if (header == NULL) - header = new CComponentsHeader (100, 100, 300, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(), "Test-Header", NEUTRINO_ICON_INFO); + header = new CComponentsHeader (100, 50, 480, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(), "Test-Header", NEUTRINO_ICON_INFO); +// header->setFrameThickness(5); +// header->setColorFrame(COL_WHITE); +// header->setCornerType(CORNER_TOP); if (!header->isPainted()) header->paint(); @@ -426,6 +431,42 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) header->hide(); return res; } + else if (actionKey == "iconform"){ + if (iconform == NULL) + iconform = new CComponentsIconForm(); + iconform->setColorBody(COL_LIGHT_GRAY); + iconform->setDimensionsAll(100, 100, 0, 60); + iconform->setFrameThickness(2); + iconform->setColorFrame(COL_WHITE); + iconform->setIconOffset(5); + //For existing instances it's recommended + //to remove old items before add new icons, otherwise icons will be appended. + iconform->removeAllIcons(); + + //you can... + //add icons step by step + iconform->addIcon(NEUTRINO_ICON_INFO); + iconform->addIcon(NEUTRINO_ICON_INFO); + iconform->addIcon(NEUTRINO_ICON_HINT_MEDIA); + //...or + //add icons with vector + std::vector v_icons; + v_icons.push_back(NEUTRINO_ICON_HINT_VIDEO); + v_icons.push_back(NEUTRINO_ICON_HINT_AUDIO); + iconform->addIcon(v_icons); + + //insert any icon, here as first (index = 0) + iconform->insertIcon(0, NEUTRINO_ICON_HINT_APLAY); + + + if (iconform->isPainted()) + iconform->hide(); + else{ + iconform->paint(); + } + return res; + } + showTestMenu(); @@ -472,6 +513,7 @@ void CTestMenu::showCCTests(CMenuWidget *widget) widget->addItem(new CMenuForwarderNonLocalized("Form", true, NULL, this, "form")); widget->addItem(new CMenuForwarderNonLocalized("Text", true, NULL, this, "text")); widget->addItem(new CMenuForwarderNonLocalized("Header", true, NULL, this, "header")); + widget->addItem(new CMenuForwarderNonLocalized("Icon-Form", true, NULL, this, "iconform")); } void CTestMenu::showHWTests(CMenuWidget *widget) diff --git a/src/gui/test_menu.h b/src/gui/test_menu.h index 5a1b56e43..c6f30a865 100644 --- a/src/gui/test_menu.h +++ b/src/gui/test_menu.h @@ -32,7 +32,7 @@ #include #include #include -// #define TEST_MENU + #define TEST_MENU #include @@ -46,6 +46,7 @@ class CTestMenu : public CMenuTarget CComponentsForm *form; CComponentsText *txt; CComponentsHeader *header; + CComponentsIconForm *iconform; int width, selected; void showTestMenu();