author | llornkcor <llornkcor> | 2002-02-03 15:33:27 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-03 15:33:27 (UTC) |
commit | b7426bf997b8201667cecb0f66470e257b35ba60 (patch) (unidiff) | |
tree | 69ac9d9afd7be78aa7e421e0ee103d4eeec5138f | |
parent | a80b4c11934b93b3d067f812a68452617f202e61 (diff) | |
download | opie-b7426bf997b8201667cecb0f66470e257b35ba60.zip opie-b7426bf997b8201667cecb0f66470e257b35ba60.tar.gz opie-b7426bf997b8201667cecb0f66470e257b35ba60.tar.bz2 |
re-introduced vert scrollbar, with position options
-rw-r--r-- | core/apps/embeddedkonsole/TEWidget.cpp | 20 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 31 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.h | 4 |
3 files changed, 49 insertions, 6 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp index f10bfb2..a56dc50 100644 --- a/core/apps/embeddedkonsole/TEWidget.cpp +++ b/core/apps/embeddedkonsole/TEWidget.cpp | |||
@@ -49,8 +49,9 @@ | |||
49 | 49 | ||
50 | // #include "config.h" | 50 | // #include "config.h" |
51 | #include "TEWidget.h" | 51 | #include "TEWidget.h" |
52 | #include "session.h" | 52 | #include "session.h" |
53 | #include <qpe/config.h> | ||
53 | 54 | ||
54 | #include <qcursor.h> | 55 | #include <qcursor.h> |
55 | #include <qregexp.h> | 56 | #include <qregexp.h> |
56 | #include <qpainter.h> | 57 | #include <qpainter.h> |
@@ -151,9 +152,9 @@ const QPixmap *TEWidget::backgroundPixmap() | |||
151 | 152 | ||
152 | void TEWidget::setColorTable(const ColorEntry table[]) | 153 | void TEWidget::setColorTable(const ColorEntry table[]) |
153 | { | 154 | { |
154 | for (int i = 0; i < TABLE_COLORS; i++) color_table[i] = table[i]; | 155 | for (int i = 0; i < TABLE_COLORS; i++) color_table[i] = table[i]; |
155 | 156 | ||
156 | const QPixmap* pm = backgroundPixmap(); | 157 | const QPixmap* pm = backgroundPixmap(); |
157 | if (!pm) setBackgroundColor(color_table[DEFAULT_BACK_COLOR].color); | 158 | if (!pm) setBackgroundColor(color_table[DEFAULT_BACK_COLOR].color); |
158 | update(); | 159 | update(); |
159 | } | 160 | } |
@@ -284,9 +285,22 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) | |||
284 | 285 | ||
285 | scrollbar = new QScrollBar(this); | 286 | scrollbar = new QScrollBar(this); |
286 | scrollbar->setCursor( arrowCursor ); | 287 | scrollbar->setCursor( arrowCursor ); |
287 | connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); | 288 | connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); |
288 | scrollLoc = SCRNONE; | 289 | |
290 | Config cfg("Konsole"); | ||
291 | cfg.setGroup("ScrollBar"); | ||
292 | switch( cfg.readNumEntry("Position",2)){ | ||
293 | case 0: | ||
294 | scrollLoc = SCRNONE; | ||
295 | break; | ||
296 | case 1: | ||
297 | scrollLoc = SCRLEFT; | ||
298 | break; | ||
299 | case 2: | ||
300 | scrollLoc = SCRRIGHT; | ||
301 | break; | ||
302 | }; | ||
289 | 303 | ||
290 | blinkT = new QTimer(this); | 304 | blinkT = new QTimer(this); |
291 | connect(blinkT, SIGNAL(timeout()), this, SLOT(blinkEvent())); | 305 | connect(blinkT, SIGNAL(timeout()), this, SLOT(blinkEvent())); |
292 | // blinking = FALSE; | 306 | // blinking = FALSE; |
@@ -650,9 +664,9 @@ void TEWidget::mousePressEvent(QMouseEvent* ev) | |||
650 | { | 664 | { |
651 | emit clearSelectionSignal(); | 665 | emit clearSelectionSignal(); |
652 | iPntSel = pntSel = pos; | 666 | iPntSel = pntSel = pos; |
653 | actSel = 1; // left mouse button pressed but nothing selected yet. | 667 | actSel = 1; // left mouse button pressed but nothing selected yet. |
654 | grabMouse( /*crossCursor*/ ); // handle with care! | 668 | grabMouse( /*crossCursor*/ ); // handle with care! |
655 | } | 669 | } |
656 | else | 670 | else |
657 | { | 671 | { |
658 | emit mouseSignal( 0, pos.x() + 1, pos.y() + 1 ); // left button | 672 | emit mouseSignal( 0, pos.x() + 1, pos.y() + 1 ); // left button |
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index d54fa1f..e2d4886 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -223,9 +223,10 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
223 | fontChanged(cfont); | 223 | fontChanged(cfont); |
224 | 224 | ||
225 | configMenu = new QPopupMenu( this); | 225 | configMenu = new QPopupMenu( this); |
226 | colorMenu = new QPopupMenu( this); | 226 | colorMenu = new QPopupMenu( this); |
227 | 227 | scrollMenu = new QPopupMenu( this); | |
228 | |||
228 | bool listHidden; | 229 | bool listHidden; |
229 | cfg.setGroup("Menubar"); | 230 | cfg.setGroup("Menubar"); |
230 | if( cfg.readEntry("Hidden","FALSE") == "TRUE") { | 231 | if( cfg.readEntry("Hidden","FALSE") == "TRUE") { |
231 | configMenu->insertItem("Show command list"); | 232 | configMenu->insertItem("Show command list"); |
@@ -262,8 +263,9 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
262 | 263 | ||
263 | connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); | 264 | connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); |
264 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); | 265 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); |
265 | connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) )); | 266 | connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) )); |
267 | connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); | ||
266 | 268 | ||
267 | menuBar->insertItem( tr("Font"), fontList ); | 269 | menuBar->insertItem( tr("Font"), fontList ); |
268 | menuBar->insertItem( tr("Options"), configMenu ); | 270 | menuBar->insertItem( tr("Options"), configMenu ); |
269 | 271 | ||
@@ -315,8 +317,13 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
315 | } | 317 | } |
316 | 318 | ||
317 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); | 319 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); |
318 | 320 | ||
321 | scrollMenu->insertItem("None"); | ||
322 | scrollMenu->insertItem("Left"); | ||
323 | scrollMenu->insertItem("Right"); | ||
324 | configMenu->insertItem("ScrollBar",scrollMenu); | ||
325 | |||
319 | // create applications ///////////////////////////////////////////////////// | 326 | // create applications ///////////////////////////////////////////////////// |
320 | setCentralWidget(tab); | 327 | setCentralWidget(tab); |
321 | 328 | ||
322 | // load keymaps //////////////////////////////////////////////////////////// | 329 | // load keymaps //////////////////////////////////////////////////////////// |
@@ -762,4 +769,26 @@ void Konsole::setColor() | |||
762 | int scheme = cfg.readNumEntry("Schema",1); | 769 | int scheme = cfg.readNumEntry("Schema",1); |
763 | if(scheme != 1) colorMenuSelected( -scheme); | 770 | if(scheme != 1) colorMenuSelected( -scheme); |
764 | 771 | ||
765 | } | 772 | } |
773 | |||
774 | void Konsole::scrollMenuSelected(int index) | ||
775 | { | ||
776 | TEWidget* te = getTe(); | ||
777 | Config cfg("Konsole"); | ||
778 | cfg.setGroup("Scrollbar"); | ||
779 | switch( index){ | ||
780 | case -21: | ||
781 | te->setScrollbarLocation(0); | ||
782 | cfg.writeEntry("Position",0); | ||
783 | break; | ||
784 | case -22: | ||
785 | te->setScrollbarLocation(1); | ||
786 | cfg.writeEntry("Position",1); | ||
787 | break; | ||
788 | case -23: | ||
789 | te->setScrollbarLocation(2); | ||
790 | cfg.writeEntry("Position",2); | ||
791 | break; | ||
792 | }; | ||
793 | |||
794 | } | ||
diff --git a/core/apps/embeddedkonsole/konsole.h b/core/apps/embeddedkonsole/konsole.h index 40003d4..b4e5d87 100644 --- a/core/apps/embeddedkonsole/konsole.h +++ b/core/apps/embeddedkonsole/konsole.h | |||
@@ -69,9 +69,9 @@ private slots: | |||
69 | void hitDown(); | 69 | void hitDown(); |
70 | void switchSession(QWidget *); | 70 | void switchSession(QWidget *); |
71 | void newSession(); | 71 | void newSession(); |
72 | void changeCommand(const QString &, int); | 72 | void changeCommand(const QString &, int); |
73 | 73 | void scrollMenuSelected(int); | |
74 | private: | 74 | private: |
75 | void init(const char* _pgm, QStrList & _args); | 75 | void init(const char* _pgm, QStrList & _args); |
76 | void initSession(const char* _pgm, QStrList & _args); | 76 | void initSession(const char* _pgm, QStrList & _args); |
77 | void runSession(TESession* s); | 77 | void runSession(TESession* s); |
@@ -111,9 +111,9 @@ private: | |||
111 | int cfont; | 111 | int cfont; |
112 | QCString se_pgm; | 112 | QCString se_pgm; |
113 | QStrList se_args; | 113 | QStrList se_args; |
114 | 114 | ||
115 | QPopupMenu* fontList,*configMenu,*colorMenu; | 115 | QPopupMenu* fontList,*configMenu,*colorMenu,*scrollMenu; |
116 | QComboBox *commonCombo; | 116 | QComboBox *commonCombo; |
117 | // history scrolling I think | 117 | // history scrolling I think |
118 | bool b_scroll; | 118 | bool b_scroll; |
119 | 119 | ||