[rkward-cvs] SF.net SVN: rkward: [877] trunk/rkward/rkward/rkconsole.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Oct 17 15:20:40 UTC 2006


Revision: 877
          http://svn.sourceforge.net/rkward/?rev=877&view=rev
Author:   tfry
Date:     2006-10-17 08:20:33 -0700 (Tue, 17 Oct 2006)

Log Message:
-----------
Random cosmetics, and a failed attempt at preventing cursor from leaving last line

Modified Paths:
--------------
    trunk/rkward/rkward/rkconsole.cpp

Modified: trunk/rkward/rkward/rkconsole.cpp
===================================================================
--- trunk/rkward/rkward/rkconsole.cpp	2006-10-17 14:49:21 UTC (rev 876)
+++ trunk/rkward/rkward/rkconsole.cpp	2006-10-17 15:20:33 UTC (rev 877)
@@ -174,7 +174,7 @@
 	
 	if (para < doc->numLines() - 1 || pos < prefix.length ()){
 		int t=(int)pos;if(prefix.length()>pos) t=prefix.length();
-		view->	setCursorPosition (doc->numLines() -1, t);
+		view->setCursorPosition (doc->numLines() -1, t);
 		return(TRUE);
 	}
 	
@@ -257,19 +257,30 @@
 		QMouseEvent *m = (QMouseEvent *)e;
 		if (m->button() == Qt::RightButton) {
 			createPopupMenu(m->globalPos());
-			return(TRUE);
+			return (true);
 		}
-		return(FALSE);
+		return (false);
 	} else if (e->type () == QEvent::MouseButtonRelease){
 		QMouseEvent *m = (QMouseEvent *)e;
 		if (m->button() == Qt::MidButton) {
 			QClipboard *cb = QApplication::clipboard ();
 			submitBatch (cb->text (QClipboard::Selection));
 			return (true);
-		}
-		return(FALSE);
+		} /* else if (m->button () == Qt::LeftButton) {
+			// prevent cursor from leaving last line
+			uint para=0; uint p=0;
+			view->cursorPosition (&para, &p);
+			if (para != doc->numLines () - 1) {
+				int y = view->y ();
+				view->setCursorPosition (doc->numLines() -1, p);
+				int y2 = view->y ();
+				qDebug ("%d, %d", y, y2);
+				view->scroll (0, y - y2);
+			}
+		} */ // not good, yet: always jumps to bottom of view
+		return (false);
 	} else {
-		return FALSE;
+		return false;
 	}
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list