abs -> fabs, disable WidthBuffer, patch for confirmation in HandleInputMethodChanged

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9761 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shatty 2004-11-03 11:12:24 +00:00
parent 23e2aae480
commit 2d7662810e

View File

@ -3615,7 +3615,7 @@ BTextView::StyledWidth(int32 fromOffset, int32 length, float *outAscent,
maxDescent = max_c(descent, maxDescent);
// Use _BWidthBuffer_ if possible
if (sWidths != NULL) {
if (false && (sWidths != NULL)) {
LockWidthBuffer();
result += sWidths->StringWidth(*fText, fromOffset, numChars, font);
UnlockWidthBuffer();
@ -4391,6 +4391,16 @@ BTextView::HandleInputMethodChanged(BMessage *message)
be_app->ObscureCursor();
// If we find the "be:confirmed" boolean (and the boolean is true),
// it means it's over for now, so the current _BInlineInput_ object
// should become inactive
bool confirmed = false;
if (message->FindBool("be:confirmed", &confirmed) == B_OK && confirmed) {
fInline->SetActive(false);
Refresh(0, fInline->Offset(), true, false);
return;
}
// Delete the previously inserted text (if any)
if (fInline->IsActive()) {
int32 oldOffset = fInline->Offset();
@ -4425,22 +4435,13 @@ BTextView::HandleInputMethodChanged(BMessage *message)
fInline->SetSelectionOffset(selectionStart);
fInline->SetSelectionLength(selectionEnd - selectionStart);
if (clauseCount > 0) {
// Insert the new text
InsertText(string, stringLen, fSelStart, NULL);
fSelStart += stringLen;
fClickOffset = fSelEnd = fSelStart;
}
// If we find the "be:confirmed" boolean (and the boolean is true),
// it means it's over for now, so the current _BInlineInput_ object
// should become inactive
bool confirmed = false;
if (message->FindBool("be:confirmed", &confirmed) < B_OK || !confirmed)
fInline->SetActive(true);
else
fInline->SetActive(false);
// Insert the new text
InsertText(string, stringLen, fSelStart, NULL);
fSelStart += stringLen;
fClickOffset = fSelEnd = fSelStart;
fInline->SetActive(true);
Refresh(0, fSelEnd, true, false);
}