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


C++ CGUISpinControlEx::GetValue方法代码示例

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


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

示例1: OnProtocolChange

void CGUIDialogNetworkSetup::OnProtocolChange()
{
  CGUISpinControlEx *pSpin = (CGUISpinControlEx *)GetControl(CONTROL_PROTOCOL);
  if (!pSpin)
    return;
  m_protocol = (NET_PROTOCOL)pSpin->GetValue();
  // set defaults for the port
  if (m_protocol == NET_PROTOCOL_FTP)
    m_port = "21";
  else if (m_protocol == NET_PROTOCOL_HTTP || 
	   m_protocol == NET_PROTOCOL_RSS || 
	   m_protocol == NET_PROTOCOL_TUXBOX || 
	   m_protocol == NET_PROTOCOL_DAV)
    m_port = "80";
  else if (m_protocol == NET_PROTOCOL_HTTPS || m_protocol == NET_PROTOCOL_DAVS)
    m_port = "443";
  else if (m_protocol == NET_PROTOCOL_DAAP)
    m_port = "3689";
  else if (m_protocol == NET_PROTOCOL_HTSP)
    m_port = "9982";
  else if (m_protocol == NET_PROTOCOL_VTP)
    m_port = "2004";
  else if (m_protocol == NET_PROTOCOL_MYTH)
    m_port = "6543";
  else if (m_protocol == NET_PROTOCOL_SFTP)
    m_port = "22";
  else
    m_port = "0";

  UpdateButtons();
}
开发者ID:Alxandr,项目名称:spotyxbmc2,代码行数:31,代码来源:GUIDialogNetworkSetup.cpp

示例2: UpdateChannelSpin

void CGUIDialogPVRGuideSearch::UpdateChannelSpin(void)
{
  CGUISpinControlEx *pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_CHANNELS);
  CGUISpinControlEx *pSpinGroups = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_GROUPS);
  if (!pSpin || !pSpinGroups)
    return;

  int iChannelGroup = pSpin->GetValue();

  pSpin->Clear();
  pSpin->AddLabel(g_localizeStrings.Get(19217), EPG_SEARCH_UNSET);

  int iGroupId = (iChannelGroup == EPG_SEARCH_UNSET) ?
      XBMC_INTERNAL_GROUP_TV :
      iChannelGroup;
  CPVRChannelGroupPtr group = g_PVRChannelGroups->GetByIdFromAll(iGroupId);
  if (!group)
    group = g_PVRChannelGroups->GetGroupAllTV();

  for (int iChannelPtr = 0; iChannelPtr < group->Size(); iChannelPtr++)
  {
    CFileItemPtr channel = group->GetByIndex(iChannelPtr);
    if (!channel || !channel->HasPVRChannelInfoTag())
      continue;

    int iChannelNumber = group->GetChannelNumber(*channel->GetPVRChannelInfoTag());
    pSpin->AddLabel(channel->GetPVRChannelInfoTag()->ChannelName().c_str(), iChannelNumber);
  }
}
开发者ID:OV3RDOSE,项目名称:xbmc,代码行数:29,代码来源:GUIDialogPVRGuideSearch.cpp

示例3: OnClick

void CGUIDialogSettings::OnClick(int iID)
{
  if (iID == CONTROL_OKAY_BUTTON)
  {
    OnOkay();
    Close();
    return;
  }
  if (iID == CONTROL_CANCEL_BUTTON)
  {
    OnCancel();
    Close();
    return;
  }
  unsigned int settingNum = iID - CONTROL_START;
  if (settingNum >= m_settings.size()) return;
  SettingInfo &setting = m_settings.at(settingNum);
  if (setting.type == SettingInfo::SPIN)
  {
    CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(iID);
    if (setting.data) *(int *)setting.data = pControl->GetValue();
  }
  else if (setting.type == SettingInfo::CHECK)
  {
    CGUIRadioButtonControl *pControl = (CGUIRadioButtonControl *)GetControl(iID);
    if (setting.data) *(bool *)setting.data = pControl->IsSelected();
  }
  else if (setting.type == SettingInfo::CHECK_UCHAR)
  {
    CGUIRadioButtonControl *pControl = (CGUIRadioButtonControl *)GetControl(iID);
    if (setting.data) *(unsigned char*)setting.data = pControl->IsSelected() ? 1 : 0;
  }
  else if (setting.type == SettingInfo::SLIDER)
  {
    CGUISettingsSliderControl *pControl = (CGUISettingsSliderControl *)GetControl(iID);
    if (setting.data) *(float *)setting.data = pControl->GetFloatValue();
    if (setting.formatFunction) pControl->SetTextValue(setting.formatFunction(pControl->GetFloatValue(), setting.interval));
  }
  else if (setting.type == SettingInfo::BUTTON && m_usePopupSliders && setting.data)
  { // we're using popup sliders
    CGUIDialogSlider::ShowAndGetInput(setting.name, *(float *)setting.data, setting.min, setting.interval, setting.max, this, &setting);
    if (setting.formatFunction)
      SET_CONTROL_LABEL2(iID, setting.formatFunction(*(float *)setting.data, setting.interval));
  }
  else if (setting.type == SettingInfo::STRING)
  {
    CGUIDialogKeyboard::ShowAndGetInput(*(CStdString *) setting.data, true);
    string strNewValue = string(*(CStdString *)setting.data);
    if (strNewValue.empty())
      strNewValue = "-";
    SET_CONTROL_LABEL2(iID, strNewValue);
  }
  OnSettingChanged(setting);
}
开发者ID:,项目名称:,代码行数:54,代码来源:

示例4: OnClick

void CGUIDialogVisualisationSettings::OnClick(int iID)
{
  if (!m_pSettings || !m_pVisualisation) return;
  unsigned int settingNum = iID - CONTROL_START;
  if (settingNum >= m_pSettings->size()) return;
  VisSetting &setting = m_pSettings->at(settingNum);
  if (setting.type == VisSetting::SPIN)
  {
    CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(iID);
    setting.current = pControl->GetValue();
  }
  else if (setting.type == VisSetting::CHECK)
  {
    CGUIRadioButtonControl *pControl = (CGUIRadioButtonControl *)GetControl(iID);
    setting.current = pControl->IsSelected() ? 1 : 0;
  }
  m_pVisualisation->UpdateSetting(settingNum);
  UpdateSettings();
}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:19,代码来源:GUIDialogVisualisationSettings.cpp

示例5: OnProtocolChange

void CGUIDialogNetworkSetup::OnProtocolChange()
{
  CGUISpinControlEx *pSpin = (CGUISpinControlEx *)GetControl(CONTROL_PROTOCOL);
  if (!pSpin)
    return;
  m_protocol = (NET_PROTOCOL)pSpin->GetValue();
  // set defaults for the port
  if (m_protocol == NET_PROTOCOL_FTP)
    m_port = "21";
  if (m_protocol == NET_PROTOCOL_HTTP || m_protocol == NET_PROTOCOL_RSS)
    m_port = "80";
  if (m_protocol == NET_PROTOCOL_HTTPS)
    m_port = "443";
  if (m_protocol == NET_PROTOCOL_TUXBOX)
    m_port = "80";
  else if (m_protocol == NET_PROTOCOL_XBMSP)
    m_port = "1400";
  else if (m_protocol == NET_PROTOCOL_DAAP)
    m_port = "3689";

  UpdateButtons();
}
开发者ID:Kr0nZ,项目名称:boxee,代码行数:22,代码来源:GUIDialogNetworkSetup.cpp

示例6: OnSearch

void CGUIDialogPVRGuideSearch::OnSearch()
{
  CStdString              strTmp;
  CGUISpinControlEx      *pSpin;
  CGUIEditControl        *pEdit;
  CGUIRadioButtonControl *pRadioButton;

  if (!m_searchFilter)
    return;

  pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_SEARCH);
  if (pEdit) m_searchFilter->m_strSearchTerm = pEdit->GetLabel2();

  pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_INC_DESC);
  if (pRadioButton) m_searchFilter->m_bSearchInDescription = pRadioButton->IsSelected();

  pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_CASE_SENS);
  if (pRadioButton) m_searchFilter->m_bIsCaseSensitive = pRadioButton->IsSelected();

  pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_FTA_ONLY);
  if (pRadioButton) m_searchFilter->m_bFTAOnly = pRadioButton->IsSelected();

  pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_UNK_GENRE);
  if (pRadioButton) m_searchFilter->m_bIncludeUnknownGenres = pRadioButton->IsSelected();

  pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_IGNORE_REC);
  if (pRadioButton) m_searchFilter->m_bIgnorePresentRecordings = pRadioButton->IsSelected();

  pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_IGNORE_TMR);
  if (pRadioButton) m_searchFilter->m_bIgnorePresentTimers = pRadioButton->IsSelected();

  pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_SPIN_NO_REPEATS);
  if (pRadioButton) m_searchFilter->m_bPreventRepeats = pRadioButton->IsSelected();

  pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_GENRE);
  if (pSpin) m_searchFilter->m_iGenreType = pSpin->GetValue();

  pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_MIN_DURATION);
  if (pSpin) m_searchFilter->m_iMinimumDuration = pSpin->GetValue();

  pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_MAX_DURATION);
  if (pSpin) m_searchFilter->m_iMaximumDuration = pSpin->GetValue();

  pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_CHANNELS);
  if (pSpin) m_searchFilter->m_iChannelNumber = pSpin->GetValue();

  pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_GROUPS);
  if (pSpin) m_searchFilter->m_iChannelGroup = pSpin->GetValue();

  pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_START_TIME);
  if (pEdit) strTmp = pEdit->GetLabel2();

  pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_START_DATE);
  if (pEdit) ReadDateTime(pEdit->GetLabel2(), strTmp, m_searchFilter->m_startDateTime);
  strTmp.clear();

  pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_STOP_TIME);
  if (pEdit) strTmp = pEdit->GetLabel2();

  pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_STOP_DATE);
  if (pEdit) ReadDateTime(pEdit->GetLabel2(), strTmp, m_searchFilter->m_endDateTime);
}
开发者ID:OV3RDOSE,项目名称:xbmc,代码行数:62,代码来源:GUIDialogPVRGuideSearch.cpp

示例7: OnClick

void CGUIDialogSettings::OnClick(int iID)
{
  if (iID == CONTROL_OKAY_BUTTON)
  {
    OnOkay();
    Close();
    return;
  }
  if (iID == CONTROL_CANCEL_BUTTON)
  {
    OnCancel();
    Close();
    return;
  }
  unsigned int settingNum = iID - CONTROL_START;
  if (settingNum >= m_settings.size()) return;
  SettingInfo &setting = m_settings.at(settingNum);
  if (setting.type == SettingInfo::SPIN)
  {
    CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(iID);
    if (setting.data) *(int *)setting.data = pControl->GetValue();
  }
  else if (setting.type == SettingInfo::BUTTON_DIALOG)
  {
    CGUIButtonControl *pControl = (CGUIButtonControl *)GetControl(iID);
    if (setting.data) *(CStdString *)setting.data = pControl->GetLabel2();
  }
  else if (setting.type == SettingInfo::EDIT)
  {
    CGUIEditControl *pControl = (CGUIEditControl *)GetControl(iID);
    if (setting.data) *(CStdString *)setting.data = pControl->GetLabel2();
  }
  else if (setting.type == SettingInfo::EDIT_NUM)
  {
    CGUIEditControl *pControl = (CGUIEditControl *)GetControl(iID);
    if (setting.data) {
        CStdString strIndex = pControl->GetLabel2();
        *(int *)setting.data = atol(strIndex.c_str());
    }
  }
  else if (setting.type == SettingInfo::CHECK)
  {
    CGUIRadioButtonControl *pControl = (CGUIRadioButtonControl *)GetControl(iID);
    if (setting.data) *(bool *)setting.data = pControl->IsSelected();
  }
  else if (setting.type == SettingInfo::CHECK_UCHAR)
  {
    CGUIRadioButtonControl *pControl = (CGUIRadioButtonControl *)GetControl(iID);
    if (setting.data) *(unsigned char*)setting.data = pControl->IsSelected() ? 1 : 0;
  }
  else if (setting.type == SettingInfo::SLIDER)
  {
    CGUISettingsSliderControl *pControl = (CGUISettingsSliderControl *)GetControl(iID);
    if (setting.data) *(float *)setting.data = pControl->GetFloatValue();
    if (setting.formatFunction.standard) pControl->SetTextValue(setting.formatFunction.standard(pControl->GetFloatValue(), setting.interval));
  }
  else if (setting.type == SettingInfo::BUTTON && m_usePopupSliders && setting.data)
  { // we're using popup sliders
    CGUIDialogSlider::ShowAndGetInput(setting.name, *(float *)setting.data, setting.min, setting.interval, setting.max, this, &setting);
    if (setting.formatFunction.standard)
      SET_CONTROL_LABEL2(iID, setting.formatFunction.standard(*(float *)setting.data, setting.interval));
  }
  else if (setting.type == SettingInfo::STRING)
  {
    CGUIKeyboardFactory::ShowAndGetInput(*(CStdString *) setting.data, true);
    string strNewValue = string(*(CStdString *)setting.data);
    if (strNewValue.empty())
      strNewValue = "-";
    SET_CONTROL_LABEL2(iID, strNewValue);
  }
  else if (setting.type == SettingInfo::RANGE)
  {
    CGUISettingsSliderControl *pControl = (CGUISettingsSliderControl *)GetControl(iID);
    if (setting.data)
    {
      *((float **)setting.data)[0] = pControl->GetFloatValue(CGUISliderControl::RangeSelectorLower);
      *((float **)setting.data)[1] = pControl->GetFloatValue(CGUISliderControl::RangeSelectorUpper);
    }
    if (setting.formatFunction.range)
      pControl->SetTextValue(setting.formatFunction.range(pControl->GetFloatValue(CGUISliderControl::RangeSelectorLower), 
                                                          pControl->GetFloatValue(CGUISliderControl::RangeSelectorUpper),
                                                          setting.interval));
  }
  OnSettingChanged(setting);
}
开发者ID:Micromax-56,项目名称:xbmc,代码行数:85,代码来源:GUIDialogSettings.cpp


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