|
|
@@ -1240,6 +1240,16 @@ void TextEditor::removeListener (Listener* l) { listeners.remove (l); } |
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
//==============================================================================
|
|
|
void TextEditor::timerCallbackInt()
|
|
|
void TextEditor::timerCallbackInt()
|
|
|
|
|
|
{
|
|
|
|
|
|
checkFocus();
|
|
|
|
|
|
|
|
|
|
|
|
auto now = Time::getApproximateMillisecondCounter();
|
|
|
|
|
|
|
|
|
|
|
|
if (now > lastTransactionTime + 200)
|
|
|
|
|
|
newTransaction();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TextEditor::checkFocus()
|
|
|
{
|
|
|
{
|
|
|
if (hasKeyboardFocus (false) && ! isCurrentlyBlockedByAnotherModalComponent())
|
|
|
if (hasKeyboardFocus (false) && ! isCurrentlyBlockedByAnotherModalComponent())
|
|
|
{
|
|
|
{
|
|
|
@@ -1249,11 +1259,6 @@ void TextEditor::timerCallbackInt() |
|
|
if (! isReadOnly())
|
|
|
if (! isReadOnly())
|
|
|
peer->textInputRequired (peer->globalToLocal (getScreenPosition()), *this);
|
|
|
peer->textInputRequired (peer->globalToLocal (getScreenPosition()), *this);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
auto now = Time::getApproximateMillisecondCounter();
|
|
|
|
|
|
|
|
|
|
|
|
if (now > lastTransactionTime + 200)
|
|
|
|
|
|
newTransaction();
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
void TextEditor::repaintText (Range<int> range)
|
|
|
void TextEditor::repaintText (Range<int> range)
|
|
|
@@ -2066,6 +2071,12 @@ void TextEditor::focusGained (FocusChangeType) |
|
|
moveCaretTo (getTotalNumChars(), true);
|
|
|
moveCaretTo (getTotalNumChars(), true);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// When caret position changes, we check focus automatically, to
|
|
|
|
|
|
// show any native keyboard if needed. If the position does not
|
|
|
|
|
|
// change though, we need to check focus manually.
|
|
|
|
|
|
if (getTotalNumChars() == 0)
|
|
|
|
|
|
checkFocus();
|
|
|
|
|
|
|
|
|
repaint();
|
|
|
repaint();
|
|
|
updateCaretPosition();
|
|
|
updateCaretPosition();
|
|
|
}
|
|
|
}
|
|
|
|