本文整理汇总了C++中CGUIEditControl::GetMaxInputSize方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIEditControl::GetMaxInputSize方法的具体用法?C++ CGUIEditControl::GetMaxInputSize怎么用?C++ CGUIEditControl::GetMaxInputSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIEditControl
的用法示例。
在下文中一共展示了CGUIEditControl::GetMaxInputSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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;
}
}
//.........这里部分代码省略.........