author | llornkcor <llornkcor> | 2002-02-01 14:11:46 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-01 14:11:46 (UTC) |
commit | 07ec85f797cad04431df30855a81b88f06fe27d3 (patch) (side-by-side diff) | |
tree | 72b6e4a2f63f47df4214df486333313128011840 /core/apps/embeddedkonsole/TEWidget.cpp | |
parent | 2802e5a2b474101a50bf95e707061ca5542876fd (diff) | |
download | opie-07ec85f797cad04431df30855a81b88f06fe27d3.zip opie-07ec85f797cad04431df30855a81b88f06fe27d3.tar.gz opie-07ec85f797cad04431df30855a81b88f06fe27d3.tar.bz2 |
Added editable commandlist, tabs position, and user selectable colors.
Diffstat (limited to 'core/apps/embeddedkonsole/TEWidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/embeddedkonsole/TEWidget.cpp | 98 |
1 files changed, 51 insertions, 47 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp index dc83998..f10bfb2 100644 --- a/core/apps/embeddedkonsole/TEWidget.cpp +++ b/core/apps/embeddedkonsole/TEWidget.cpp @@ -10,11 +10,10 @@ /* */ /* ------------------------------------------------------------------------ */ -/* */ +/* */ /* Ported Konsole to Qt/Embedded */ -/* */ +/* */ /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ -/* */ +/* */ /* -------------------------------------------------------------------------- */ - /*! \class TEWidget @@ -116,5 +115,5 @@ static const ColorEntry base_color_table[TABLE_COLORS] = ColorEntry(QColor(0x68,0x68,0x68), 0, 0 ), ColorEntry( QColor(0xFF,0x54,0x54), 0, 0 ), ColorEntry(QColor(0x54,0xFF,0x54), 0, 0 ), ColorEntry( QColor(0xFF,0xFF,0x54), 0, 0 ), - ColorEntry(QColor(0x54,0x54,0xFF), 0, 0 ), ColorEntry( QColor(0xFF,0x54,0xFF), 0, 0 ), + ColorEntry(QColor(0x54,0x54,0xFF), 0, 0 ), ColorEntry( QColor(0xB2,0x18,0xB2), 0, 0 ), ColorEntry(QColor(0x54,0xFF,0xFF), 0, 0 ), ColorEntry( QColor(0xFF,0xFF,0xFF), 0, 0 ) }; @@ -138,4 +137,10 @@ const ColorEntry* TEWidget::getColorTable() const } +const ColorEntry* TEWidget::getdefaultColorTable() const +{ + return base_color_table; +} + + const QPixmap *TEWidget::backgroundPixmap() { @@ -241,9 +246,9 @@ void TEWidget::fontChange(const QFont &) fontMap = #if QT_VERSION < 300 - strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") + strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") ? vt100extended : #endif - identicalMap; + identicalMap; propagateSize(); update(); @@ -255,6 +260,5 @@ void TEWidget::setVTFont(const QFont& f) } -QFont TEWidget::getVTFont() -{ +QFont TEWidget::getVTFont() { return font(); } @@ -648,5 +652,5 @@ void TEWidget::mousePressEvent(QMouseEvent* ev) iPntSel = pntSel = pos; actSel = 1; // left mouse button pressed but nothing selected yet. - grabMouse( /*crossCursor*/ ); // handle with care! + grabMouse( /*crossCursor*/ ); // handle with care! } else @@ -714,7 +718,7 @@ void TEWidget::mouseMoveEvent(QMouseEvent* ev) bool left_not_right = ( here.y() < iPntSel.y() || - here.y() == iPntSel.y() && here.x() < iPntSel.x() ); + here.y() == iPntSel.y() && here.x() < iPntSel.x() ); bool old_left_not_right = ( pntSel.y() < iPntSel.y() || - pntSel.y() == iPntSel.y() && pntSel.x() < iPntSel.x() ); + pntSel.y() == iPntSel.y() && pntSel.x() < iPntSel.x() ); swapping = left_not_right != old_left_not_right; @@ -976,32 +980,32 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e ) bool dele=FALSE; if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { - QKeyEvent* ke = (QKeyEvent*)e; - bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); - switch (ke->key()) { - case Key_F9: // let this be "Control" - control = keydown; - e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); - dele=TRUE; - break; - case Key_F13: // let this be "Alt" - alt = keydown; - e = new QKeyEvent(QEvent::KeyPress, Key_Alt, 0, ke->state()); - dele=TRUE; - break; - default: - if ( control ) { - int a = toupper(ke->ascii())-64; - if ( a >= 0 && a < ' ' ) { - e = new QKeyEvent(e->type(), ke->key(), - a, ke->state()|ControlButton, QChar(a,0)); - dele=TRUE; - } - } - if ( alt ) { - e = new QKeyEvent(e->type(), ke->key(), - ke->ascii(), ke->state()|AltButton, ke->text()); - dele=TRUE; - } - } + QKeyEvent* ke = (QKeyEvent*)e; + bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); + switch (ke->key()) { + case Key_F9: // let this be "Control" + control = keydown; + e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); + dele=TRUE; + break; + case Key_F13: // let this be "Alt" + alt = keydown; + e = new QKeyEvent(QEvent::KeyPress, Key_Alt, 0, ke->state()); + dele=TRUE; + break; + default: + if ( control ) { + int a = toupper(ke->ascii())-64; + if ( a >= 0 && a < ' ' ) { + e = new QKeyEvent(e->type(), ke->key(), + a, ke->state()|ControlButton, QChar(a,0)); + dele=TRUE; + } + } + if ( alt ) { + e = new QKeyEvent(e->type(), ke->key(), + ke->ascii(), ke->state()|AltButton, ke->text()); + dele=TRUE; + } + } } #endif @@ -1189,12 +1193,12 @@ void TEWidget::dropEvent(QDropEvent* event) if (bPopup) // m_drop->popup(pos() + event->pos()); - m_drop->popup(mapToGlobal(event->pos())); + m_drop->popup(mapToGlobal(event->pos())); else - { - if (currentSession) { - currentSession->getEmulation()->sendString(dropText.local8Bit()); - } -// kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; - } + { + if (currentSession) { + currentSession->getEmulation()->sendString(dropText.local8Bit()); + } +// kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; + } } } |