tabTo, insertc, deletec for TextPort.

git-svn-id: svn://qnap.local/TwoTerm/trunk@2023 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
This commit is contained in:
Kelvin Sherlock
2011-02-06 18:31:49 +00:00
parent 01d1a214c1
commit 272ad2a166
3 changed files with 119 additions and 24 deletions

View File

@@ -137,29 +137,7 @@ void Screen::putc(TextPort *textPort, uint8_t c)
void Screen::tabTo(TextPort *textPort, unsigned xPos)
{
if (!textPort) textPort = &_port;
CharInfo clear(' ', _flag);
iPoint cursor = textPort->absoluteCursor();
xPos = std::min((int)xPos, textPort->frame.width() - 1);
_updates.push_back(cursor);
for (unsigned x = textPort->cursor.x; x < xPos; ++x)
{
_screen[cursor.y][x + textPort->frame.minX()] = clear;
}
textPort->cursor.x = xPos;
if (textPort != &_port) _port.cursor = textPort->absoluteCursor();
_updates.push_back(_port.cursor);
}
#pragma mark -