本文整理汇总了C++中CGUIEditControl类的典型用法代码示例。如果您正苦于以下问题:C++ CGUIEditControl类的具体用法?C++ CGUIEditControl怎么用?C++ CGUIEditControl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CGUIEditControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: switch
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);
}
示例3: UpdateButtons
void CGUIDialogSmartPlaylistRule::OnInitWindow()
{
CGUIDialog::OnInitWindow();
UpdateButtons();
CGUIEditControl *editControl = dynamic_cast<CGUIEditControl*>(GetControl(CONTROL_VALUE));
if (editControl != NULL)
editControl->SetInputValidation(CSmartPlaylistRule::Validate, &m_rule);
}
示例4: OnInitWindow
void CGUIDialogBoxeeOTAZipcodeLocationConfiguration::OnInitWindow()
{
CGUIDialog::OnInitWindow();
CGUIEditControl *editControl = (CGUIEditControl *)GetControl(CONTROL_ZIP_CODE_EDIT);
if (editControl)
editControl->SetLabel2(CBoxeeOTAConfigurationManager::GetInstance().GetConfigurationData().GetZipCode());
SET_CONTROL_FOCUS(CONTROL_ZIP_CODE_EDIT, 0);
}
示例5: OnWindowLoaded
void CGUIDialogKeyboardGeneric::OnWindowLoaded()
{
// show the cursor always
CGUIEditControl *edit = (CGUIEditControl *)GetControl(CTL_EDIT);
if (edit)
edit->SetShowCursorAlways(true);
g_Windowing.EnableTextInput(false);
CGUIDialog::OnWindowLoaded();
}
示例6: 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;
}
示例7: set_enabled
void Interface_GUIControlEdit::set_enabled(void* kodiBase, void* handle, bool enable)
{
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;
}
control->SetEnabled(enable);
}
示例8: get_cursor_position
unsigned int Interface_GUIControlEdit::get_cursor_position(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 0;
}
return control->GetCursorPosition();
}
示例9: 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());
}
示例10: set_text
void Interface_GUIControlEdit::set_text(void* kodiBase, void* handle, const char* text)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
CGUIEditControl* control = static_cast<CGUIEditControl*>(handle);
if (!addon || !control || !text)
{
CLog::Log(LOGERROR, "Interface_GUIControlEdit::%s - invalid handler data (kodiBase='%p', handle='%p', text='%p') on addon '%s'",
__FUNCTION__, kodiBase, handle, text, addon ? addon->ID().c_str() : "unknown");
return;
}
control->SetLabel2(text);
}
示例11: data
void Interface_GUIControlEdit::set_input_type(void* kodiBase, void* handle, int type, const char *heading)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
CGUIEditControl* control = static_cast<CGUIEditControl*>(handle);
if (!addon || !control || !heading)
{
CLog::Log(LOGERROR, "Interface_GUIControlEdit::%s - invalid handler data (kodiBase='%p', handle='%p', heading='%p') on addon '%s'",
__FUNCTION__, kodiBase, handle, heading, addon ? addon->ID().c_str() : "unknown");
return;
}
CGUIEditControl::INPUT_TYPE kodiType;
switch (static_cast<AddonGUIInputType>(type))
{
case ADDON_INPUT_TYPE_TEXT:
kodiType = CGUIEditControl::INPUT_TYPE_TEXT;
break;
case ADDON_INPUT_TYPE_NUMBER:
kodiType = CGUIEditControl::INPUT_TYPE_NUMBER;
break;
case ADDON_INPUT_TYPE_SECONDS:
kodiType = CGUIEditControl::INPUT_TYPE_SECONDS;
break;
case ADDON_INPUT_TYPE_TIME:
kodiType = CGUIEditControl::INPUT_TYPE_TIME;
break;
case ADDON_INPUT_TYPE_DATE:
kodiType = CGUIEditControl::INPUT_TYPE_DATE;
break;
case ADDON_INPUT_TYPE_IPADDRESS:
kodiType = CGUIEditControl::INPUT_TYPE_IPADDRESS;
break;
case ADDON_INPUT_TYPE_PASSWORD:
kodiType = CGUIEditControl::INPUT_TYPE_PASSWORD;
break;
case ADDON_INPUT_TYPE_PASSWORD_MD5:
kodiType = CGUIEditControl::INPUT_TYPE_PASSWORD_MD5;
break;
case ADDON_INPUT_TYPE_SEARCH:
kodiType = CGUIEditControl::INPUT_TYPE_SEARCH;
break;
case ADDON_INPUT_TYPE_FILTER:
kodiType = CGUIEditControl::INPUT_TYPE_FILTER;
break;
case ADDON_INPUT_TYPE_READONLY:
default:
kodiType = CGUIEditControl::INPUT_TYPE_PASSWORD_NUMBER_VERIFY_NEW;
}
control->SetInputType(kodiType, heading);
}
示例12: GetDefaultShareText
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);
}
示例13: OnWindowLoaded
void CGUIDialogKeyboardGeneric::OnWindowLoaded()
{
CGUIEditControl *edit = static_cast<CGUIEditControl*>(GetControl(CTL_EDIT));
if (edit)
{
// add control CTL_LABEL_HZCODE and CTL_LABEL_HZLIST if not exist
CGUIControlGroup *ParentControl = static_cast<CGUIControlGroup*>(edit->GetParentControl());
CLabelInfo labelInfo = edit->GetLabelInfo();
float px = edit->GetXPosition();
float py = edit->GetYPosition();
float pw = edit->GetWidth();
float ph = edit->GetHeight();
CGUILabelControl* control = static_cast<CGUILabelControl*>(GetControl(CTL_LABEL_HZCODE));
if (!control)
{
control = new CGUILabelControl(GetID(), CTL_LABEL_HZCODE, px, py + ph, 90, 30, labelInfo, false, false);
ParentControl->AddControl(control);
}
control = static_cast<CGUILabelControl*>(GetControl(CTL_LABEL_HZLIST));
if (!control)
{
labelInfo.align = XBFONT_CENTER_Y;
control = new CGUILabelControl(GetID(), CTL_LABEL_HZLIST, px + 95, py + ph, pw - 95, 30, labelInfo, false, false);
ParentControl->AddControl(control);
}
}
CGUIDialog::OnWindowLoaded();
}
示例14: SET_CONTROL_LABELS
void CGUIDialogSmartPlaylistRule::OnInitWindow()
{
CGUIDialog::OnInitWindow();
// add the fields to the field spincontrol
std::vector< std::pair<std::string, int> > labels;
std::vector<Field> fields = CSmartPlaylistRule::GetFields(m_type);
for (unsigned int i = 0; i < fields.size(); i++)
labels.push_back(std::make_pair(CSmartPlaylistRule::GetLocalizedField(fields[i]), fields[i]));
SET_CONTROL_LABELS(CONTROL_FIELD, 0, &labels);
UpdateButtons();
CGUIEditControl *editControl = dynamic_cast<CGUIEditControl*>(GetControl(CONTROL_VALUE));
if (editControl != NULL)
editControl->SetInputValidation(CSmartPlaylistRule::Validate, &m_rule);
}
示例15: 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;
}