Exemplo n.º 1
0
WideString UITextField::GetAppliedChanges(int32 replacementLocation, int32 replacementLength, const WideString & replacementString)
{//TODO: fix this for copy/paste
    WideString txt = GetText();
    
    if(replacementLocation >= 0)
    {
        txt.replace(replacementLocation, replacementLength, replacementString);
    }
    
    return txt;
}
Exemplo n.º 2
0
void Editor::untabify(WideString& text)
{
  int width = settings->tabSize;
  for (int i = 0; text[i]; i++)
  {
    if (text[i] == '\t')
    {
      text.replace(i, ' ');
      //int extra = (width - (i % width)) - 1;
      //for (int i = 0; i < extra; i++)
      //  text.insert(i, ' ');
    }
  }
}
Exemplo n.º 3
0
bool InputTest::TextFieldKeyPressed(UITextField * textField, int32 replacementLocation, int32 replacementLength, const WideString & replacementString)
{
	if (replacementLocation < 0 || replacementLength < 0)
	{
		staticText->SetText(L"");
		return true;
	}

	WideString resultString = textField->GetText();
	resultString.replace(replacementLocation, replacementLength, replacementString);
	staticText->SetText(resultString);

	return true;
}
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;
}