本文整理汇总了C++中CGUILabelControl::SetCursorPos方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUILabelControl::SetCursorPos方法的具体用法?C++ CGUILabelControl::SetCursorPos怎么用?C++ CGUILabelControl::SetCursorPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUILabelControl
的用法示例。
在下文中一共展示了CGUILabelControl::SetCursorPos方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnIPAddress
void CGUIDialogKeyboardGeneric::OnIPAddress()
{
// find any IP address in the current string if there is any
// We match to #.#.#.#
CStdString utf8String;
g_charsetConverter.wToUTF8(m_strEdit, utf8String);
CStdString ip;
CRegExp reg;
reg.RegComp("[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+");
int start = reg.RegFind(utf8String.c_str());
int length = 0;
if (start > -1)
{
length = reg.GetSubLength(0);
ip = utf8String.Mid(start, length);
}
else
start = utf8String.size();
if (CGUIDialogNumeric::ShowAndGetIPAddress(ip, g_localizeStrings.Get(14068)))
{
utf8String = utf8String.Left(start) + ip + utf8String.Mid(start + length);
g_charsetConverter.utf8ToW(utf8String, m_strEdit);
UpdateLabel();
CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
if (pEdit)
pEdit->SetCursorPos(m_strEdit.size());
}
}
示例2: MoveCursor
void CGUIDialogKeyboardGeneric::MoveCursor(int iAmount)
{
CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
if (pEdit)
{
pEdit->SetCursorPos(pEdit->GetCursorPos() + iAmount);
}
}
示例3: SetCursorPos
void CGUIDialogKeyboardGeneric::SetCursorPos(int iPos)
{
CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
if (pEdit)
{
pEdit->SetCursorPos(iPos);
}
}
示例4: SetCursorPos
void CGUIDialogKeyboardGeneric::SetCursorPos(int iPos)
{
if (iPos < 0)
iPos = 0;
else if (iPos > (int)m_strEdit.size())
iPos = (int)m_strEdit.size();
m_iCursorPos = iPos;
CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
if (pEdit)
{
pEdit->SetCursorPos(m_iCursorPos + (m_hiddenInput ? 0 : m_iEditingOffset));
}
}