Implemented BTextView::HideTyping(). Now it will display B_UTF8_BULLET

chars instead of the real text if this option is enabled. Note that 
there are problems with the text width, i.e. the calculation is still 
done with the "real" chars, leading to text corruption.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18837 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2006-09-14 14:51:18 +00:00
parent 3a70724f43
commit 575a68b317
2 changed files with 47 additions and 20 deletions
+12 -11
View File
@@ -2438,16 +2438,16 @@ BTextView::DoesUndo() const
void
BTextView::HideTyping(bool enabled)
{
CALLED();
//TODO: Implement ?
//fText->SetPasswordMode(enabled);
if (enabled)
Delete(0, fText->Length());
fText->SetPasswordMode(enabled);
}
bool
BTextView::IsTypingHidden() const
{
CALLED();
return fText->PasswordMode();
}
@@ -3636,13 +3636,13 @@ BTextView::DrawLines(int32 startLine, int32 endLine, int32 startOffset, bool era
long offset = startOffset != -1 ? startOffset : line->offset;
const BFont *font = NULL;
const rgb_color *color = NULL;
int32 numChars;
int32 numBytes;
// iterate through each style on this line
while ((numChars = fStyles->Iterate(offset, length, fInline, &font, &color)) != 0) {
while ((numBytes = fStyles->Iterate(offset, length, fInline, &font, &color)) != 0) {
view->SetFont(font);
view->SetHighColor(*color);
tabChars = numChars;
tabChars = numBytes;
do {
foundTab = fText->FindChar(B_TAB, offset, &tabChars);
if (foundTab) {
@@ -3650,7 +3650,7 @@ BTextView::DrawLines(int32 startLine, int32 endLine, int32 startOffset, bool era
numTabs++;
if ((*fText)[offset + tabChars + numTabs] != B_TAB)
break;
} while ((tabChars + numTabs) < numChars);
} while ((tabChars + numTabs) < numBytes);
}
if (inputRegion.CountRects() > 0) {
@@ -3680,7 +3680,8 @@ BTextView::DrawLines(int32 startLine, int32 endLine, int32 startOffset, bool era
view->PopState();
}
view->DrawString(fText->GetString(offset, tabChars), tabChars);
const char *string = fText->GetString(offset, numBytes);
view->DrawString(string);
if (foundTab) {
float penPos = PenLocation().x - fTextRect.left;
@@ -3695,8 +3696,8 @@ BTextView::DrawLines(int32 startLine, int32 endLine, int32 startOffset, bool era
offset += tabChars;
length -= tabChars;
numChars -= tabChars;
tabChars = numChars;
numBytes -= tabChars;
tabChars = numBytes;
numTabs = 0;
} while (foundTab && tabChars > 0);
}