forked from cafeberry/cafeberry
added some kbm stuff
This commit is contained in:
@@ -16,6 +16,8 @@ bool UIControl_TextInput::setupControl(UIScene *scene, IggyValuePath *parent, co
|
||||
m_textName = registerFastName(L"text");
|
||||
m_funcChangeState = registerFastName(L"ChangeState");
|
||||
m_funcSetCharLimit = registerFastName(L"SetCharLimit");
|
||||
m_funcMoveCaretLeft = registerFastName(L"MoveCaretLeft");
|
||||
m_funcMoveCaretRight = registerFastName(L"MoveCaretRight");
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -38,7 +40,7 @@ void UIControl_TextInput::init(UIString label, int id)
|
||||
value[1].number = id;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 2 , value );
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// 4J-TomK - add this buttonlist to the vita touch box list
|
||||
|
||||
switch(m_parentScene->GetParentLayer()->m_iLayer)
|
||||
@@ -73,6 +75,30 @@ void UIControl_TextInput::setFocus(bool focus)
|
||||
}
|
||||
}
|
||||
|
||||
void UIControl_TextInput::SyncCaret(int caretIndex, int textLength)
|
||||
{
|
||||
if (caretIndex < 0) caretIndex = 0;
|
||||
if (caretIndex > textLength) caretIndex = textLength;
|
||||
IggyDataValue result; // placeholder to keep diff small
|
||||
IggyDataValue result2;
|
||||
int i;
|
||||
for (i = 0; i < textLength; ++i)
|
||||
IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcMoveCaretLeft, 0, NULL);
|
||||
for (i = 0; i < caretIndex; ++i)
|
||||
IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcMoveCaretRight, 0, NULL);
|
||||
}
|
||||
|
||||
void UIControl_TextInput::RefreshFocus()
|
||||
{
|
||||
m_bHasFocus = true;
|
||||
|
||||
IggyDataValue result;
|
||||
IggyDataValue value[1];
|
||||
value[0].type = IGGY_DATATYPE_number;
|
||||
value[0].number = 0;
|
||||
IggyResult out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcChangeState, 1, value);
|
||||
}
|
||||
|
||||
void UIControl_TextInput::SetCharLimit(int iLimit)
|
||||
{
|
||||
IggyDataValue result;
|
||||
|
||||
Reference in New Issue
Block a user