diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 6f86c142d..1f6630980 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -107,8 +107,10 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const void CComponentsFooter::setButtonLabels(const struct button_label_cc * const content, const size_t& label_count, const int& chain_width, const int& label_width) { /* clean up before init */ - if (btn_container) - btn_container->clear(); + if (btn_container){ + removeCCItem(btn_container); + btn_container = NULL; + } if (label_count == 0) return; diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index f580d16f3..a86ca5daa 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -743,10 +743,12 @@ void CInfoViewerBB::paint_ca_icon(int caid, const char *icon, int &icon_space_of int py = g_InfoViewer->BoxEndY + OFFSET_INNER_SMALL; int px = 0; static std::map > icon_map; + const int icon_space = OFFSET_INNER_SMALL, icon_number = 12; static int icon_offset[icon_number] = {0,0,0,0,0,0,0,0,0,0,0,0}; static int icon_sizeW [icon_number] = {0,0,0,0,0,0,0,0,0,0,0,0}; + static bool init_flag = false; if (!init_flag) { diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 4d1e6fb5b..6229825f6 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -975,6 +975,22 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) DisplayInfoMessage("Info Test!"); return menu_return::RETURN_REPAINT; } + else if (actionKey == "msgbox_alt_btn"){ + CMsgBox msgBox("Variable buttontext...", "Msgbox Test"); + msgBox.setShowedButtons(CMsgBox::mbNo | CMsgBox::mbYes); + msgBox.setButtonText(CMsgBox::mbNo, "Left Button"); + msgBox.setButtonText(CMsgBox::mbYes, "Right Button"); + msgBox.paint(); + res = msgBox.exec(); + msgBox.hide(); + + std::string msg_txt = "Return value of MsgBox test is "; + msg_txt += to_string(msgBox.getResult()); + + ShowHint("MsgBox test returns", msg_txt.c_str(), 700, 10, NULL, NULL, CComponentsHeader::CC_BTN_EXIT); + + return res; + } else if (actionKey == "footer_key"){ CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, "Footer-Key pressed. Press EXIT to return", 350, NULL, NULL, CComponentsHeader::CC_BTN_EXIT); hintBox.setTimeOut(15); @@ -1229,6 +1245,7 @@ void CTestMenu::showMsgTests(CMenuWidget *widget) { widget->addIntroItems(); widget->addItem(new CMenuForwarder("HintBox test!", true, NULL, this, "hintbox_test")); + widget->addItem(new CMenuForwarder("Other buttontext", true, NULL, this, "msgbox_alt_btn")); widget->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, "MsgBox")); widget->addItem(new CMenuForwarder("cancel on timeout", true, NULL, this, "msgbox_test_cancel_timeout")); widget->addItem(new CMenuForwarder("yes no", true, NULL, this, "msgbox_test_yes_no"));