CTextMenu: add sample code for CComponentsHeader

Origin commit data
------------------
Branch: ni/coolstream
Commit: e4c4a33477
Author: Thilo Graf <dbt@novatux.de>
Date: 2012-11-04 (Sun, 04 Nov 2012)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
2012-11-04 17:21:41 +01:00
parent dd19f97b42
commit ccbfa90c05
2 changed files with 14 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ CTestMenu::CTestMenu()
pip = NULL; pip = NULL;
form = NULL; form = NULL;
txt = NULL; txt = NULL;
header = NULL;
} }
CTestMenu::~CTestMenu() CTestMenu::~CTestMenu()
@@ -78,6 +79,7 @@ CTestMenu::~CTestMenu()
delete pip; delete pip;
delete form; delete form;
delete txt; delete txt;
delete header;
} }
int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
@@ -414,6 +416,16 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
txt->paint(); txt->paint();
return res; return res;
} }
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);
if (!header->isPainted())
header->paint();
else
header->hide();
return res;
}
showTestMenu(); showTestMenu();
@@ -459,6 +471,7 @@ void CTestMenu::showCCTests(CMenuWidget *widget)
widget->addItem(new CMenuForwarderNonLocalized("PiP", true, NULL, this, "pip")); widget->addItem(new CMenuForwarderNonLocalized("PiP", true, NULL, this, "pip"));
widget->addItem(new CMenuForwarderNonLocalized("Form", true, NULL, this, "form")); widget->addItem(new CMenuForwarderNonLocalized("Form", true, NULL, this, "form"));
widget->addItem(new CMenuForwarderNonLocalized("Text", true, NULL, this, "text")); widget->addItem(new CMenuForwarderNonLocalized("Text", true, NULL, this, "text"));
widget->addItem(new CMenuForwarderNonLocalized("Header", true, NULL, this, "header"));
} }
void CTestMenu::showHWTests(CMenuWidget *widget) void CTestMenu::showHWTests(CMenuWidget *widget)

View File

@@ -45,6 +45,7 @@ class CTestMenu : public CMenuTarget
CComponentsPIP* pip; CComponentsPIP* pip;
CComponentsForm *form; CComponentsForm *form;
CComponentsText *txt; CComponentsText *txt;
CComponentsHeader *header;
int width, selected; int width, selected;
void showTestMenu(); void showTestMenu();