From d69c74c13c4d55c96d98cfc7cd78b302d09334a6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 4 Oct 2021 22:01:31 +0200 Subject: [PATCH] testmenu: add CHint demos Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6f0cac34bd8c57efdf8f7a766565fe9cb48d5626 Author: Thilo Graf Date: 2021-10-04 (Mon, 04 Oct 2021) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index b2642c63e..b0474319f 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -1010,6 +1010,23 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) DisplayInfoMessage("Info Test!"); return menu_return::RETURN_REPAINT; } + else if (actionKey == "short_hint"){ + CHint *hint = new CHint("Info Test!"); + // Set the message window outside of screen mid to demonstrate the hide behavior, + // so that the hide behavior will not be influenced by any other window or menu. + hint->setPos(10, 10); + hint->paint(); + sleep(3); + // We must call hide() or kill() explicitly, because there is no instruction of hide() inside any destructors. + // This behavior is by design. + hint->hide(); + delete hint; + return menu_return::RETURN_REPAINT; + } + else if (actionKey == "short_hint_timed"){ + ShowHintS("Info Test...", 3, true); + return menu_return::RETURN_REPAINT; + } else if (actionKey == "msgbox_alt_btn"){ CMsgBox msgBox("Variable buttontext...", "Msgbox Test"); msgBox.setShowedButtons(CMsgBox::mbNo | CMsgBox::mbYes); @@ -1327,6 +1344,9 @@ void CTestMenu::showMsgTests(CMenuWidget *widget) widget->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, "Error/Info")); widget->addItem(new CMenuForwarder("Error Message!", true, NULL, this, "msgbox_error")); widget->addItem(new CMenuForwarder("Info Message!", true, NULL, this, "msgbox_info")); + widget->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, "Short Hint")); + widget->addItem(new CMenuForwarder("Short hint!", true, NULL, this, "short_hint")); + widget->addItem(new CMenuForwarder("Short hint with timeout!", true, NULL, this, "short_hint_timed")); } void CTestMenu::showSeparatorTypes(CMenuWidget *widget)