From 8df1cac8388557866ecc3391f34f47d54b10986b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 Oct 2012 16:52:55 +0200 Subject: [PATCH] CTestMenu: add tests for CComponentsText Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/98b1e38dfa9abb625fc58e2016fd7df94e155d59 Author: Thilo Graf Date: 2012-10-27 (Sat, 27 Oct 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 15 +++++++++++++++ src/gui/test_menu.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 636b005b7..8533cc18c 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -67,6 +67,7 @@ CTestMenu::CTestMenu() pic= NULL; pip = NULL; form = NULL; + txt = NULL; } CTestMenu::~CTestMenu() @@ -76,6 +77,7 @@ CTestMenu::~CTestMenu() delete pic; delete pip; delete form; + delete txt; } int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) @@ -375,6 +377,18 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) form->paint(); return res; } + else if (actionKey == "text"){ + if (txt == NULL) + txt = new CComponentsText(); + txt->setDimensionsAll(100, 100, 250, 100); + txt->setText("This is a text for testing textbox", CTextBox::NO_AUTO_LINEBREAK); + + if (txt->isPainted()) + txt->hide(); + else + txt->paint(); + return res; + } showTestMenu(); @@ -419,6 +433,7 @@ void CTestMenu::showCCTests(CMenuWidget *widget) widget->addItem(new CMenuForwarderNonLocalized("Picture", true, NULL, this, "picture")); widget->addItem(new CMenuForwarderNonLocalized("PiP", true, NULL, this, "pip")); widget->addItem(new CMenuForwarderNonLocalized("Form", true, NULL, this, "form")); + widget->addItem(new CMenuForwarderNonLocalized("Text", true, NULL, this, "text")); } void CTestMenu::showHWTests(CMenuWidget *widget) diff --git a/src/gui/test_menu.h b/src/gui/test_menu.h index d5abe6a51..5612952d4 100644 --- a/src/gui/test_menu.h +++ b/src/gui/test_menu.h @@ -44,6 +44,7 @@ class CTestMenu : public CMenuTarget CComponentsPicture* pic; CComponentsPIP* pip; CComponentsForm *form; + CComponentsText *txt; int width, selected; void showTestMenu();