From d8e4aa483c7d20f537e122dd905a17a3f252f244 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Jun 2013 22:02:48 +0200 Subject: [PATCH] CTestMenu: add sample code for footer buttons, disable debug spam Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fc3829d69522ee90bbc298bd627e6a52f6b968ac Author: Thilo Graf Date: 2013-06-03 (Mon, 03 Jun 2013) --- src/gui/components/cc.h | 2 +- src/gui/test_menu.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index 8f4c83210..0308cce09 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -32,7 +32,7 @@ #include #include -#define DEBUG_CC +//#define DEBUG_CC /// Basic component class. /*! diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index d0037d7d8..66b4f31fb 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -480,10 +480,11 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) 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); + int start = 5, btnw =90; + footer->addCCItem(new CComponentsButtonRed(start, 0, btnw, hh, "Button1")); + footer->addCCItem(new CComponentsButtonGreen(start+=btnw, 0, btnw, hh, "Button2")); + footer->addCCItem(new CComponentsButtonYellow(start+=btnw, 0, btnw, hh, "Button3")); + footer->addCCItem(new CComponentsButtonBlue(start+=btnw, 0, btnw, hh, "Button4")); } if (!footer->isPainted()) footer->paint();