CTestMenu: add sample code for CComponentsExtTextForm

Origin commit data
------------------
Branch: ni/coolstream
Commit: 29abd4f1dd
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-11-01 (Fri, 01 Nov 2013)


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

------------------
This commit was generated by Migit
This commit is contained in:
2013-11-01 22:21:43 +01:00
parent df7394dcf6
commit 773d347377
2 changed files with 19 additions and 1 deletions

View File

@@ -73,6 +73,7 @@ CTestMenu::CTestMenu()
window = NULL; window = NULL;
button = NULL; button = NULL;
clock = clock_r = NULL; clock = clock_r = NULL;
text_ext = NULL;
} }
CTestMenu::~CTestMenu() CTestMenu::~CTestMenu()
@@ -90,6 +91,7 @@ CTestMenu::~CTestMenu()
delete clock; delete clock;
delete clock_r; delete clock_r;
delete chnl_pic; delete chnl_pic;
delete text_ext;
} }
static int test_pos[4] = { 130, 192, 282, 360 }; static int test_pos[4] = { 130, 192, 282, 360 };
@@ -465,8 +467,22 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
txt->paint(); txt->paint();
return res; return res;
} }
else if (actionKey == "text_ext"){
if (text_ext == NULL)
text_ext = new CComponentsExtTextForm();
text_ext->setDimensionsAll(10, 20, 300, 48);
text_ext->setLabelAndText("Label", "Text for demo", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]);
text_ext->setFrameThickness(2);
// text_ext->setLabelWidthPercent(15/*%*/);
if (text_ext->isPainted())
text_ext->hide();
else
text_ext->paint();
return res;
}
else if (actionKey == "header"){ else if (actionKey == "header"){
int hh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); int hh = 30;//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 = 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); // header->addHeaderButton(NEUTRINO_ICON_BUTTON_RED);
@@ -680,6 +696,7 @@ void CTestMenu::showCCTests(CMenuWidget *widget)
widget->addItem(new CMenuForwarderNonLocalized("Footer", true, NULL, this, "footer")); widget->addItem(new CMenuForwarderNonLocalized("Footer", true, NULL, this, "footer"));
widget->addItem(new CMenuForwarderNonLocalized("Icon-Form", true, NULL, this, "iconform")); widget->addItem(new CMenuForwarderNonLocalized("Icon-Form", true, NULL, this, "iconform"));
widget->addItem(new CMenuForwarderNonLocalized("Window", true, NULL, this, "window")); widget->addItem(new CMenuForwarderNonLocalized("Window", true, NULL, this, "window"));
widget->addItem(new CMenuForwarderNonLocalized("Text-Extended", true, NULL, this, "text_ext"));
} }
void CTestMenu::showHWTests(CMenuWidget *widget) void CTestMenu::showHWTests(CMenuWidget *widget)

View File

@@ -52,6 +52,7 @@ class CTestMenu : public CMenuTarget
CComponentsButton *button; CComponentsButton *button;
CComponentsFrmClock *clock ,*clock_r; CComponentsFrmClock *clock ,*clock_r;
CComponentsChannelLogo* chnl_pic; CComponentsChannelLogo* chnl_pic;
CComponentsExtTextForm* text_ext;
int width, selected; int width, selected;
int showTestMenu(); int showTestMenu();