本文整理汇总了C++中CGUILabelControl::SetVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUILabelControl::SetVisible方法的具体用法?C++ CGUILabelControl::SetVisible怎么用?C++ CGUILabelControl::SetVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUILabelControl
的用法示例。
在下文中一共展示了CGUILabelControl::SetVisible方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnWindowLoaded
void CGUIWindowFullScreen::OnWindowLoaded()
{
CGUIWindow::OnWindowLoaded();
// override the clear colour - we must never clear fullscreen
m_clearBackground = 0;
CGUIProgressControl* pProgress = dynamic_cast<CGUIProgressControl*>(GetControl(CONTROL_PROGRESS));
if(pProgress)
{
if( pProgress->GetInfo() == 0 || !pProgress->HasVisibleCondition())
{
pProgress->SetInfo(PLAYER_PROGRESS);
pProgress->SetVisibleCondition("player.displayafterseek");
pProgress->SetVisible(true);
}
}
CGUILabelControl* pLabel = dynamic_cast<CGUILabelControl*>(GetControl(LABEL_BUFFERING));
if(pLabel && !pLabel->HasVisibleCondition())
{
pLabel->SetVisibleCondition("player.caching");
pLabel->SetVisible(true);
}
pLabel = dynamic_cast<CGUILabelControl*>(GetControl(LABEL_CURRENT_TIME));
if(pLabel && !pLabel->HasVisibleCondition())
{
pLabel->SetVisibleCondition("player.displayafterseek");
pLabel->SetVisible(true);
pLabel->SetLabel("$INFO(VIDEOPLAYER.TIME) / $INFO(VIDEOPLAYER.DURATION)");
}
m_showCodec.Parse("player.showcodec", GetID());
}
示例2: OnWindowLoaded
void CGUIWindowFullScreen::OnWindowLoaded()
{
CGUIWindow::OnWindowLoaded();
CGUIProgressControl* pProgress = (CGUIProgressControl*)GetControl(CONTROL_PROGRESS);
if(pProgress)
{
if( pProgress->GetInfo() == 0 || pProgress->GetVisibleCondition() == 0)
{
pProgress->SetInfo(PLAYER_PROGRESS);
pProgress->SetVisibleCondition(PLAYER_DISPLAY_AFTER_SEEK, false);
pProgress->SetVisible(true);
}
}
CGUILabelControl* pLabel = (CGUILabelControl*)GetControl(LABEL_BUFFERING);
if(pLabel && pLabel->GetVisibleCondition() == 0)
{
pLabel->SetVisibleCondition(PLAYER_CACHING, false);
pLabel->SetVisible(true);
}
pLabel = (CGUILabelControl*)GetControl(LABEL_CURRENT_TIME);
if(pLabel && pLabel->GetVisibleCondition() == 0)
{
pLabel->SetVisibleCondition(PLAYER_DISPLAY_AFTER_SEEK, false);
pLabel->SetVisible(true);
pLabel->SetLabel("$INFO(VIDEOPLAYER.TIME) / $INFO(VIDEOPLAYER.DURATION)");
}
}
示例3: CreateControls
void CGUIDialogPluginSettings::CreateControls()
{
CGUISpinControlEx *pOriginalSpin = (CGUISpinControlEx*)GetControl(CONTROL_DEFAULT_SPIN);
CGUIRadioButtonControl *pOriginalRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_DEFAULT_RADIOBUTTON);
CGUIButtonControl *pOriginalButton = (CGUIButtonControl *)GetControl(CONTROL_DEFAULT_BUTTON);
CGUIImage *pOriginalImage = (CGUIImage *)GetControl(CONTROL_DEFAULT_SEPARATOR);
CGUILabelControl *pOriginalLabel = (CGUILabelControl *)GetControl(CONTROL_DEFAULT_LABEL_SEPARATOR);
if (!pOriginalSpin || !pOriginalRadioButton || !pOriginalButton || !pOriginalImage)
return;
pOriginalSpin->SetVisible(false);
pOriginalRadioButton->SetVisible(false);
pOriginalButton->SetVisible(false);
pOriginalImage->SetVisible(false);
if (pOriginalLabel)
pOriginalLabel->SetVisible(false);
// clear the category group
CGUIControlGroupList *group = (CGUIControlGroupList *)GetControl(CONTROL_AREA);
if (!group)
return;
// set our dialog heading
SET_CONTROL_LABEL(CONTROL_HEADING_LABEL, m_strHeading);
// Create our base path, used for type "fileenum" settings
CStdString basepath = "Q:\\plugins\\";
CUtil::AddFileToFolder(basepath, m_url.GetHostName(), basepath);
CUtil::AddFileToFolder(basepath, m_url.GetFileName(), basepath);
CGUIControl* pControl = NULL;
int controlId = CONTROL_START_CONTROL;
TiXmlElement *setting = m_settings.GetPluginRoot()->FirstChildElement("setting");
while (setting)
{
const char *type = setting->Attribute("type");
const char *option = setting->Attribute("option");
const char *id = setting->Attribute("id");
CStdString values;
if (setting->Attribute("values"))
values = setting->Attribute("values");
CStdString lvalues;
if (setting->Attribute("lvalues"))
lvalues = setting->Attribute("lvalues");
CStdString entries;
if (setting->Attribute("entries"))
entries = setting->Attribute("entries");
CStdString label;
if (setting->Attribute("label") && atoi(setting->Attribute("label")) > 0)
label.Format("$LOCALIZE[%s]", setting->Attribute("label"));
else
label = setting->Attribute("label");
if (type)
{
if (strcmpi(type, "text") == 0 || strcmpi(type, "ipaddress") == 0 ||
strcmpi(type, "integer") == 0 || strcmpi(type, "video") == 0 ||
strcmpi(type, "music") == 0 || strcmpi(type, "pictures") == 0 ||
strcmpi(type, "folder") == 0 || strcmpi(type, "programs") == 0 ||
strcmpi(type, "files") == 0 || strcmpi(type, "action") == 0)
{
pControl = new CGUIButtonControl(*pOriginalButton);
if (!pControl) return;
((CGUIButtonControl *)pControl)->SettingsCategorySetTextAlign(XBFONT_CENTER_Y);
((CGUIButtonControl *)pControl)->SetLabel(label);
if (id)
((CGUIButtonControl *)pControl)->SetLabel2(m_settings.Get(id));
if (option && strcmpi(option, "hidden") == 0)
((CGUIButtonControl *)pControl)->SetHidden(true);
}
else if (strcmpi(type, "bool") == 0)
{
pControl = new CGUIRadioButtonControl(*pOriginalRadioButton);
if (!pControl) return;
((CGUIRadioButtonControl *)pControl)->SetLabel(label);
((CGUIRadioButtonControl *)pControl)->SetSelected(m_settings.Get(id) == "true");
}
else if (strcmpi(type, "enum") == 0 || strcmpi(type, "labelenum") == 0)
{
vector<CStdString> valuesVec;
vector<CStdString> entryVec;
pControl = new CGUISpinControlEx(*pOriginalSpin);
if (!pControl) return;
((CGUISpinControlEx *)pControl)->SetText(label);
if (!lvalues.IsEmpty())
CUtil::Tokenize(lvalues, valuesVec, "|");
else
CUtil::Tokenize(values, valuesVec, "|");
if (!entries.IsEmpty())
CUtil::Tokenize(entries, entryVec, "|");
for (unsigned int i = 0; i < valuesVec.size(); i++)
{
int iAdd = i;
if (entryVec.size() > i)
iAdd = atoi(entryVec[i]);
if (!lvalues.IsEmpty())
//.........这里部分代码省略.........
示例4: CreateControls
void CGUIDialogAddonSettings::CreateControls()
{
FreeControls();
CGUISpinControlEx *pOriginalSpin = dynamic_cast<CGUISpinControlEx*>(GetControl(CONTROL_DEFAULT_SPIN));
CGUIRadioButtonControl *pOriginalRadioButton = dynamic_cast<CGUIRadioButtonControl *>(GetControl(CONTROL_DEFAULT_RADIOBUTTON));
CGUIButtonControl *pOriginalButton = dynamic_cast<CGUIButtonControl *>(GetControl(CONTROL_DEFAULT_BUTTON));
CGUIImage *pOriginalImage = dynamic_cast<CGUIImage *>(GetControl(CONTROL_DEFAULT_SEPARATOR));
CGUILabelControl *pOriginalLabel = dynamic_cast<CGUILabelControl *>(GetControl(CONTROL_DEFAULT_LABEL_SEPARATOR));
CGUISettingsSliderControl *pOriginalSlider = dynamic_cast<CGUISettingsSliderControl *>(GetControl(CONTROL_DEFAULT_SLIDER));
if (!m_addon || !pOriginalSpin || !pOriginalRadioButton || !pOriginalButton || !pOriginalImage
|| !pOriginalLabel || !pOriginalSlider)
return;
pOriginalSpin->SetVisible(false);
pOriginalRadioButton->SetVisible(false);
pOriginalButton->SetVisible(false);
pOriginalImage->SetVisible(false);
pOriginalLabel->SetVisible(false);
pOriginalSlider->SetVisible(false);
CGUIControlGroupList *group = dynamic_cast<CGUIControlGroupList *>(GetControl(CONTROL_SETTINGS_AREA));
if (!group)
return;
// set our dialog heading
SET_CONTROL_LABEL(CONTROL_HEADING_LABEL, m_strHeading);
CGUIControl* pControl = NULL;
int controlId = CONTROL_START_SETTING;
const TiXmlElement *setting = GetFirstSetting();
while (setting)
{
const std::string type = XMLUtils::GetAttribute(setting, "type");
const std::string id = XMLUtils::GetAttribute(setting, "id");
const std::string values = XMLUtils::GetAttribute(setting, "values");
const std::string lvalues = XMLUtils::GetAttribute(setting, "lvalues");
const std::string entries = XMLUtils::GetAttribute(setting, "entries");
const std::string defaultVal = XMLUtils::GetAttribute(setting, "default");
const std::string subsetting = XMLUtils::GetAttribute(setting, "subsetting");
const std::string label = GetString(setting->Attribute("label"), subsetting == "true");
bool bSort = XMLUtils::GetAttribute(setting, "sort") == "yes";
if (!type.empty())
{
bool isAddonSetting = false;
if (type == "text" || type == "ipaddress"
|| type == "number" || type == "video"
|| type == "audio" || type == "image"
|| type == "folder" || type == "executable"
|| type == "file" || type == "action"
|| type == "date" || type == "time"
|| type == "select" || (isAddonSetting = type == "addon"))
{
pControl = new CGUIButtonControl(*pOriginalButton);
if (!pControl) return;
((CGUIButtonControl *)pControl)->SetLabel(label);
if (!id.empty())
{
std::string value = m_settings[id];
m_buttonValues[id] = value;
// get any option to test for hidden
const std::string option = XMLUtils::GetAttribute(setting, "option");
if (option == "urlencoded")
value = CURL::Decode(value);
else if (option == "hidden")
{
std::string hiddenText;
hiddenText.append(value.size(), L'*');
((CGUIButtonControl *)pControl)->SetLabel2(hiddenText);
}
else
{
if (isAddonSetting)
((CGUIButtonControl *)pControl)->SetLabel2(GetAddonNames(value));
else if (type == "select" && !lvalues.empty())
{
vector<string> valuesVec = StringUtils::Split(lvalues, '|');
int selected = atoi(value.c_str());
if (selected >= 0 && selected < (int)valuesVec.size())
{
std::string label = m_addon->GetString(atoi(valuesVec[selected].c_str()));
if (label.empty())
label = g_localizeStrings.Get(atoi(valuesVec[selected].c_str()));
((CGUIButtonControl *)pControl)->SetLabel2(label);
}
}
else
((CGUIButtonControl *)pControl)->SetLabel2(value);
}
}
else
((CGUIButtonControl *)pControl)->SetLabel2(defaultVal);
}
else if (type == "bool" && !id.empty())
{
pControl = new CGUIRadioButtonControl(*pOriginalRadioButton);
if (!pControl) return;
((CGUIRadioButtonControl *)pControl)->SetLabel(label);
//.........这里部分代码省略.........