当前位置: 首页>>代码示例>>C++>>正文


C++ BaseSettingControlPtr::IsDelayed方法代码示例

本文整理汇总了C++中BaseSettingControlPtr::IsDelayed方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseSettingControlPtr::IsDelayed方法的具体用法?C++ BaseSettingControlPtr::IsDelayed怎么用?C++ BaseSettingControlPtr::IsDelayed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseSettingControlPtr的用法示例。


在下文中一共展示了BaseSettingControlPtr::IsDelayed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnClick

void CGUIWindowSettingsCategory::OnClick(BaseSettingControlPtr pSettingControl)
{
  if (pSettingControl->GetSetting()->GetId() == RESET_SETTING_ID)
  {
    OnAction(CAction(ACTION_SETTINGS_RESET));
    return;
  }

  // we need to first set the delayed setting and then execute OnClick()
  // because OnClick() triggers OnSettingChanged() and there we need to
  // know if the changed setting is delayed or not
  if (pSettingControl->IsDelayed())
  {
    m_delayedSetting = pSettingControl;
    if (m_delayedTimer.IsRunning())
      m_delayedTimer.Restart();
    else
      m_delayedTimer.Start(SETTING_DELAY);

    return;
  }

  // if changing the setting fails
  // we need to restore the proper state
  if (!pSettingControl->OnClick())
    pSettingControl->Update();
}
开发者ID:alltech,项目名称:xbmc,代码行数:27,代码来源:GUIWindowSettingsCategory.cpp

示例2: OnClick

void CGUIDialogSettingsBase::OnClick(BaseSettingControlPtr pSettingControl)
{
  if (AllowResettingSettings() &&
      pSettingControl->GetSetting()->GetId() == SETTINGS_RESET_SETTING_ID)
  {
    OnAction(CAction(ACTION_SETTINGS_RESET));
    return;
  }

  // we need to first set the delayed setting and then execute OnClick()
  // because OnClick() triggers OnSettingChanged() and there we need to
  // know if the changed setting is delayed or not
  if (pSettingControl->IsDelayed())
  {
    m_delayedSetting = pSettingControl;
    // for some controls we need to update its displayed data/text before
    // OnClick() is called after the delay timer has expired because
    // otherwise the displayed value of the control does not match with
    // the user's interaction
    pSettingControl->Update(true);

    // either start or restart the delay timer which will result in a call to
    // the control's OnClick() method to update the setting's value
    if (m_delayedTimer.IsRunning())
      m_delayedTimer.Restart();
    else
      m_delayedTimer.Start(GetDelayMs());

    return;
  }

  // if changing the setting fails
  // we need to restore the proper state
  if (!pSettingControl->OnClick())
    pSettingControl->Update();
}
开发者ID:7orlum,项目名称:xbmc,代码行数:36,代码来源:GUIDialogSettingsBase.cpp


注:本文中的BaseSettingControlPtr::IsDelayed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。