本文整理汇总了C++中CGUIEditControl::GetLabel2方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIEditControl::GetLabel2方法的具体用法?C++ CGUIEditControl::GetLabel2怎么用?C++ CGUIEditControl::GetLabel2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIEditControl
的用法示例。
在下文中一共展示了CGUIEditControl::GetLabel2方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMessage
bool CGUIDialogBoxeeBrowseMenu::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_INIT:
{
CStdString param = message.GetStringParam(0);
m_openInSearch = (param == "openinsearch");
}
break;
case GUI_MSG_LABEL2_SET:
{
CGUIDialogBoxeeSearch *pSearchDialog = (CGUIDialogBoxeeSearch*)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_SEARCH);
if (pSearchDialog && pSearchDialog->ClosedByMovingRightFromTextBox())
{
CAction action;
action.id = ACTION_MOVE_RIGHT;
OnAction(action);
}
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (iControl == BROWSE_MENU_BUTTON_SEARCH)
{
// Get the keystroke that was pressed
bool bResult = CGUIDialog::OnMessage(message);
SET_CONTROL_FOCUS(BROWSE_MENU_BUTTON_SEARCH,0);
CGUIEditControl* pSearchControl = (CGUIEditControl*)GetControl(BROWSE_MENU_BUTTON_SEARCH);
if (pSearchControl)
{
CStdString strSearchTerm = pSearchControl->GetLabel2();
//pSearchControl->SetLabel2("");
CLog::Log(LOGDEBUG,"CGUIDialogBoxeeBrowseMenu::OnMessage - [term=%s] (search)", strSearchTerm.c_str());
ThreadMessage tMsg(TMSG_GUI_ACTIVATE_WINDOW , WINDOW_DIALOG_BOXEE_SEARCH , false);
std::vector<CStdString> params;
params.push_back(strSearchTerm);
tMsg.params = params;
g_application.getApplicationMessenger().SendMessage(tMsg,false);
}
return bResult;
}
OnClick(iControl);
}
break;
}
return CGUIDialog::OnMessage(message);
}
示例2: HandleSelectZipCode
bool CGUIDialogBoxeeOTAZipcodeLocationConfiguration::HandleSelectZipCode()
{
CGUIEditControl *editControl = (CGUIEditControl *)GetControl(CONTROL_ZIP_CODE_EDIT);
if (!editControl)
{
return false;
}
CStdString zipCode = editControl->GetLabel2();
CBoxeeOTAConfigurationManager::GetInstance().GetConfigurationData().SetZipCode(zipCode);
return true;
}
示例3: get_text
char* Interface_GUIControlEdit::get_text(void* kodiBase, void* handle)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
CGUIEditControl* control = static_cast<CGUIEditControl*>(handle);
if (!addon || !control)
{
CLog::Log(LOGERROR, "Interface_GUIControlEdit::%s - invalid handler data (kodiBase='%p', handle='%p') on addon '%s'",
__FUNCTION__, kodiBase, handle, addon ? addon->ID().c_str() : "unknown");
return nullptr;
}
return strdup(control->GetLabel2().c_str());
}
示例4: OnClickButtonEditName
bool CGUIDialogPVRChannelManager::OnClickButtonEditName(CGUIMessage &message)
{
CGUIEditControl *pEdit = (CGUIEditControl *)GetControl(EDIT_NAME);
if (pEdit)
{
CFileItemPtr pItem = m_channelItems->Get(m_iSelected);
if (pItem)
{
pItem->SetProperty("Changed", true);
pItem->SetProperty("Name", pEdit->GetLabel2());
m_bContainsChanges = true;
return true;
}
}
return false;
}
示例5: 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) 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));
}
OnSettingChanged(setting);
}
示例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);
}
示例7: OnMessage
bool CGUIDialogBoxeeShare::OnMessage(CGUIMessage &message)
{
if (message.GetMessage() == GUI_MSG_WINDOW_INIT)
{
//if (!LoadSocialServices(true))
int retCode;
if (BoxeeUtils::GetShareServicesJson(m_jsonServiceList,retCode,true) != JOB_SUCCEEDED)
{
Close();
return true;
}
}
else if (message.GetMessage() == GUI_MSG_WINDOW_DEINIT)
{
m_item.Reset();
}
else if (message.GetMessage() == GUI_MSG_CLICKED)
{
switch(message.GetSenderId())
{
case EDIT_CONTROL:
{
CGUIEditControl* editControl = (CGUIEditControl*)GetControl(EDIT_CONTROL);
CGUIWindow* activeWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow());
if (editControl && activeWindow)
{
CStdString leftToInput = BOXEE::BXUtils::IntToString(editControl->GetMaxInputSize() - (int)editControl->GetLabel2().size());
activeWindow->SetProperty(LEFT_TO_INPUT_SIZE,leftToInput);
}
}
break;
case SHARE_BTN:
{
CGUIEditControl* editControl = (CGUIEditControl*)GetControl(EDIT_CONTROL);
if (!editControl)
{
CGUIDialogOK2::ShowAndGetInput(257, 55195);
return true;
}
m_strText = editControl->GetLabel2();
if (m_strText.IsEmpty())
{
CGUIDialogOK2::ShowAndGetInput(54000, 54001);
return true;
}
std::vector<BOXEE::BXFriend> recommendTo; // always empty at the moment - which means - "to all the world".
BoxeeUtils::Share(&m_item, recommendTo, m_servicesList, false, m_strText);
Close();
g_application.m_guiDialogKaiToast.QueueNotification(CGUIDialogKaiToast::ICON_HEART, "", g_localizeStrings.Get(51033), 3000, KAI_RED_COLOR, KAI_GREY_COLOR);
}
break;
case SERVICE_LIST:
{
CGUIBaseContainer* serviceList = (CGUIBaseContainer*) GetControl(SERVICE_LIST);
CGUIListItemPtr itemUI = serviceList->GetSelectedItemPtr();
int iItem = serviceList->GetSelectedItem();
if (iItem < m_servicesList.Size() && iItem >= 0 )
{
CFileItemPtr fileItem = m_servicesList.Get(iItem);
CFileItem* fItem = fileItem.get();
//fItem->Dump();
if (!fileItem->GetPropertyBOOL("enable"))
{
//open up the browser dialog with the link we got from the server
#ifdef CANMORE
if (!g_application.IsPlaying() || g_application.GetCurrentPlayer() != PCID_FLASHLAYER)
{
//browser reported success
int retCode;
if (CGUIWebDialog::ShowAndGetInput(fileItem->GetProperty("connect")) && BoxeeUtils::GetShareServicesJson(m_jsonServiceList,retCode,true) == JOB_SUCCEEDED)
{
UpdateShareDialog();
}
}
else
#endif
{
CStdString text = g_localizeStrings.Get(80001);
text += " " + fileItem->GetProperty("link");
CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(10014),text);
}
return true;
}
bool bSelection = itemUI->GetPropertyBOOL("isSelected");
fItem->SetProperty("isSelected", !bSelection);
itemUI->SetProperty("isSelected", !bSelection);
}
}
break;
}
}
//.........这里部分代码省略.........
示例8: OnInitWindow
void CGUIDialogBoxeeShare::OnInitWindow()
{
CGUIWindow::OnInitWindow();
m_strText = GetDefaultShareText();
// Send the item to the special container to allow skin access
CFileItemPtr itemPtr(new CFileItem(m_item));
CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), HIDDEN_CONTAINER, 0, 0, itemPtr);
g_windowManager.SendMessage(winmsg);
CGUIEditControl* editControl = (CGUIEditControl*)GetControl(EDIT_CONTROL);
if (editControl)
{
editControl->SetLabel2(m_strText);
CGUIWindow* activeWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow());
if (activeWindow)
{
CStdString leftToInput = BOXEE::BXUtils::IntToString(editControl->GetMaxInputSize() - (int)editControl->GetLabel2().size());
activeWindow->SetProperty(LEFT_TO_INPUT_SIZE,leftToInput);
}
}
// Set the user profile thumb - start
CProfile profile = g_settings.m_vecProfiles[g_settings.m_iLastLoadedProfileIndex];
CFileItemPtr item(new CFileItem(profile.getName()));
CStdString strLabel;
if (profile.getDate().IsEmpty())
strLabel = g_localizeStrings.Get(20113);
else
strLabel.Format(g_localizeStrings.Get(20112),profile.getDate());
item->SetLabel2(strLabel);
item->SetThumbnailImage(profile.getThumb());
item->SetCachedPictureThumb();
if (profile.getThumb().IsEmpty() || profile.getThumb().Equals("-"))
item->SetThumbnailImage("unknown-user.png");
item->SetLabelPreformated(true);
CGUIMessage winmsg2(GUI_MSG_LABEL_ADD, GetID(), USER_INFO_CONTAINER, 0, 0, item);
g_windowManager.SendMessage(winmsg2);
UpdateShareDialog();
SET_CONTROL_FOCUS(SHARE_BTN,0);
}
示例9: GetSearchTerm
CStdString CGUIDialogBoxeeBrowseMenu::GetSearchTerm()
{
CGUIEditControl* pSearchControl = (CGUIEditControl*)GetControl(BROWSE_MENU_BUTTON_SEARCH);
return pSearchControl->GetLabel2();
}