本文整理汇总了C++中CGUIRadioButtonControl::SetSelected方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIRadioButtonControl::SetSelected方法的具体用法?C++ CGUIRadioButtonControl::SetSelected怎么用?C++ CGUIRadioButtonControl::SetSelected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIRadioButtonControl
的用法示例。
在下文中一共展示了CGUIRadioButtonControl::SetSelected方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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());
}
示例2: UpdateSetting
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);
}
}
示例3: 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;
}
示例4: UpdateButtons
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());
}
示例5: UpdateButtons
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 */
}
示例6: 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());
}
示例7: UpdateButtons
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 */
}
示例8: Update
void CGUIDialogPVRGuideSearch::Update()
{
CGUIEditControl *pEdit;
CGUIRadioButtonControl *pRadioButton;
if (!m_searchFilter)
return;
pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_SEARCH);
if (pEdit)
{
pEdit->SetLabel2(m_searchFilter->m_strSearchTerm);
pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TEXT, 16017);
}
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_CASE_SENS);
if (pRadioButton) pRadioButton->SetSelected(m_searchFilter->m_bIsCaseSensitive);
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_INC_DESC);
if (pRadioButton) pRadioButton->SetSelected(m_searchFilter->m_bSearchInDescription);
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_FTA_ONLY);
if (pRadioButton) pRadioButton->SetSelected(m_searchFilter->m_bFTAOnly);
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_UNK_GENRE);
if (pRadioButton) pRadioButton->SetSelected(m_searchFilter->m_bIncludeUnknownGenres);
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_IGNORE_REC);
if (pRadioButton) pRadioButton->SetSelected(m_searchFilter->m_bIgnorePresentRecordings);
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_IGNORE_TMR);
if (pRadioButton) pRadioButton->SetSelected(m_searchFilter->m_bIgnorePresentTimers);
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_SPIN_NO_REPEATS);
if (pRadioButton) pRadioButton->SetSelected(m_searchFilter->m_bPreventRepeats);
/* Set time fields */
pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_START_TIME);
if (pEdit)
{
pEdit->SetLabel2(m_searchFilter->m_endDateTime.GetAsLocalizedTime("", false));
pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TIME, 14066);
}
pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_STOP_TIME);
if (pEdit)
{
pEdit->SetLabel2(m_searchFilter->m_startDateTime.GetAsLocalizedTime("", false));
pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TIME, 14066);
}
pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_START_DATE);
if (pEdit)
{
pEdit->SetLabel2(m_searchFilter->m_startDateTime.GetAsDBDate());
pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_DATE, 14067);
}
pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_STOP_DATE);
if (pEdit)
{
pEdit->SetLabel2(m_searchFilter->m_endDateTime.GetAsDBDate());
pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_DATE, 14067);
}
UpdateDurationSpin();
UpdateGroupsSpin();
UpdateChannelSpin();
UpdateGenreSpin();
}
示例9: Update
void CGUIDialogPVRGuideSearch::Update()
{
CGUISpinControlEx *pSpin;
CGUIEditControl *pEdit;
CGUIRadioButtonControl *pRadioButton;
if (!m_searchfilter)
return;
pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_SEARCH);
if (pEdit)
{
pEdit->SetLabel2(m_searchfilter->m_strSearchTerm);
pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TEXT, 16017);
}
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_CASE_SENS);
if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bIsCaseSensitive);
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_INC_DESC);
if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bSearchInDescription);
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_FTA_ONLY);
if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bFTAOnly);
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_UNK_GENRE);
if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bIncludeUnknownGenres);
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_IGNORE_REC);
if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bIgnorePresentRecordings);
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_BTN_IGNORE_TMR);
if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bIgnorePresentTimers);
pRadioButton = (CGUIRadioButtonControl *)GetControl(CONTROL_SPIN_NO_REPEATS);
if (pRadioButton) pRadioButton->SetSelected(m_searchfilter->m_bPreventRepeats);
/* Set duration list spin */
pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_MIN_DURATION);
if (pSpin)
{
pSpin->Clear();
pSpin->AddLabel("-", -1);
for (int i = 1; i < 12*60/5; i++)
{
CStdString string;
string.Format(g_localizeStrings.Get(14044),i*5);
pSpin->AddLabel(string, i*5);
}
pSpin->SetValue(m_searchfilter->m_iMinimumDuration);
}
pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_MAX_DURATION);
if (pSpin)
{
pSpin->Clear();
pSpin->AddLabel("-", -1);
for (int i = 1; i < 12*60/5; i++)
{
CStdString string;
string.Format(g_localizeStrings.Get(14044),i*5);
pSpin->AddLabel(string, i*5);
}
pSpin->SetValue(m_searchfilter->m_iMaximumDuration);
}
/* Set time fields */
pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_START_TIME);
if (pEdit)
{
CDateTime time = m_searchfilter->m_startTime;
pEdit->SetLabel2(time.GetAsLocalizedTime("", false));
pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TIME, 14066);
}
pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_STOP_TIME);
if (pEdit)
{
CDateTime time = m_searchfilter->m_endTime;
pEdit->SetLabel2(time.GetAsLocalizedTime("", false));
pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TIME, 14066);
}
pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_START_DATE);
if (pEdit)
{
CDateTime date = m_searchfilter->m_startDate;
pEdit->SetLabel2(date.GetAsDBDate());
pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_DATE, 14067);
}
pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_STOP_DATE);
if (pEdit)
{
CDateTime date = m_searchfilter->m_endDate;
pEdit->SetLabel2(date.GetAsDBDate());
pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_DATE, 14067);
}
/* Set Channel list spin */
pSpin = (CGUISpinControlEx *)GetControl(CONTROL_SPIN_CHANNELS);
if (pSpin)
{
//.........这里部分代码省略.........
示例10: UpdateSetting
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);
if (pControl && setting.data)
{
float value = *(float *)setting.data;
pControl->SetFloatValue(value);
if (setting.formatFunction) pControl->SetTextValue(setting.formatFunction(value, setting.interval));
}
}
else if (setting.type == SettingInfo::BUTTON_DIALOG)
{
SET_CONTROL_LABEL(controlID,setting.name);
CGUIButtonControl *pControl = (CGUIButtonControl *)GetControl(controlID);
if (pControl && setting.data) pControl->SetLabel2(*(CStdString *)setting.data);
}
else if (setting.type == SettingInfo::EDIT)
{
CGUIEditControl *pControl = (CGUIEditControl *)GetControl(controlID);
if (pControl && setting.data) pControl->SetLabel2(*(CStdString *)setting.data);
}
else if (setting.type == SettingInfo::EDIT_NUM)
{
CGUIEditControl *pControl = (CGUIEditControl *)GetControl(controlID);
if (pControl && setting.data) {
CStdString strIndex;
strIndex.Format("%i", *(int *)setting.data);
pControl->SetLabel2(strIndex);
}
}
else if (setting.type == SettingInfo::STRING)
{
SET_CONTROL_LABEL(controlID, setting.name);
string strNewValue = string(*(CStdString *)setting.data);
if (strNewValue.empty())
strNewValue = "-";
SET_CONTROL_LABEL2(controlID, strNewValue);
}
if (setting.enabled)
{
CONTROL_ENABLE(controlID);
}
else
{
CONTROL_DISABLE(controlID);
}
}