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


C++ CSettingInt::SetControl方法代码示例

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


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

示例1: AddSpinner

CSettingInt* CGUIDialogSettingsManualBase::AddSpinner(CSettingGroup *group, const std::string &id, int label, int level, int value, const StaticIntegerSettingOptions &entries,
                                                      bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
{
  if (group == NULL || id.empty() || label < 0 || entries.empty() ||
      GetSetting(id) != NULL)
    return NULL;

  CSettingInt *setting = new CSettingInt(id, label, value, m_settingsManager);
  if (setting == NULL)
    return NULL;

  setting->SetControl(GetSpinnerControl("string", delayed));
  setting->SetOptions(entries);
  setSettingDetails(setting, level, visible, help);

  group->AddSetting(setting);
  return setting;
}
开发者ID:7orlum,项目名称:xbmc,代码行数:18,代码来源:GUIDialogSettingsManualBase.cpp

示例2: AddList

CSettingInt* CGUIDialogSettingsManualBase::AddList(CSettingGroup *group, const std::string &id, int label, int level, int value, IntegerSettingOptionsFiller filler,
                                                   int heading, bool visible /* = true */, int help /* = -1 */)
{
  if (group == NULL || id.empty() || label < 0 || filler == NULL ||
      GetSetting(id) != NULL)
    return NULL;

  CSettingInt *setting = new CSettingInt(id, label, value, m_settingsManager);
  if (setting == NULL)
    return NULL;

  setting->SetControl(GetListControl("integer", false, heading, false));
  setting->SetOptionsFiller(filler, this);
  setSettingDetails(setting, level, visible, help);

  group->AddSetting(setting);
  return setting;
}
开发者ID:7orlum,项目名称:xbmc,代码行数:18,代码来源:GUIDialogSettingsManualBase.cpp

示例3: AddEdit

CSettingInt* CGUIDialogSettingsManualBase::AddEdit(CSettingGroup *group, const std::string &id, int label, int level, int value,
                                                   int minimum /* = 0 */, int step /* = 1 */, int maximum /* = 0 */, bool verifyNewValue /* = false */,
                                                   int heading /* = -1 */, bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
{
  if (group == NULL || id.empty() || label < 0 ||
      GetSetting(id) != NULL)
    return NULL;

  CSettingInt *setting = new CSettingInt(id, label, value, minimum, step, maximum, m_settingsManager);
  if (setting == NULL)
    return NULL;

  setting->SetControl(GetEditControl("integer", delayed, false, verifyNewValue, heading));
  setSettingDetails(setting, level, visible, help);

  group->AddSetting(setting);
  return setting;
}
开发者ID:7orlum,项目名称:xbmc,代码行数:18,代码来源:GUIDialogSettingsManualBase.cpp

示例4: AddSlider

CSettingInt* CGUIDialogSettingsManualBase::AddSlider(CSettingGroup *group, const std::string &id, int label, int level, int value, const std::string &formatString,
                                                     int minimum, int step, int maximum, int heading /* = -1 */, bool usePopup /* = false */, bool delayed /* = false */,
                                                     bool visible /* = true */, int help /* = -1 */)
{
  if (group == NULL || id.empty() || label < 0 ||
      GetSetting(id) != NULL)
    return NULL;

  CSettingInt *setting = new CSettingInt(id, label, value, m_settingsManager);
  if (setting == NULL)
    return NULL;

  setting->SetControl(GetSliderControl("integer", delayed, heading, usePopup, -1, formatString));
  setting->SetMinimum(minimum);
  setting->SetStep(step);
  setting->SetMaximum(maximum);
  setSettingDetails(setting, level, visible, help);

  group->AddSetting(setting);
  return setting;
}
开发者ID:7orlum,项目名称:xbmc,代码行数:21,代码来源:GUIDialogSettingsManualBase.cpp

示例5: InitializeSettings

void CGUIDialogPeripheralSettings::InitializeSettings()
{
  if (m_item == NULL)
  {
    m_initialising = false;
    return;
  }

  m_initialising = true;
  bool usePopup = g_SkinInfo->HasSkinFile("DialogSlider.xml");

  CPeripheral *peripheral = g_peripherals.GetByPath(m_item->GetPath());
  if (peripheral == NULL)
  {
    CLog::Log(LOGDEBUG, "%s - no peripheral", __FUNCTION__);
    m_initialising = false;
    return;
  }

  m_settingsMap.clear();
  CGUIDialogSettingsManualBase::InitializeSettings();

  CSettingCategory *category = AddCategory("peripheralsettings", -1);
  if (category == NULL)
  {
    CLog::Log(LOGERROR, "CGUIDialogPeripheralSettings: unable to setup settings");
    return;
  }

  CSettingGroup *group = AddGroup(category);
  if (group == NULL)
  {
    CLog::Log(LOGERROR, "CGUIDialogPeripheralSettings: unable to setup settings");
    return;
  }
  
  std::vector<CSetting*> settings = peripheral->GetSettings();
  for (std::vector<CSetting*>::iterator itSetting = settings.begin(); itSetting != settings.end(); ++itSetting)
  {
    CSetting *setting = *itSetting;
    if (setting == NULL)
      continue;

    if (!setting->IsVisible())
    {
      CLog::Log(LOGDEBUG, "%s - invisible", __FUNCTION__);
      continue;
    }

    // we need to create a copy of the setting because the CSetting instances
    // are destroyed when leaving the dialog
    CSetting *settingCopy = NULL;
    switch(setting->GetType())
    {
      case SettingTypeBool:
      {
        CSettingBool *settingBool = new CSettingBool(setting->GetId(), *static_cast<CSettingBool*>(setting));
        settingBool->SetControl(GetCheckmarkControl());

        settingCopy = static_cast<CSetting*>(settingBool);
        break;
      }

      case SettingTypeInteger:
      {
        CSettingInt *intSetting = static_cast<CSettingInt*>(setting);
        if (intSetting == NULL)
          break;
        
        CSettingInt *settingInt = new CSettingInt(setting->GetId(), *intSetting);
        if (settingInt->GetOptions().empty())
          settingInt->SetControl(GetSliderControl("integer", false, -1, usePopup, -1, "%i"));
        else
          settingInt->SetControl(GetSpinnerControl("string"));

        settingCopy = static_cast<CSetting*>(settingInt);
        break;
      }

      case SettingTypeNumber:
      {
        CSettingNumber *settingNumber = new CSettingNumber(setting->GetId(), *static_cast<CSettingNumber*>(setting));
        settingNumber->SetControl(GetSliderControl("number", false, -1, usePopup, -1, "%2.2f"));

        settingCopy = static_cast<CSetting*>(settingNumber);
        break;
      }

      case SettingTypeString:
      {
        CSettingString *settingString = new CSettingString(setting->GetId(), *static_cast<CSettingString*>(setting));
        settingString->SetControl(GetEditControl("string"));

        settingCopy = static_cast<CSetting*>(settingString);
        break;
      }

      default:
        // TODO: add more types if needed
        CLog::Log(LOGDEBUG, "%s - unknown type", __FUNCTION__);
//.........这里部分代码省略.........
开发者ID:Karlson2k,项目名称:xbmc,代码行数:101,代码来源:GUIDialogPeripheralSettings.cpp


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