diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index dd173dd7d..b27014f4b 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -424,8 +424,10 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else if (actionKey == "header"){ int hh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - if (header == NULL) + if (header == NULL){ header = new CComponentsHeader (100, 50, 500, hh, "Test-Header", NEUTRINO_ICON_INFO, CComponentsHeader::CC_BTN_HELP | CComponentsHeader::CC_BTN_EXIT | CComponentsHeader::CC_BTN_MENU); +// header->addHeaderButton(NEUTRINO_ICON_BUTTON_RED); + } // else //For existing instances it's recommended // //to remove old button icons before add new buttons, otherwise icons will be appended. // header->removeHeaderButtons(); @@ -434,16 +436,18 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) // header->setFrameThickness(5); // header->setColorFrame(COL_WHITE); // header->setCornerType(CORNER_TOP); + +// change text of header // header->setHeaderText("Test"); + +// add any other button icon // header->addHeaderButton(NEUTRINO_ICON_BUTTON_RED); -// header->addHeaderButton(NEUTRINO_ICON_BUTTON_HELP); -// header->addHeaderButton(NEUTRINO_ICON_BUTTON_MENU); // example to replace the text item with an image item // get text x position - int logo_x = header->getCCItem(1)->getXPos(); + int logo_x = header->getCCItem(CComponentsHeader::CC_HEADER_ITEM_TEXT)->getXPos(); // remove text item - header->removeCCItem(1); //then remove text item + header->removeCCItem(CComponentsHeader::CC_HEADER_ITEM_TEXT); //then remove text item // create picture object with the last x position of text CComponentsPicture *logo = new CComponentsPicture(logo_x, 0, 100, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(), "/share/tuxbox/neutrino/icons/hint_tvmode.png"); // set the transparent background for picture item