当前位置: 首页>>代码示例>>C++>>正文


C++ CGUIInfoLabel类代码示例

本文整理汇总了C++中CGUIInfoLabel的典型用法代码示例。如果您正苦于以下问题:C++ CGUIInfoLabel类的具体用法?C++ CGUIInfoLabel怎么用?C++ CGUIInfoLabel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CGUIInfoLabel类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
  }
}
开发者ID:Anankin,项目名称:xbmc,代码行数:60,代码来源:GUIStaticItem.cpp

示例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;
}
开发者ID:DakaiTV,项目名称:DakaiBoxee,代码行数:29,代码来源:GUIEditControl.cpp

示例3: GetInfoLabelFromElement

bool CGUIControlFactory::GetInfoLabelFromElement(const TiXmlElement *element, CGUIInfoLabel &infoLabel, int parentID)
{
  if (!element || !element->FirstChild())
    return false;

  CStdString label = element->FirstChild()->Value();
  if (label.IsEmpty() || label == "-")
    return false;

  CStdString fallback = element->Attribute("fallback");
  if (StringUtils::IsNaturalNumber(label))
    label = g_localizeStrings.Get(atoi(label));
  else // we assume the skin xml's aren't encoded as UTF-8
    g_charsetConverter.unknownToUTF8(label);
  if (StringUtils::IsNaturalNumber(fallback))
    fallback = g_localizeStrings.Get(atoi(fallback));
  else
    g_charsetConverter.unknownToUTF8(fallback);
  infoLabel.SetLabel(label, fallback, parentID);
  return true;
}
开发者ID:Micromax-56,项目名称:xbmc,代码行数:21,代码来源:GUIControlFactory.cpp

示例4: GetType

CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlElement* pControlNode, bool insideContainer)
{
  // get the control type
  CStdString strType = GetType(pControlNode);
  CGUIControl::GUICONTROLTYPES type = TranslateControlType(strType);

  int id = 0;
  float posX = 0, posY = 0;
  float width = 0, height = 0;
  float minHeight = 0, minWidth = 0;

  CGUIAction leftActions, rightActions, upActions, downActions, backActions, nextActions, prevActions;

  int pageControl = 0;
  CGUIInfoColor colorDiffuse(0xFFFFFFFF);
  int defaultControl = 0;
  bool  defaultAlways = false;
  CStdString strTmp;
  int singleInfo = 0;
  CStdString strLabel;
  int iUrlSet=0;
  CStdString toggleSelect;

  float spinWidth = 16;
  float spinHeight = 16;
  float spinPosX = 0, spinPosY = 0;
  float checkWidth = 0, checkHeight = 0;
  CStdString strSubType;
  int iType = SPIN_CONTROL_TYPE_TEXT;
  int iMin = 0;
  int iMax = 100;
  int iInterval = 1;
  float fMin = 0.0f;
  float fMax = 1.0f;
  float fInterval = 0.1f;
  bool bReverse = true;
  bool bReveal = false;
  CTextureInfo textureBackground, textureLeft, textureRight, textureMid, textureOverlay;
  CTextureInfo textureNib, textureNibFocus, textureBar, textureBarFocus;
  CTextureInfo textureLeftFocus, textureRightFocus;
  CTextureInfo textureUp, textureDown;
  CTextureInfo textureUpFocus, textureDownFocus;
  CTextureInfo texture, borderTexture;
  CGUIInfoLabel textureFile;
  CTextureInfo textureCheckMark, textureCheckMarkNF;
  CTextureInfo textureFocus, textureNoFocus;
  CTextureInfo textureAltFocus, textureAltNoFocus;
  CTextureInfo textureRadioOn, textureRadioOff;
  CTextureInfo imageNoFocus, imageFocus;
  CGUIInfoLabel texturePath;
  CRect borderSize;

  float sliderWidth = 150, sliderHeight = 16;
  CPoint offset;

  bool bHasPath = false;
  CGUIAction clickActions;
  CGUIAction altclickActions;
  CGUIAction focusActions;
  CGUIAction unfocusActions;
  CGUIAction textChangeActions;
  CStdString strTitle = "";
  CStdString strRSSTags = "";

  float buttonGap = 5;
  int iMovementRange = 0;
  CAspectRatio aspect;
#ifdef PRE_SKIN_VERSION_9_10_COMPATIBILITY
  if (insideContainer)  // default for inside containers is keep
    aspect.ratio = CAspectRatio::AR_KEEP;
#endif

  CStdString allowHiddenFocus;
  CStdString enableCondition;

  vector<CAnimation> animations;

  bool bScrollLabel = false;
  bool bPulse = true;
  unsigned int timePerImage = 0;
  unsigned int fadeTime = 0;
  unsigned int timeToPauseAtEnd = 0;
  bool randomized = false;
  bool loop = true;
  bool wrapMultiLine = false;
  ORIENTATION orientation = VERTICAL;
  bool showOnePage = true;
  bool scrollOut = true;
  int preloadItems = 0;

  CLabelInfo labelInfo;
  CLabelInfo spinInfo;

  CGUIInfoColor textColor3;
  CGUIInfoColor headlineColor;

  float radioWidth = 0;
  float radioHeight = 0;
  float radioPosX = 0;
  float radioPosY = 0;
//.........这里部分代码省略.........
开发者ID:Micromax-56,项目名称:xbmc,代码行数:101,代码来源:GUIControlFactory.cpp

示例5: CGUIInfoLabel

CGUIListItemLayout::CListBase *CGUIListItemLayout::CreateItem(TiXmlElement *child)
{
  // resolve any <include> tag's in this control
  g_SkinInfo.ResolveIncludes(child);

  // grab the type...
  CStdString type = CGUIControlFactory::GetType(child);

  // resolve again with strType set so that <default> tags are added
  g_SkinInfo.ResolveIncludes(child, type);

  float posX = 0;
  float posY = 0;
  float width = 10;
  float height = 10;
  CStdString infoString;
  CImage image, borderImage;
  CImage imageFocus, imageNoFocus;
  FRECT borderSize = { 0, 0, 0, 0 };
  CLabelInfo label;
  CGUIControlFactory::GetFloat(child, "posx", posX);
  CGUIControlFactory::GetFloat(child, "posy", posY);
  CGUIControlFactory::GetFloat(child, "width", width);
  CGUIControlFactory::GetFloat(child, "height", height);
  XMLUtils::GetString(child, "info", infoString);
  CGUIControlFactory::GetInfoColor(child, "textcolor", label.textColor);
  CGUIControlFactory::GetInfoColor(child, "selectedcolor", label.selectedColor);
  CGUIControlFactory::GetInfoColor(child, "shadowcolor", label.shadowColor);
  CGUIControlFactory::GetInfoColor(child, "focusedcolor", label.focusedColor);
  CStdString fontName;
  XMLUtils::GetString(child, "font", fontName);
  label.font = g_fontManager.GetFont(fontName);
  CGUIControlFactory::GetTexture(child, "texture", image);
  // reset the info file for this image as we want to handle the updating
  // when items change, rather than every frame
  if (!image.file.IsConstant())
    image.file = CGUIInfoLabel("");
  // and get the <info> tag for this as well if available (GetTexture doesn't handle <info>)
  CGUIInfoLabel infoTexture;
  CGUIControlFactory::GetInfoLabel(child, "texture", infoTexture);
  CGUIControlFactory::GetTexture(child, "texturefocus", imageFocus);
  CGUIControlFactory::GetTexture(child, "texturenofocus", imageNoFocus);
  CGUIControlFactory::GetAlignment(child, "align", label.align);
  FRECT rect = { posX, posY, width, height };
  vector<CAnimation> animations;
  CGUIControlFactory::GetAnimations(child, rect, animations);
  CGUIInfoColor colorDiffuse(0xffffffff);
  CGUIControlFactory::GetInfoColor(child, "colordiffuse", colorDiffuse);
  DWORD alignY = 0;
  if (CGUIControlFactory::GetAlignmentY(child, "aligny", alignY))
    label.align |= alignY;
  CGUIInfoLabel infoLabel;
  CGUIControlFactory::GetInfoLabel(child, "label", infoLabel);
  CGUIImage::CAspectRatio aspectRatio(CGUIImage::CAspectRatio::AR_KEEP);
  CGUIControlFactory::GetAspectRatio(child, "aspectratio", aspectRatio);
  int visibleCondition = 0;
  CGUIControlFactory::GetConditionalVisibility(child, visibleCondition);
  XMLUtils::GetFloat(child, "angle", label.angle); label.angle *= -1;
  bool scroll(false);
  XMLUtils::GetBoolean(child, "scroll", scroll);
  CGUIControlFactory::GetTexture(child, "bordertexture", borderImage);
  CStdString borderStr;
  if (XMLUtils::GetString(child, "bordersize", borderStr))
    CGUIControlFactory::GetRectFromString(borderStr, borderSize);
  if (type == "label")
  { // info label
    return new CListLabel(posX, posY, width, height, visibleCondition, label, scroll, infoLabel, animations);
  }
  else if (type == "multiselect")
  {
    return new CListSelectLabel(posX, posY, width, height, visibleCondition, imageFocus, imageNoFocus, label, infoLabel, animations);
  }
  else if (type == "image")
  {
    if (!infoTexture.IsConstant())
      return new CListImage(posX, posY, width, height, visibleCondition, image, borderImage, borderSize, aspectRatio, colorDiffuse, infoTexture, animations);
    else
    {
      // Due to old behaviour, we force aspectratio to stretch here
      aspectRatio.ratio = CGUIImage::CAspectRatio::AR_STRETCH;
      return new CListTexture(posX, posY, width, height, visibleCondition, image, borderImage, borderSize, aspectRatio, colorDiffuse, animations);
    }
  }
  return NULL;
}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:85,代码来源:GUIListItemLayout.cpp


注:本文中的CGUIInfoLabel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。