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


C++ CGUIRadioButtonControl类代码示例

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


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

示例1: ControlRadioButton_Create

  CGUIControl* ControlRadioButton_Create(ControlRadioButton* pControl)
  {
    CLabelInfo label;
    label.font = g_fontManager.GetFont(pControl->strFont);
    label.textColor = pControl->dwTextColor;
    label.disabledColor = pControl->dwDisabledColor;
    label.shadowColor = pControl->dwShadowColor;
    label.focusedColor = pControl->dwFocusedColor;
    label.align = pControl->dwAlign;
    label.offsetX = (float)pControl->dwTextXOffset;
    label.offsetY = (float)pControl->dwTextYOffset;
    label.angle = (float)-pControl->iAngle;
    pControl->pGUIControl = new CGUIRadioButtonControl(
      pControl->iParentId,
      pControl->iControlId,
      (float)pControl->dwPosX,
      (float)pControl->dwPosY,
      (float)pControl->dwWidth,
      (float)pControl->dwHeight,
      (CStdString)pControl->strTextureFocus,
      (CStdString)pControl->strTextureNoFocus,
      label,
      (CStdString)pControl->strTextureRadioFocus,
      (CStdString)pControl->strTextureRadioNoFocus);

    CGUIRadioButtonControl* pGuiButtonControl =
      (CGUIRadioButtonControl*)pControl->pGUIControl;

    pGuiButtonControl->SetLabel(pControl->strText);

    return pControl->pGUIControl;
  }
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:32,代码来源:controlradiobutton.cpp

示例2: OnClickButtonRadioParentalLocked

bool CGUIDialogPVRChannelManager::OnClickButtonRadioParentalLocked(CGUIMessage &message)
{
  CGUIRadioButtonControl *pRadioButton = (CGUIRadioButtonControl *)GetControl(RADIOBUTTON_PARENTAL_LOCK);

  // ask for PIN first
  if (!g_PVRManager.CheckParentalPIN(g_localizeStrings.Get(19262).c_str()))
  {
    pRadioButton->SetSelected(!pRadioButton->IsSelected());
    return false;
  }

  if (pRadioButton)
  {
    CFileItemPtr pItem = m_channelItems->Get(m_iSelected);
    if (pItem)
    {
      pItem->SetProperty("Changed", true);
      pItem->SetProperty("ParentalLocked", pRadioButton->IsSelected());
      m_bContainsChanges = true;
      Renumber();
      return true;
    }
  }

  return false;
}
开发者ID:devilstrike,项目名称:boxeebox-xbmc,代码行数:26,代码来源:GUIDialogPVRChannelManager.cpp

示例3: SetData

void CGUIDialogPVRChannelManager::SetData(int iItem)
{
  CGUIEditControl        *pEdit;
  CGUIRadioButtonControl *pRadioButton;

  /* Check file item is in list range and get his pointer */
  if (iItem < 0 || iItem >= (int)m_channelItems->Size()) return;

  CFileItemPtr pItem = m_channelItems->Get(iItem);
  if (!pItem)
    return;

  pEdit = (CGUIEditControl *)GetControl(EDIT_NAME);
  if (pEdit)
  {
    pEdit->SetLabel2(pItem->GetProperty("Name").asString());
    pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TEXT, 19208);
  }

  pRadioButton = (CGUIRadioButtonControl *)GetControl(RADIOBUTTON_ACTIVE);
  if (pRadioButton) pRadioButton->SetSelected(pItem->GetProperty("ActiveChannel").asBoolean());

  pRadioButton = (CGUIRadioButtonControl *)GetControl(RADIOBUTTON_USEEPG);
  if (pRadioButton) pRadioButton->SetSelected(pItem->GetProperty("UseEPG").asBoolean());

  pRadioButton = (CGUIRadioButtonControl *)GetControl(RADIOBUTTON_PARENTAL_LOCK);
  if (pRadioButton) pRadioButton->SetSelected(pItem->GetProperty("ParentalLocked").asBoolean());
}
开发者ID:devilstrike,项目名称:boxeebox-xbmc,代码行数:28,代码来源:GUIDialogPVRChannelManager.cpp

示例4: CGUIRadioButtonControl

    CGUIControl* ControlRadioButton::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 CGUIRadioButtonControl(
        iParentId,
        iControlId,
        (float)dwPosX,
        (float)dwPosY,
        (float)dwWidth,
        (float)dwHeight,
        CTextureInfo(strTextureFocus),
        CTextureInfo(strTextureNoFocus),
        label,
        CTextureInfo(strTextureRadioOnFocus),
        CTextureInfo(strTextureRadioOnNoFocus),
        CTextureInfo(strTextureRadioOffFocus),
        CTextureInfo(strTextureRadioOffNoFocus));

      CGUIRadioButtonControl* pGuiButtonControl =
        (CGUIRadioButtonControl*)pGUIControl;

      pGuiButtonControl->SetLabel(strText);

      return pGUIControl;
    }
开发者ID:Saner2oo2,项目名称:xbmc,代码行数:34,代码来源:Control.cpp

示例5: if

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)
  {
    SET_CONTROL_LABEL(controlID,setting.name);
    if (m_usePopupSliders && setting.data && setting.formatFunction)
      SET_CONTROL_LABEL2(controlID,setting.formatFunction(*(float *)setting.data, setting.interval));
  }

  if (setting.enabled)
  {
    CONTROL_ENABLE(controlID);
  }
  else
  {
    CONTROL_DISABLE(controlID);
  }
}
开发者ID:Openivo,项目名称:xbmc,代码行数:57,代码来源:GUIDialogSettings.cpp

示例6: GetControl

void CGUIWindowPVRRecordings::UpdateButtons(void)
{
  CGUIRadioButtonControl *btnShowDeleted = (CGUIRadioButtonControl*) GetControl(CONTROL_BTNSHOWDELETED);
  if (btnShowDeleted)
  {
    btnShowDeleted->SetVisible(m_bRadio ? g_PVRRecordings->HasDeletedRadioRecordings() : g_PVRRecordings->HasDeletedTVRecordings());
    btnShowDeleted->SetSelected(m_bShowDeletedRecordings);
  }

  CGUIWindowPVRBase::UpdateButtons();
  SET_CONTROL_LABEL(CONTROL_LABEL_HEADER1, m_bShowDeletedRecordings ? g_localizeStrings.Get(19179) : ""); /* Deleted recordings trash */
}
开发者ID:Almarefa,项目名称:xbmc,代码行数:12,代码来源:GUIWindowPVRRecordings.cpp

示例7: GetControl

void CGUIWindowPVRChannels::UpdateButtons(void)
{
  CGUIRadioButtonControl *btnShowHidden = (CGUIRadioButtonControl*) GetControl(CONTROL_BTNSHOWHIDDEN);
  if (btnShowHidden)
  {
    btnShowHidden->SetVisible(g_PVRChannelGroups->GetGroupAll(m_bRadio)->GetNumHiddenChannels() > 0);
    btnShowHidden->SetSelected(m_bShowHiddenChannels);
  }

  CGUIWindowPVRBase::UpdateButtons();
  SET_CONTROL_LABEL(CONTROL_LABEL_HEADER1, m_bShowHiddenChannels ? g_localizeStrings.Get(19022) : GetGroup()->GroupName());
}
开发者ID:gellis12,项目名称:xbmc,代码行数:12,代码来源:GUIWindowPVRChannels.cpp

示例8: UpdateButtons

void CGUIWindowPVRChannelsBase::UpdateButtons(void)
{
  CGUIRadioButtonControl *btnShowHidden = static_cast<CGUIRadioButtonControl*>(GetControl(CONTROL_BTNSHOWHIDDEN));
  if (btnShowHidden)
  {
    btnShowHidden->SetVisible(CServiceBroker::GetPVRManager().ChannelGroups()->GetGroupAll(m_bRadio)->GetNumHiddenChannels() > 0);
    btnShowHidden->SetSelected(m_bShowHiddenChannels);
  }

  CGUIWindowPVRBase::UpdateButtons();
  SET_CONTROL_LABEL(CONTROL_LABEL_HEADER1, m_bShowHiddenChannels ? g_localizeStrings.Get(19022) : GetChannelGroup()->GroupName());
}
开发者ID:FernetMenta,项目名称:xbmc,代码行数:12,代码来源:GUIWindowPVRChannels.cpp

示例9: SET_CONTROL_SELECTED

void CGUIWindowPVRRecordings::UpdateButtons(void)
{
  SET_CONTROL_SELECTED(GetID(), CONTROL_BTNGROUPITEMS, CSettings::GetInstance().GetBool(CSettings::SETTING_PVRRECORD_GROUPRECORDINGS));

  CGUIRadioButtonControl *btnShowDeleted = (CGUIRadioButtonControl*) GetControl(CONTROL_BTNSHOWDELETED);
  if (btnShowDeleted)
  {
    btnShowDeleted->SetVisible(m_bRadio ? g_PVRRecordings->HasDeletedRadioRecordings() : g_PVRRecordings->HasDeletedTVRecordings());
    btnShowDeleted->SetSelected(m_bShowDeletedRecordings);
  }

  CGUIWindowPVRBase::UpdateButtons();
  SET_CONTROL_LABEL(CONTROL_LABEL_HEADER1, m_bShowDeletedRecordings ? g_localizeStrings.Get(19179) : ""); /* Deleted recordings trash */
}
开发者ID:bas-t,项目名称:xbmc,代码行数:14,代码来源:GUIWindowPVRRecordings.cpp

示例10: switch

bool CGUIDialogFirstTimeUseConfWireless::OnMessage(CGUIMessage& message)
{
    switch (message.GetMessage())
    {
    case GUI_MSG_CLICKED:
    {
        int senderId = message.GetSenderId();

        switch (senderId)
        {
        case CONTROL_PASSWORD_SHOW:
        {
            CGUIRadioButtonControl* pControl = (CGUIRadioButtonControl*)GetControl(CONTROL_PASSWORD_SHOW);
            if (pControl)
            {
                //((CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT))->
                if (pControl->IsSelected())
                {
                    ((CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT))->SetInputType(CGUIEditControl::INPUT_TYPE_TEXT,0);
                }
                else
                {
                    ((CGUIEditControl*)GetControl(CONTROL_PASSWORD_EDIT))->SetInputType(CGUIEditControl::INPUT_TYPE_PASSWORD,0);
                }
            }

            return true;
        }
        break;
        case AUTOMATIC_CONF:
        {
            SetSelectAUTOMATIC();
            return true;
        }
        break;
        case MANUALLY_CONF:
        {
            SetSelectMANUALLY();
            return true;
        }
        break;
        }
    }
    break;
    }

    return CGUIDialogFirstTimeUseBase::OnMessage(message);
}
开发者ID:sd-eblana,项目名称:bawx,代码行数:48,代码来源:GUIDialogFirstTimeUseConfWireless.cpp

示例11: OnClickButtonUseEPG

bool CGUIDialogPVRChannelManager::OnClickButtonUseEPG(CGUIMessage &message)
{
  CGUIRadioButtonControl *pRadioButton = (CGUIRadioButtonControl *)GetControl(RADIOBUTTON_USEEPG);
  if (pRadioButton)
  {
    CFileItemPtr pItem = m_channelItems->Get(m_iSelected);
    if (pItem)
    {
      pItem->SetProperty("Changed", true);
      pItem->SetProperty("UseEPG", pRadioButton->IsSelected());
      m_bContainsChanges = true;

      return true;
    }
  }

  return false;
}
开发者ID:devilstrike,项目名称:boxeebox-xbmc,代码行数:18,代码来源:GUIDialogPVRChannelManager.cpp

示例12: ActionButtonHideGroup

bool CGUIDialogPVRGroupManager::ActionButtonHideGroup(CGUIMessage &message)
{
  bool bReturn = false;

  if (message.GetSenderId() == BUTTON_HIDE_GROUP && m_selectedGroup)
  {
    CGUIRadioButtonControl *button = static_cast<CGUIRadioButtonControl*>(GetControl(message.GetSenderId()));
    if (button)
    {
      m_selectedGroup->SetHidden(button->IsSelected());
      Update();
    }

    bReturn = true;
  }

  return bReturn;
}
开发者ID:FLyrfors,项目名称:xbmc,代码行数:18,代码来源:GUIDialogPVRGroupManager.cpp

示例13: if

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

示例14: switch

bool CGUIWindowPVRRecordings::OnMessage(CGUIMessage &message)
{
  if (!IsValidMessage(message))
    return false;
  
  bool bReturn = false;
  switch (message.GetMessage())
  {
    case GUI_MSG_CLICKED:
      if (message.GetSenderId() == m_viewControl.GetCurrentControl())
      {
        int iItem = m_viewControl.GetSelectedItem();
        if (iItem >= 0 && iItem < m_vecItems->Size())
        {
          switch (message.GetParam1())
          {
            case ACTION_SELECT_ITEM:
            case ACTION_MOUSE_LEFT_CLICK:
            case ACTION_PLAY:
            {
              bReturn = PlayFile(m_vecItems->Get(iItem).get());
              break;
            }
            case ACTION_CONTEXT_MENU:
            case ACTION_MOUSE_RIGHT_CLICK:
              OnPopupMenu(iItem);
              bReturn = true;
              break;
            case ACTION_SHOW_INFO:
              ShowRecordingInfo(m_vecItems->Get(iItem).get());
              bReturn = true;
              break;
            case ACTION_DELETE_ITEM:
              ActionDeleteRecording(m_vecItems->Get(iItem).get());
              bReturn = true;
              break;
            default:
              bReturn = false;
              break;
          }
        }
      }
      else if (message.GetSenderId() == CONTROL_BTNGROUPITEMS)
      {
        CGUIRadioButtonControl *radioButton = (CGUIRadioButtonControl*) GetControl(CONTROL_BTNGROUPITEMS);
        g_PVRRecordings->SetGroupItems(radioButton->IsSelected());
        Refresh(true);
      }
      else if (message.GetSenderId() == CONTROL_BTNSHOWDELETED)
      {
        CGUIRadioButtonControl *radioButton = (CGUIRadioButtonControl*) GetControl(CONTROL_BTNSHOWDELETED);
        if (radioButton)
        {
          m_bShowDeletedRecordings = radioButton->IsSelected();
          Update(GetDirectoryPath());
        }
        bReturn = true;
      }
      break;
    case GUI_MSG_REFRESH_LIST:
      switch(message.GetParam1())
      {
        case ObservableMessageTimers:
        case ObservableMessageEpg:
        case ObservableMessageEpgContainer:
        case ObservableMessageEpgActiveItem:
        case ObservableMessageCurrentItem:
        {
          SetInvalid();
          break;
        }
        case ObservableMessageRecordings:
        case ObservableMessageTimersReset:
        {
          Refresh(true);
          break;
        }
      }
      break;
  }

  return bReturn || CGUIWindowPVRBase::OnMessage(message);
}
开发者ID:Almarefa,项目名称:xbmc,代码行数:83,代码来源:GUIWindowPVRRecordings.cpp

示例15: switch

bool CGUIWindowPVRRecordings::OnMessage(CGUIMessage &message)
{
  bool bReturn = false;
  switch (message.GetMessage())
  {
    case GUI_MSG_CLICKED:
      if (message.GetSenderId() == m_viewControl.GetCurrentControl())
      {
        int iItem = m_viewControl.GetSelectedItem();
        if (iItem >= 0 && iItem < m_vecItems->Size())
        {
          switch (message.GetParam1())
          {
            case ACTION_SELECT_ITEM:
            case ACTION_MOUSE_LEFT_CLICK:
            case ACTION_PLAY:
            {
              CFileItemPtr pItem = m_vecItems->Get(iItem);
              std::string resumeString = GetResumeString(*pItem);
              if (!resumeString.empty())
              {
                CContextButtons choices;
                choices.Add(CONTEXT_BUTTON_RESUME_ITEM, resumeString);
                choices.Add(CONTEXT_BUTTON_PLAY_ITEM, 12021);
                int choice = CGUIDialogContextMenu::ShowAndGetChoice(choices);
                if (choice > 0)
                  OnContextButtonPlay(pItem.get(), (CONTEXT_BUTTON)choice);
                bReturn = true;
              }
              break;
            }
            case ACTION_CONTEXT_MENU:
            case ACTION_MOUSE_RIGHT_CLICK:
              OnPopupMenu(iItem);
              bReturn = true;
              break;
            case ACTION_SHOW_INFO:
              ShowRecordingInfo(m_vecItems->Get(iItem).get());
              bReturn = true;
              break;
            case ACTION_DELETE_ITEM:
              ActionDeleteRecording(m_vecItems->Get(iItem).get());
              bReturn = true;
              break;
            default:
              bReturn = false;
              break;
          }
        }
      }
      else if (message.GetSenderId() == CONTROL_BTNGROUPITEMS)
      {
        CGUIRadioButtonControl *radioButton = (CGUIRadioButtonControl*) GetControl(CONTROL_BTNGROUPITEMS);
        g_PVRRecordings->SetGroupItems(radioButton->IsSelected());
        Refresh(true);
      }
      break;
    case GUI_MSG_REFRESH_LIST:
      switch(message.GetParam1())
      {
        case ObservableMessageTimers:
        case ObservableMessageCurrentItem:
        {
          if (IsActive())
            SetInvalid();
          bReturn = true;
          break;
        }
        case ObservableMessageRecordings:
        case ObservableMessageTimersReset:
        {
          if (IsActive())
            Refresh(true);
          bReturn = true;
          break;
        }
      }
      break;
  }

  return bReturn || CGUIWindowPVRBase::OnMessage(message);
}
开发者ID:Jmend25,项目名称:boxeebox-xbmc,代码行数:82,代码来源:GUIWindowPVRRecordings.cpp


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