本文整理汇总了C++中CFileItem::SetIconImage方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItem::SetIconImage方法的具体用法?C++ CFileItem::SetIconImage怎么用?C++ CFileItem::SetIconImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItem
的用法示例。
在下文中一共展示了CFileItem::SetIconImage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitWindow
void CGUIDialogAccessPoints::OnInitWindow()
{
m_wasItemSelected = false;
CGUIDialog::OnInitWindow();
CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_ACCESS_POINTS);
OnMessage(msgReset);
CStdString ifaceName(m_interfaceName);
CNetworkInterface* iface = g_application.getNetwork().GetInterfaceByName(ifaceName);
m_aps = iface->GetAccessPoints();
for (int i = 0; i < (int) m_aps.size(); i++)
{
CFileItem *item = new CFileItem(m_aps[i].getEssId());
int q = m_aps[i].getQuality();
if (q <= 20) item->SetThumbnailImage("ap-signal1.png");
else if (q <= 40) item->SetThumbnailImage("ap-signal2.png");
else if (q <= 60) item->SetThumbnailImage("ap-signal3.png");
else if (q <= 80) item->SetThumbnailImage("ap-signal4.png");
else if (q <= 100) item->SetThumbnailImage("ap-signal5.png");
if (m_aps[i].getEncryptionMode() != ENC_NONE)
item->SetIconImage("ap-lock.png");
CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_ACCESS_POINTS, 0, 0, item);
OnMessage(msg);
}
CFileItem *item = new CFileItem(g_localizeStrings.Get(1047));
CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_ACCESS_POINTS, 0, 0, item);
OnMessage(msg);
}
示例2: LoadContent
void CGUIBaseContainer::LoadContent(TiXmlElement *content)
{
TiXmlElement *root = content->FirstChildElement("content");
if (!root)
return;
g_SkinInfo.ResolveIncludes(root);
m_staticContent = true;
TiXmlElement *item = root->FirstChildElement("item");
while (item)
{
// format:
// <item label="Cool Video" label2="" thumb="q:\userdata\thumbnails\video\04385918.tbn">PlayMedia(c:\videos\cool_video.avi)</item>
// <item label="My Album" label2="" thumb="q:\userdata\thumbnails\music\0\04385918.tbn">ActivateWindow(MyMusic,c:\music\my album)</item>
// <item label="Apple Movie Trailers" label2="Bob" thumb="q:\userdata\thumbnails\programs\04385918.tbn">RunScript(q:\scripts\apple movie trailers\default.py)</item>
// OR the more verbose, but includes-friendly:
// <item>
// <label>blah</label>
// <label2>foo</label2>
// <thumb>bar.png</thumb>
// <icon>foo.jpg</icon>
// <onclick>ActivateWindow(Home)</onclick>
// </item>
g_SkinInfo.ResolveIncludes(item);
if (item->FirstChild())
{
CFileItem *newItem = NULL;
// check whether we're using the more verbose method...
TiXmlNode *click = item->FirstChild("onclick");
if (click && click->FirstChild())
{
CStdString label, label2, thumb, icon;
XMLUtils::GetString(item, "label", label);
XMLUtils::GetString(item, "label2", label2);
XMLUtils::GetString(item, "thumb", thumb);
XMLUtils::GetString(item, "icon", icon);
const char *id = item->Attribute("id");
int visibleCondition = 0;
CGUIControlFactory::GetConditionalVisibility(item, visibleCondition);
newItem = new CFileItem(CGUIControlFactory::FilterLabel(label));
// multiple action strings are concat'd together, separated with " , "
vector<CStdString> actions;
CGUIControlFactory::GetMultipleString(item, "onclick", actions);
for (vector<CStdString>::iterator it = actions.begin(); it != actions.end(); ++it)
(*it).Replace(",", ",,");
StringUtils::JoinString(actions, " , ", newItem->m_strPath);
newItem->SetLabel2(CGUIControlFactory::FilterLabel(label2));
newItem->SetThumbnailImage(thumb);
newItem->SetIconImage(icon);
if (id) newItem->m_iprogramCount = atoi(id);
newItem->m_idepth = visibleCondition;
}
else
{
const char *label = item->Attribute("label");
const char *label2 = item->Attribute("label2");
const char *thumb = item->Attribute("thumb");
const char *icon = item->Attribute("icon");
const char *id = item->Attribute("id");
newItem = new CFileItem(label ? CGUIControlFactory::FilterLabel(label) : "");
newItem->m_strPath = item->FirstChild()->Value();
if (label2) newItem->SetLabel2(CGUIControlFactory::FilterLabel(label2));
if (thumb) newItem->SetThumbnailImage(thumb);
if (icon) newItem->SetIconImage(icon);
if (id) newItem->m_iprogramCount = atoi(id);
newItem->m_idepth = 0; // no visibility condition
}
m_staticItems.push_back(newItem);
}
item = item->NextSiblingElement("item");
}
// and make sure m_items is setup initially as well, so that initial item selection works as expected
UpdateVisibility();
return;
}
示例3: Update
void CGUIWindowVideoInfo::Update()
{
CStdString strTmp;
strTmp = m_movieItem->GetVideoInfoTag()->m_strTitle; strTmp.Trim();
SetLabel(CONTROL_TITLE, strTmp);
strTmp = m_movieItem->GetVideoInfoTag()->m_strDirector; strTmp.Trim();
SetLabel(CONTROL_DIRECTOR, strTmp);
strTmp = m_movieItem->GetVideoInfoTag()->m_strStudio; strTmp.Trim();
SetLabel(CONTROL_STUDIO, strTmp);
strTmp = m_movieItem->GetVideoInfoTag()->m_strWritingCredits; strTmp.Trim();
SetLabel(CONTROL_CREDITS, strTmp);
strTmp = m_movieItem->GetVideoInfoTag()->m_strGenre; strTmp.Trim();
SetLabel(CONTROL_GENRE, strTmp);
strTmp = m_movieItem->GetVideoInfoTag()->m_strTagLine; strTmp.Trim();
SetLabel(CONTROL_TAGLINE, strTmp);
strTmp = m_movieItem->GetVideoInfoTag()->m_strPlotOutline; strTmp.Trim();
SetLabel(CONTROL_PLOTOUTLINE, strTmp);
strTmp = m_movieItem->GetVideoInfoTag()->m_strTrailer; strTmp.Trim();
SetLabel(CONTROL_TRAILER, strTmp);
strTmp = m_movieItem->GetVideoInfoTag()->m_strMPAARating; strTmp.Trim();
SetLabel(CONTROL_MPAARATING, strTmp);
CStdString strTop250;
if (m_movieItem->GetVideoInfoTag()->m_iTop250)
strTop250.Format("%i", m_movieItem->GetVideoInfoTag()->m_iTop250);
SetLabel(CONTROL_TOP250, strTop250);
CStdString strYear;
if (m_movieItem->GetVideoInfoTag()->m_iYear)
strYear.Format("%i", m_movieItem->GetVideoInfoTag()->m_iYear);
else
strYear = g_infoManager.GetItemLabel(m_movieItem,LISTITEM_PREMIERED);
SetLabel(CONTROL_YEAR, strYear);
CStdString strRating_And_Votes;
if (m_movieItem->GetVideoInfoTag()->m_fRating != 0.0f) // only non-zero ratings are of interest
strRating_And_Votes.Format("%03.1f (%s %s)", m_movieItem->GetVideoInfoTag()->m_fRating, m_movieItem->GetVideoInfoTag()->m_strVotes, g_localizeStrings.Get(20350));
SetLabel(CONTROL_RATING_AND_VOTES, strRating_And_Votes);
strTmp = m_movieItem->GetVideoInfoTag()->m_strRuntime; strTmp.Trim();
SetLabel(CONTROL_RUNTIME, strTmp);
// setup plot text area
strTmp = m_movieItem->GetVideoInfoTag()->m_strPlot;
if (!(!m_movieItem->GetVideoInfoTag()->m_strShowTitle.IsEmpty() && m_movieItem->GetVideoInfoTag()->m_iSeason == 0)) // dont apply to tvshows
if (m_movieItem->GetVideoInfoTag()->m_playCount == 0 && g_guiSettings.GetBool("videolibrary.hideplots"))
strTmp = g_localizeStrings.Get(20370);
strTmp.Trim();
SetLabel(CONTROL_TEXTAREA, strTmp);
// setup cast list + determine type
ClearCastList();
if (!m_movieItem->GetVideoInfoTag()->m_strArtist.IsEmpty())
{ // music video
CStdStringArray artists;
StringUtils::SplitString(m_movieItem->GetVideoInfoTag()->m_strArtist, g_advancedSettings.m_videoItemSeparator, artists);
for (std::vector<CStdString>::const_iterator it = artists.begin(); it != artists.end(); ++it)
{
CFileItem *item = new CFileItem(*it);
if (CFile::Exists(item->GetCachedArtistThumb()))
item->SetThumbnailImage(item->GetCachedArtistThumb());
item->SetIconImage("DefaultArtist.png");
m_castList->Add(item);
}
m_castList->SetContent("musicvideos");
}
else
{ // movie/show/episode
for (CVideoInfoTag::iCast it = m_movieItem->GetVideoInfoTag()->m_cast.begin(); it != m_movieItem->GetVideoInfoTag()->m_cast.end(); ++it)
{
CStdString character;
if (it->strRole.IsEmpty())
character = it->strName;
else
character.Format("%s %s %s", it->strName.c_str(), g_localizeStrings.Get(20347).c_str(), it->strRole.c_str());
CFileItem *item = new CFileItem(it->strName);
if (CFile::Exists(item->GetCachedActorThumb()))
item->SetThumbnailImage(item->GetCachedActorThumb());
item->SetIconImage("DefaultActor.png");
item->SetLabel(character);
m_castList->Add(item);
}
// determine type:
if (m_movieItem->m_bIsFolder)
m_castList->SetContent("tvshows");
else if (m_movieItem->GetVideoInfoTag()->m_iSeason > -1)
m_castList->SetContent("episodes");
else
m_castList->SetContent("movies");
}
CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST, 0, 0, m_castList);
//.........这里部分代码省略.........