No longer ignores the text that comes with a confirmed B_INPUT_METHOD_CHANGED

event; it now only deactivates the inline in that case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19115 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-10-24 23:20:20 +00:00
parent 79372d08b0
commit 3956f772e1

View File

@ -4348,18 +4348,18 @@ BTextView::HandleInputMethodChanged(BMessage *message)
// it means it's over for now, so the current _BInlineInput_ object // it means it's over for now, so the current _BInlineInput_ object
// should become inactive. We will probably receive a B_INPUT_METHOD_STOPPED // should become inactive. We will probably receive a B_INPUT_METHOD_STOPPED
// message after this one. // message after this one.
bool confirmed = false; bool confirmed;
if (message->FindBool("be:confirmed", &confirmed) == B_OK && confirmed) { if (message->FindBool("be:confirmed", &confirmed) != B_OK)
fInline->SetActive(false); confirmed = false;
Refresh(0, fInline->Offset() + fInline->Length(), true, false);
return;
}
// Delete the previously inserted text (if any) // Delete the previously inserted text (if any)
if (fInline->IsActive()) { if (fInline->IsActive()) {
int32 oldOffset = fInline->Offset(); int32 oldOffset = fInline->Offset();
DeleteText(oldOffset, oldOffset + fInline->Length()); DeleteText(oldOffset, oldOffset + fInline->Length());
fClickOffset = fSelStart = fSelEnd = oldOffset; fClickOffset = fSelStart = fSelEnd = oldOffset;
if (confirmed)
fInline->SetActive(false);
} }
int32 stringLen = strlen(string); int32 stringLen = strlen(string);
@ -4394,7 +4394,7 @@ BTextView::HandleInputMethodChanged(BMessage *message)
fSelStart += stringLen; fSelStart += stringLen;
fClickOffset = fSelEnd = fSelStart; fClickOffset = fSelEnd = fSelStart;
if (!fInline->IsActive()) if (!confirmed && !fInline->IsActive())
fInline->SetActive(true); fInline->SetActive(true);
Refresh(fInline->Offset(), fSelEnd, true, false); Refresh(fInline->Offset(), fSelEnd, true, false);