本文整理汇总了C++中CGUIInfoLabel::GetLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIInfoLabel::GetLabel方法的具体用法?C++ CGUIInfoLabel::GetLabel怎么用?C++ CGUIInfoLabel::GetLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIInfoLabel
的用法示例。
在下文中一共展示了CGUIInfoLabel::GetLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CFileItem
CGUIStaticItem::CGUIStaticItem(const TiXmlElement *item, int parentID) : CFileItem()
{
m_visState = false;
assert(item);
// check whether we're using the more verbose method...
const TiXmlNode *click = item->FirstChild("onclick");
if (click && click->FirstChild())
{
CGUIInfoLabel label, label2, thumb, icon;
CGUIControlFactory::GetInfoLabel(item, "label", label, parentID);
CGUIControlFactory::GetInfoLabel(item, "label2", label2, parentID);
CGUIControlFactory::GetInfoLabel(item, "thumb", thumb, parentID);
CGUIControlFactory::GetInfoLabel(item, "icon", icon, parentID);
const char *id = item->Attribute("id");
CStdString condition;
CGUIControlFactory::GetConditionalVisibility(item, condition);
SetVisibleCondition(condition, parentID);
CGUIControlFactory::GetActions(item, "onclick", m_clickActions);
SetLabel(label.GetLabel(parentID));
SetLabel2(label2.GetLabel(parentID));
SetArt("thumb", thumb.GetLabel(parentID, true));
SetIconImage(icon.GetLabel(parentID, true));
if (!label.IsConstant()) m_info.push_back(make_pair(label, "label"));
if (!label2.IsConstant()) m_info.push_back(make_pair(label2, "label2"));
if (!thumb.IsConstant()) m_info.push_back(make_pair(thumb, "thumb"));
if (!icon.IsConstant()) m_info.push_back(make_pair(icon, "icon"));
m_iprogramCount = id ? atoi(id) : 0;
// add any properties
const TiXmlElement *property = item->FirstChildElement("property");
while (property)
{
CStdString name = property->Attribute("name");
CGUIInfoLabel prop;
if (!name.empty() && CGUIControlFactory::GetInfoLabelFromElement(property, prop, parentID))
{
SetProperty(name, prop.GetLabel(parentID, true).c_str());
if (!prop.IsConstant())
m_info.push_back(make_pair(prop, name));
}
property = property->NextSiblingElement("property");
}
}
else
{
CStdString label, label2, thumb, icon;
label = item->Attribute("label"); label = CGUIControlFactory::FilterLabel(label);
label2 = item->Attribute("label2"); label2 = CGUIControlFactory::FilterLabel(label2);
thumb = item->Attribute("thumb"); thumb = CGUIControlFactory::FilterLabel(thumb);
icon = item->Attribute("icon"); icon = CGUIControlFactory::FilterLabel(icon);
const char *id = item->Attribute("id");
SetLabel(CGUIInfoLabel::GetLabel(label, parentID));
SetPath(item->FirstChild()->Value());
SetLabel2(CGUIInfoLabel::GetLabel(label2, parentID));
SetArt("thumb", CGUIInfoLabel::GetLabel(thumb, parentID, true));
SetIconImage(CGUIInfoLabel::GetLabel(icon, parentID, true));
m_iprogramCount = id ? atoi(id) : 0;
}
}
示例2: CGUIButtonControl
CGUIEditControl::CGUIEditControl(int parentID, int controlID, float posX, float posY,
float width, float height, const CTextureInfo &textureFocus, const CTextureInfo &textureNoFocus,
const CLabelInfo& labelInfo, const std::string &text, const CLabelInfo& emptylabelInfo, const std::string &emptyText, int maxTextSize)
: CGUIButtonControl(parentID, controlID, posX, posY, width, height, textureFocus, textureNoFocus, labelInfo), m_emptyLayout(emptylabelInfo.font, false)
{
ControlType = GUICONTROL_EDIT;
m_textOffset = 0;
m_textWidth = width;
m_cursorPos = 0;
m_cursorBlink = 0;
m_inputHeading = 0;
m_inputType = INPUT_TYPE_TEXT;
m_smsLastKey = 0;
m_smsKeyIndex = 0;
m_highlighted = false;
m_emptyLabelInfo = emptylabelInfo;
CGUIInfoLabel info;
info.SetLabel(emptyText,"");
CStdStringW emptyTextW;
g_charsetConverter.utf8ToW(info.GetLabel(GetParentID(), false), emptyTextW, false);
m_emptyLayout.SetText(emptyTextW);
m_maxTextSize = maxTextSize;
std::string allowedText = GetAllowedText(text);
SetLabel(allowedText);
m_addToText2Counter = -1;
}