コード例 #1
0
void JniTextField::TextFieldShouldReturn()
{
	DVASSERT(activeTextField);
	UITextFieldDelegate* delegate = activeTextField->GetDelegate();
	if (delegate)
		delegate->TextFieldShouldReturn(activeTextField);
}
コード例 #2
0
bool JniTextField::TextFieldKeyPressed(int32 replacementLocation, int32 replacementLength, const char* text)
{
	DVASSERT(activeTextField);
	UITextFieldDelegate* delegate = activeTextField->GetDelegate();
	if (!delegate)
		return true;

	WideString strText = StringToWString(text);
	return delegate->TextFieldKeyPressed(activeTextField, replacementLocation, replacementLength, strText);
}
コード例 #3
0
bool UITextFieldAndroid::TextFieldKeyPressed(int32 replacementLocation, int32 replacementLength, const WideString &text)
{
	bool res = true;
	UITextFieldDelegate* delegate = textField->GetDelegate();
	if (delegate)
		res = delegate->TextFieldKeyPressed(textField, replacementLocation, replacementLength, text);

	if (res)
	{
		WideString curText = textField->GetText();
		if (curText.length() >= replacementLocation)
		{
			curText.replace(replacementLocation, replacementLength, text);
			this->text = curText;
		}
	}
	return res;
}
コード例 #4
0
void UITextFieldAndroid::TextFieldShouldReturn()
{
	UITextFieldDelegate* delegate = textField->GetDelegate();
	if (delegate)
		delegate->TextFieldShouldReturn(textField);
}