textPort fixes.

git-svn-id: svn://qnap.local/TwoTerm/trunk@2000 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
This commit is contained in:
Kelvin Sherlock 2011-01-20 02:34:07 +00:00
parent 8275ab5ec5
commit 4a44a3dd4b

View File

@ -156,6 +156,14 @@ enum {
{ {
_state = StateText; _state = StateText;
_textPort.frame = iRect(0, 0, 80, 24);
_textPort.cursor = iPoint(0,0);
_textPort.scroll = true;
_textPort.advanceCursor = true;
_textPort.leftMargin = TextPort::MarginWrap;
_textPort.rightMargin = TextPort::MarginWrap;
// set flags to plain text. // set flags to plain text.
} }
@ -182,13 +190,7 @@ enum {
{ {
if ((self = [super init])) if ((self = [super init]))
{ {
_textPort.frame = iRect(0, 0, 24, 80); [self reset];
_textPort.cursor = iPoint(0,0);
_textPort.scroll = true;
_textPort.advanceCursor = true;
_textPort.leftMargin = TextPort::MarginWrap;
_textPort.rightMargin = TextPort::MarginWrap;
} }
return self; return self;
@ -232,7 +234,7 @@ enum {
case CTRL('I'): case CTRL('I'):
// tab // tab
screen->tabTo(&_textPort, (screen->x() + 8) & ~0x07); screen->tabTo(&_textPort, (_textPort.cursor.x + 8) & ~0x07);
//screen->tabTo((screen->x() + 8) & ~0x07); //screen->tabTo((screen->x() + 8) & ~0x07);
break; break;
@ -249,7 +251,7 @@ enum {
case CTRL('L'): case CTRL('L'):
// clear screen, go home. // clear screen, go home.
screen->erase(&_textPort, Screen::EraseAll); screen->erase(&_textPort, Screen::EraseAll);
screen->setCursor(&_textPort, iPoint(0,0)); screen->setCursor(&_textPort, 0, 0);
break; break;
case CTRL('M'): case CTRL('M'):
@ -269,11 +271,14 @@ enum {
case CTRL('Q'): case CTRL('Q'):
// insert line. // insert line.
screen->insertLine(&_textPort, screen->y() - _textPort.frame.origin.y); // TODO -- verify textPort
screen->insertLine(&_textPort, _textPort.cursor.y);
break; break;
case CTRL('R'): case CTRL('R'):
// delete line // delete line
screen->deleteLine(&_textPort, screen->y() - _textPort.frame.origin.y); // TODO -- verify textPort
screen->deleteLine(&_textPort, _textPort.cursor.y);
break; break;
case CTRL('U'): case CTRL('U'):
@ -297,8 +302,9 @@ enum {
case CTRL('Y'): case CTRL('Y'):
// cursor home // cursor home
screen->setCursor(_textPort.frame.origin, true, true); screen->setCursor(&_textPort, 0, 0);
break; break;
case CTRL('Z'): case CTRL('Z'):
// clear entire line // clear entire line
screen->erase(&_textPort, Screen::EraseLineAll); screen->erase(&_textPort, Screen::EraseLineAll);
@ -351,7 +357,7 @@ enum {
case StateDCAY: case StateDCAY:
_dca.y = c - 32; _dca.y = c - 32;
screen->setCursor(_dca); screen->setCursor(&_textPort, _dca);
_state = StateText; _state = StateText;
break; break;