CComponentsFooter: add new class CComponentsFooter

This commit is contained in:
2013-05-29 10:20:03 +02:00
parent 09bd2c98e9
commit e665ab18ab
6 changed files with 112 additions and 4 deletions

View File

@@ -68,6 +68,7 @@ CTestMenu::CTestMenu()
form = NULL;
txt = NULL;
header = NULL;
footer = NULL;
iconform = NULL;
window = NULL;
button = NULL;
@@ -82,6 +83,7 @@ CTestMenu::~CTestMenu()
delete form;
delete txt;
delete header;
delete footer;
delete iconform;
delete window;
delete button;
@@ -452,8 +454,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
header->setCaption("Test");
// add any other button icon
// header->addHeaderButton(NEUTRINO_ICON_BUTTON_BLUE);
// header->addHeaderButton(NEUTRINO_ICON_BUTTON_GREEN);
// header->addButton(NEUTRINO_ICON_BUTTON_BLUE);
// header->addButton(NEUTRINO_ICON_BUTTON_GREEN);
// example to replace the text item with an image item
// get text x position
@@ -474,6 +476,21 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
header->hide();
return res;
}
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, true);
CComponentsButtonRed * btnred = new CComponentsButtonRed(10, 0, 200, hh, "Red");
btnred->doPaintBg(false);
footer->addCCItem(btnred);
}
if (!footer->isPainted())
footer->paint();
else
footer->hide();
return res;
}
else if (actionKey == "iconform"){
if (iconform == NULL)
iconform = new CComponentsIconForm();
@@ -609,6 +626,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("Footer", true, NULL, this, "footer"));
widget->addItem(new CMenuForwarderNonLocalized("Icon-Form", true, NULL, this, "iconform"));
widget->addItem(new CMenuForwarderNonLocalized("Window", true, NULL, this, "window"));
}