CComponentsInfoBox: create instance of CComponentsInfoBox in constructor

This commit is contained in:
2012-08-22 10:44:29 +02:00
parent 9aa0d14d39
commit 232933f9fc

View File

@@ -325,7 +325,7 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg
frameBuffer = CFrameBuffer::getInstance(); frameBuffer = CFrameBuffer::getInstance();
iconfile = Icon; iconfile = Icon;
details_line = NULL; details_line = NULL;
info_box = NULL; info_box = new CComponentsInfoBox();
//handle select values //handle select values
if(w_index > MN_WIDGET_ID_MAX){ if(w_index > MN_WIDGET_ID_MAX){
@@ -1159,20 +1159,14 @@ void CMenuWidget::paintHint(int pos)
//init infobox //init infobox
std::string str = g_Locale->getText(item->hint); std::string str = g_Locale->getText(item->hint);
info_box->removeLineBreaks(str); if (info_box){
if (info_box == NULL) info_box->setDimensionsAll(x, ypos2, iwidth, hint_height);
info_box = new CComponentsInfoBox(x, ypos2, iwidth, hint_height, str.c_str(), CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); info_box->removeLineBreaks(str);
else{
info_box->setXPos(x);
info_box->setYPos(ypos2);
info_box->setWidth(iwidth);
info_box->setText(str, CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); info_box->setText(str, CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]);
info_box->setCornerRadius(RADIUS_LARGE);
} info_box->syncSysColors();
info_box->setCornerRadius(RADIUS_LARGE); info_box->setShadowOnOff(CC_SHADOW_ON);
info_box->syncSysColors(); info_box->setPicture(item->hintIcon);
info_box->setShadowOnOff(CC_SHADOW_ON);
info_box->setPicture(item->hintIcon);
#if 0 #if 0
/* force full paint - menu-over i.e. option chooser with pulldown can overwrite */ /* force full paint - menu-over i.e. option chooser with pulldown can overwrite */
info_box->paint(savescreen, true); info_box->paint(savescreen, true);