void CBuildInfo::InitInfoItems() { //get and checkup required informations if (!HasData()) return; //ensure a clean body ccw_body->clear(); //define size and position int x_info = 10; int h_info = ccw_body->getHeight()/v_info.size(); //default height int w_info = width-2*x_info; //init info texts for(size_t i=0; i<v_info.size(); i++){ CComponentsExtTextForm *info = new CComponentsExtTextForm(10, CC_APPEND, w_info, h_info, g_Locale->getText(v_info[i].caption), v_info[i].info_text); info->setLabelAndTextFont(font); info->setTextModes(CTextBox::TOP , CTextBox::AUTO_HIGH | CTextBox::TOP | CTextBox::AUTO_LINEBREAK_NO_BREAKCHARS); info->doPaintBg(false); ccw_body->addCCItem(info); } }
//prepare distribution infos void CImageInfo::InitInfos() { InitInfoData(); //initialize container for infos if (cc_info == NULL) cc_info = new CComponentsForm(); if (!cc_info->isAdded()) cc_win->addWindowItem(cc_info); cc_info->setPos(item_offset, item_offset); //set width, use size between left border and minitv cc_info->setWidth(cc_win->getWidth() - cc_tv->getWidth() - 2*item_offset); //calculate initial height for info form cc_info->setHeight(v_info.size()*item_height); //create label and text items for (size_t i=0; i<v_info.size(); i++) { CComponentsExtTextForm *item = new CComponentsExtTextForm(1, CC_APPEND, cc_info->getWidth(), item_height, g_Locale->getText(v_info[i].caption), v_info[i].info_text); item->setLabelAndTextFont(item_font); item->setLabelWidthPercent(20); if ((i == 0) && (item->getYPos() == CC_APPEND)) item->setYPos(1); //add ext-text object to window body if (!item->isAdded()) cc_info->addCCItem(item); //add an offset before homepage and license and at the end if (v_info[i].caption == LOCALE_IMAGEINFO_CREATOR || v_info[i].caption == LOCALE_IMAGEINFO_FORUM){ CComponentsShapeSquare *spacer = new CComponentsShapeSquare(1, CC_APPEND, 1, item_offset); //spacer ist not visible! spacer->allowPaint(false); cc_info->addCCItem(spacer); //increase height of cc_info object with offset int tmp_h = cc_info->getHeight(); cc_info->setHeight(tmp_h + item_offset); } } }