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 @@ -11,9 +11,8 @@ /* ------------------------------------------------------------------------ */ -/* */ +/* */ /* Ported Konsole to Qt/Embedded */ -/* */ +/* */ /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ -/* */ +/* */ /* -------------------------------------------------------------------------- */ - /*! \class TEWidget @@ -117,3 +116,3 @@ static const ColorEntry base_color_table[TABLE_COLORS] = 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 ) @@ -139,2 +138,8 @@ const ColorEntry* TEWidget::getColorTable() const +const ColorEntry* TEWidget::getdefaultColorTable() const +{ + return base_color_table; +} + + const QPixmap *TEWidget::backgroundPixmap() @@ -242,3 +247,3 @@ void TEWidget::fontChange(const QFont &) #if QT_VERSION < 300 - strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") + strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") ? vt100extended @@ -246,3 +251,3 @@ void TEWidget::fontChange(const QFont &) #endif - identicalMap; + identicalMap; propagateSize(); @@ -256,4 +261,3 @@ void TEWidget::setVTFont(const QFont& f) -QFont TEWidget::getVTFont() -{ +QFont TEWidget::getVTFont() { return font(); @@ -649,3 +653,3 @@ void TEWidget::mousePressEvent(QMouseEvent* ev) actSel = 1; // left mouse button pressed but nothing selected yet. - grabMouse( /*crossCursor*/ ); // handle with care! + grabMouse( /*crossCursor*/ ); // handle with care! } @@ -715,5 +719,5 @@ 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; @@ -977,30 +981,30 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e ) 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; + } + } } @@ -1190,10 +1194,10 @@ void TEWidget::dropEvent(QDropEvent* event) // 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"; + } } |