本文整理汇总了C++中BaseSettingControlPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseSettingControlPtr::get方法的具体用法?C++ BaseSettingControlPtr::get怎么用?C++ BaseSettingControlPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseSettingControlPtr
的用法示例。
在下文中一共展示了BaseSettingControlPtr::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMessage
//.........这里部分代码省略.........
{
// unable to go to this category - focus the previous one
SET_CONTROL_FOCUS(CONTROL_SETTINGS_START_BUTTONS + m_iCategory, 0);
return false;
}
m_iCategory = categoryIndex;
CreateSettings();
}
description = category->GetHelp();
}
else if (focusedControl >= CONTROL_SETTINGS_START_CONTROL && focusedControl < (int)(CONTROL_SETTINGS_START_CONTROL + m_settingControls.size()))
{
m_iSetting = focusedControl;
CSetting *setting = GetSettingControl(focusedControl)->GetSetting();
if (setting != NULL)
description = setting->GetHelp();
}
// set the description of the currently focused category/setting
if (description.isInteger() ||
(description.isString() && !description.empty()))
SetDescription(description);
return true;
}
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (iControl == CONTROL_SETTINGS_OKAY_BUTTON)
{
OnOkay();
Close();
return true;
}
if (iControl == CONTROL_SETTINGS_CANCEL_BUTTON)
{
OnCancel();
Close();
return true;
}
BaseSettingControlPtr control = GetSettingControl(iControl);
if (control != NULL)
OnClick(control);
break;
}
case GUI_MSG_UPDATE_ITEM:
{
if (m_delayedSetting != NULL && m_delayedSetting->GetID() == message.GetControlId())
{
// first get the delayed setting and reset its member variable
// to avoid handling the delayed setting twice in case the OnClick()
// performed later causes the window to be deinitialized (e.g. when
// changing the language)
BaseSettingControlPtr delayedSetting = m_delayedSetting;
m_delayedSetting.reset();
// if updating the setting fails and param1 has been specifically set
// we need to call OnSettingChanged() to restore a valid value in the
// setting control
if (!delayedSetting->OnClick() && message.GetParam1() != 0)
OnSettingChanged(delayedSetting->GetSetting());
return true;
}
if (message.GetControlId() >= CONTROL_SETTINGS_START_CONTROL && message.GetControlId() < (int)(CONTROL_SETTINGS_START_CONTROL + m_settingControls.size()))
{
BaseSettingControlPtr settingControl = GetSettingControl(message.GetControlId());
if (settingControl.get() != NULL && settingControl->GetSetting() != NULL)
{
settingControl->Update();
return true;
}
}
break;
}
case GUI_MSG_UPDATE:
{
if (IsActive() && HasID(message.GetSenderId()))
{
int focusedControl = GetFocusedControlID();
CreateSettings();
SET_CONTROL_FOCUS(focusedControl, 0);
}
break;
}
default:
break;
}
return CGUIDialog::OnMessage(message);
}