本文整理汇总了C++中CGUILabelControl::SetSelection方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUILabelControl::SetSelection方法的具体用法?C++ CGUILabelControl::SetSelection怎么用?C++ CGUILabelControl::SetSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUILabelControl
的用法示例。
在下文中一共展示了CGUILabelControl::SetSelection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateLabel
void CGUIDialogKeyboardGeneric::UpdateLabel() // FIXME seems to be called twice for one USB SDL keyboard action/character
{
CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
if (pEdit)
{
CStdStringW edit = m_strEdit;
pEdit->SetHighlight(0, 0);
pEdit->SetSelection(0, 0);
if (m_hiddenInput)
{ // convert to *'s
edit.clear();
if (m_lastRemoteClickTime + REMOTE_SMS_DELAY > CTimeUtils::GetFrameTime() && m_iCursorPos > 0)
{ // using the remove to input, so display the last key input
edit.append(m_iCursorPos - 1, L'*');
edit.append(1, m_strEdit[m_iCursorPos - 1]);
}
else
edit.append(m_strEdit.size(), L'*');
}
else if (!m_strEditing.empty())
{
edit.insert(m_iCursorPos, m_strEditing);
pEdit->SetHighlight(m_iCursorPos, m_iCursorPos + m_strEditing.size());
if (m_iEditingLength > 0)
pEdit->SetSelection(m_iCursorPos + m_iEditingOffset, m_iCursorPos + m_iEditingOffset + m_iEditingLength);
}
// convert back to utf8
CStdString utf8Edit;
g_charsetConverter.wToUTF8(edit, utf8Edit);
pEdit->SetLabel(utf8Edit);
// Send off a search message
unsigned int now = CTimeUtils::GetFrameTime();
// don't send until the REMOTE_SMS_DELAY has passed
if (m_lastRemoteClickTime && m_lastRemoteClickTime + REMOTE_SMS_DELAY >= now)
return;
if (m_pCharCallback)
{
// do not send editing text comes from system input method
if (!m_hiddenInput && !m_strEditing.empty())
g_charsetConverter.wToUTF8(m_strEdit, utf8Edit);
m_pCharCallback(this, utf8Edit);
}
}
}