From 7105518423f5fbdda54bb13966fa42e8b6a54d7e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 9 Sep 2012 00:31:59 +0200 Subject: [PATCH] CTestMenu: add tests for form objects --- src/gui/test_menu.cpp | 22 +++++++++++++++++++--- src/gui/test_menu.h | 1 + 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 0289d6776..636b005b7 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -66,6 +66,7 @@ CTestMenu::CTestMenu() sq = NULL; pic= NULL; pip = NULL; + form = NULL; } CTestMenu::~CTestMenu() @@ -74,6 +75,7 @@ CTestMenu::~CTestMenu() delete circle; delete pic; delete pip; + delete form; } int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) @@ -360,9 +362,22 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) pip->hide(); return res; } - + else if (actionKey == "form"){ + if (form == NULL) + form = new CComponentsForm(); + form->setDimensionsAll(100, 100, 250, 300); + form->setCaption(NONEXISTANT_LOCALE); + form->setIcon(NEUTRINO_ICON_INFO); + + if (form->isPainted()) + form->hide(); + else + form->paint(); + return res; + } + showTestMenu(); - + return res; } @@ -402,7 +417,8 @@ void CTestMenu::showCCTests(CMenuWidget *widget) widget->addItem(new CMenuForwarderNonLocalized("Circle", true, NULL, this, "circle")); widget->addItem(new CMenuForwarderNonLocalized("Square", true, NULL, this, "square")); widget->addItem(new CMenuForwarderNonLocalized("Picture", true, NULL, this, "picture")); - 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")); } void CTestMenu::showHWTests(CMenuWidget *widget) diff --git a/src/gui/test_menu.h b/src/gui/test_menu.h index fc2c651de..d5abe6a51 100644 --- a/src/gui/test_menu.h +++ b/src/gui/test_menu.h @@ -43,6 +43,7 @@ class CTestMenu : public CMenuTarget CComponentsShapeSquare* sq; CComponentsPicture* pic; CComponentsPIP* pip; + CComponentsForm *form; int width, selected; void showTestMenu();