本文整理汇总了C++中CGUIButtonControl::SetLabel2方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIButtonControl::SetLabel2方法的具体用法?C++ CGUIButtonControl::SetLabel2怎么用?C++ CGUIButtonControl::SetLabel2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIButtonControl
的用法示例。
在下文中一共展示了CGUIButtonControl::SetLabel2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
CGUIControl* ControlButton::Create()
{
CLabelInfo label;
label.font = g_fontManager.GetFont(strFont);
label.textColor = textColor;
label.disabledColor = disabledColor;
label.shadowColor = shadowColor;
label.focusedColor = focusedColor;
label.align = align;
label.offsetX = (float)textOffsetX;
label.offsetY = (float)textOffsetY;
label.angle = (float)-iAngle;
pGUIControl = new CGUIButtonControl(
iParentId,
iControlId,
(float)dwPosX,
(float)dwPosY,
(float)dwWidth,
(float)dwHeight,
CTextureInfo(strTextureFocus),
CTextureInfo(strTextureNoFocus),
label);
CGUIButtonControl* pGuiButtonControl =
(CGUIButtonControl*)pGUIControl;
pGuiButtonControl->SetLabel(strText);
pGuiButtonControl->SetLabel2(strText2);
return pGUIControl;
}
示例2: UpdateSetting
void CGUIDialogSettings::UpdateSetting(unsigned int id)
{
unsigned int settingNum = (unsigned int)-1;
for (unsigned int i = 0; i < m_settings.size(); i++)
{
if (m_settings[i].id == id)
{
settingNum = i;
break;
}
}
if(settingNum == (unsigned int)-1)
return;
SettingInfo &setting = m_settings.at(settingNum);
unsigned int controlID = settingNum + CONTROL_START;
if (setting.type == SettingInfo::SPIN)
{
CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(controlID);
if (pControl && setting.data) pControl->SetValue(*(int *)setting.data);
}
else if (setting.type == SettingInfo::CHECK)
{
CGUIRadioButtonControl *pControl = (CGUIRadioButtonControl *)GetControl(controlID);
if (pControl && setting.data) pControl->SetSelected(*(bool *)setting.data);
}
else if (setting.type == SettingInfo::CHECK_UCHAR)
{
CGUIRadioButtonControl *pControl = (CGUIRadioButtonControl *)GetControl(controlID);
if (pControl && setting.data) pControl->SetSelected(*(unsigned char*)setting.data ? true : false);
}
else if (setting.type == SettingInfo::SLIDER)
{
CGUISettingsSliderControl *pControl = (CGUISettingsSliderControl *)GetControl(controlID);
float value = *(float *)setting.data;
if (pControl && setting.data)
{
pControl->SetFloatValue(value);
if (setting.formatFunction) pControl->SetTextValue(setting.formatFunction(value, setting.interval));
}
}
else if (setting.type == SettingInfo::BUTTON_DIALOG)
{
SET_CONTROL_LABEL(controlID,setting.name);
CGUIButtonControl *pControl = (CGUIButtonControl *)GetControl(controlID);
if (pControl && setting.data) pControl->SetLabel2(*(CStdString *)setting.data);
}
else if (setting.type == SettingInfo::EDIT)
{
CGUIEditControl *pControl = (CGUIEditControl *)GetControl(controlID);
if (pControl && setting.data) pControl->SetLabel2(*(CStdString *)setting.data);
}
else if (setting.type == SettingInfo::EDIT_NUM)
{
CGUIEditControl *pControl = (CGUIEditControl *)GetControl(controlID);
if (pControl && setting.data) {
CStdString strIndex;
strIndex.Format("%i", *(int *)setting.data);
pControl->SetLabel2(strIndex);
}
}
if (setting.enabled)
{
CONTROL_ENABLE(controlID);
}
else
{
CONTROL_DISABLE(controlID);
}
}