From b250ae6b9d906dcc711cb1df2c3ba6be5e4d6932 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Feb 2017 10:35:20 +0100 Subject: [PATCH] CTestMenu: ad samples for progress window --- src/gui/test_menu.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 060e7858b..54f6af3e4 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -50,6 +50,7 @@ #include #include +#include #include #include #include @@ -836,6 +837,26 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } return res; } + else if (actionKey == "progress_window"){ + CProgressWindow progress0("Progress Single Test"); + progress0.paint(); + size_t max = 10; + for(size_t i = 0; i< max; i++){ + progress0.showStatus(i, max, to_string(i)); + sleep(1); + } + progress0.hide(); + + CProgressWindow progress1("Progress Local/Global Test"); + progress1.paint(); + for(size_t i = 0; i< max; i++){ + progress1.showLocalStatus(i, max, to_string(i)); + progress1.showGlobalStatus(i, max, to_string(i)); + sleep(1); + } + progress1.hide(); + return menu_return::RETURN_REPAINT; + } else if (actionKey == "hintbox_test") { ShowHint("Testmenu: Hintbox popup test", "Test for HintBox,\nPlease press any key or wait some seconds! ...", 700, 10, NULL, NEUTRINO_ICON_HINT_IMAGEINFO, CComponentsHeader::CC_BTN_EXIT); @@ -1080,6 +1101,7 @@ int CTestMenu::showTestMenu() void CTestMenu::showCCTests(CMenuWidget *widget) { widget->addIntroItems(); + widget->addItem(new CMenuForwarder("Progress Window", true, NULL, this, "progress_window")); widget->addItem(new CMenuForwarder("Running Clock", true, NULL, this, "running_clock")); widget->addItem(new CMenuForwarder("Clock", true, NULL, this, "clock")); widget->addItem(new CMenuForwarder("Button", true, NULL, this, "button"));