本文整理汇总了C++中CGUIControl::SetEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIControl::SetEnabled方法的具体用法?C++ CGUIControl::SetEnabled怎么用?C++ CGUIControl::SetEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIControl
的用法示例。
在下文中一共展示了CGUIControl::SetEnabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void CGUIControlBaseSetting::Update()
{
CGUIControl *control = GetControl();
if (control == NULL)
return;
control->SetEnabled(IsEnabled());
control->SetVisible(m_pSetting->IsVisible());
}
示例2: Update
void CGUIControlBaseSetting::Update(bool updateDisplayOnly /* = false */)
{
if (updateDisplayOnly)
return;
CGUIControl *control = GetControl();
if (control == NULL)
return;
control->SetEnabled(IsEnabled());
if (m_pSetting)
control->SetVisible(m_pSetting->IsVisible());
SetValid(true);
}
示例3: EnableButton
void CGUIDialogContextMenu::EnableButton(int iButton, bool bEnable)
{
CGUIControl *pControl = (CGUIControl *)GetControl(BUTTON_TEMPLATE + iButton);
if (pControl) pControl->SetEnabled(bEnable);
}
示例4: AddSetting
void CGUIDialogSettings::AddSetting(SettingInfo &setting, float width, int iControlID)
{
CGUIControl *pControl = NULL;
if (setting.type == SettingInfo::BUTTON_DIALOG && m_pOriginalSettingsButton)
{
pControl = new CGUIButtonControl(*m_pOriginalSettingsButton);
if (!pControl) return ;
((CGUIButtonControl *)pControl)->SetLabel(setting.name);
pControl->SetWidth(width);
if (setting.data) ((CGUIButtonControl *)pControl)->SetLabel2(*(CStdString *)setting.data);
}
else if (setting.type == SettingInfo::BUTTON && m_pOriginalSettingsButton)
{
pControl = new CGUIButtonControl(*m_pOriginalSettingsButton);
if (!pControl) return ;
((CGUIButtonControl *)pControl)->SetLabel(setting.name);
if (setting.formatFunction)
((CGUIButtonControl *)pControl)->SetLabel2(setting.formatFunction(*(float *)setting.data, setting.interval));
pControl->SetWidth(width);
}
else if (setting.type == SettingInfo::EDIT && m_pOriginalEdit)
{
pControl = new CGUIEditControl(*m_pOriginalEdit);
if (!pControl) return ;
((CGUIEditControl *)pControl)->SetLabel(setting.name);
pControl->SetWidth(width);
if (setting.data) ((CGUIEditControl *)pControl)->SetLabel2(*(CStdString *)setting.data);
}
else if (setting.type == SettingInfo::EDIT_NUM && m_pOriginalEditNum)
{
pControl = new CGUIEditControl(*m_pOriginalEditNum);
if (!pControl) return ;
((CGUIEditControl *)pControl)->SetLabel(setting.name);
pControl->SetWidth(width);
((CGUIEditControl *)pControl)->SetInputType(CGUIEditControl::INPUT_TYPE_NUMBER, 0);
if (setting.data) {
CStdString strIndex;
strIndex.Format("%i", *(int *)setting.data);
((CGUIEditControl *)pControl)->SetLabel2(strIndex);
}
}
else if (setting.type == SettingInfo::SEPARATOR && m_pOriginalSeparator)
{
pControl = new CGUIImage(*m_pOriginalSeparator);
if (!pControl) return ;
pControl->SetWidth(width);
}
else if (setting.type == SettingInfo::CHECK || setting.type == SettingInfo::CHECK_UCHAR)
{
if (!m_pOriginalRadioButton) return;
pControl = new CGUIRadioButtonControl(*m_pOriginalRadioButton);
if (!pControl) return ;
((CGUIRadioButtonControl *)pControl)->SetLabel(setting.name);
pControl->SetWidth(width);
if (setting.data) ((CGUIRadioButtonControl *)pControl)->SetSelected(*(bool *)setting.data == 1);
}
else if (setting.type == SettingInfo::SPIN && setting.entry.size() > 0 && m_pOriginalSpin)
{
pControl = new CGUISpinControlEx(*m_pOriginalSpin);
if (!pControl) return ;
pControl->SetWidth(width);
((CGUISpinControlEx *)pControl)->SetText(setting.name);
pControl->SetWidth(width);
for (unsigned int i = 0; i < setting.entry.size(); i++)
((CGUISpinControlEx *)pControl)->AddLabel(setting.entry[i].second, setting.entry[i].first);
if (setting.data) ((CGUISpinControlEx *)pControl)->SetValue(*(int *)setting.data);
}
else if (setting.type == SettingInfo::SLIDER)
{
if (!m_pOriginalSlider) return;
pControl = new CGUISettingsSliderControl(*m_pOriginalSlider);
if (!pControl) return ;
pControl->SetWidth(width);
((CGUISettingsSliderControl *)pControl)->SetText(setting.name);
if (setting.formatFunction)
((CGUISettingsSliderControl *)pControl)->SetTextValue(setting.formatFunction(*(float *)setting.data, setting.interval));
((CGUISettingsSliderControl *)pControl)->SetType(SPIN_CONTROL_TYPE_FLOAT);
((CGUISettingsSliderControl *)pControl)->SetFloatRange(setting.min, setting.max);
((CGUISettingsSliderControl *)pControl)->SetFloatInterval(setting.interval);
if (setting.data) ((CGUISettingsSliderControl *)pControl)->SetFloatValue(*(float *)setting.data);
}
if (!pControl) return;
pControl->SetID(iControlID);
pControl->SetVisible(true);
pControl->SetEnabled(setting.enabled);
CGUIControlGroupList *group = (CGUIControlGroupList *)GetControl(CONTROL_GROUP_LIST);
if (group)
{
pControl->AllocResources();
group->AddControl(pControl);
}
else
delete pControl;
}