diff libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h @ 16612:dae674adf045

handle text selection in GUI terminal for Windows * QWinTerminalImpl.h, QWinTerminalImpl.cpp (QConsolePrivate::posToCell, QConsolePrivate::getSelection, QConsolePrivate::updateSelection): QWinTerminalImpl::mouseMoveEvent, QWinTerminalImpl::mousePressEvent, QWinTerminalImpl::updateSelection QWinTerminalImpl::mouseReleaseEvent): New functions. (QConsolePrivate::m_beginSelection, QConsolePrivate::m_endSelection, QConsolePrivate::m_selection): New variables. (maybeSwapPoints): New static function. (QConsolePrivate::QConsolePrivate): Initialize m_beginSelection and m_endSelection. (QWinTerminalImpl::viewPaintEvent): Draw an overlay for the selection. (QWinTerminalImpl::copyClipboard): Save selection to clipboard. (QWinTerminalImpl::pasteClipboard): Send clipboard text to terminal. Thanks to Michael Goffioul for help with this patch, especially the QConsolePrivate::getSelection function.
author John W. Eaton <jwe@octave.org>
date Sun, 05 May 2013 02:51:49 -0400
parents 739d7eb97b85
children 818eef7b2618
line wrap: on
line diff
--- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h	Sat May 04 23:37:27 2013 +0200
+++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h	Sun May 05 02:51:49 2013 -0400
@@ -30,6 +30,7 @@
 class QPaintEvent;
 class QResizeEvent;
 class QWheelEvent;
+class QPoint;
 
 class QConsolePrivate;
 class QConsoleThread;
@@ -74,10 +75,14 @@
   void keyPressEvent (QKeyEvent*);
   bool winEvent (MSG*, long*);
   virtual void start (void);
+  void mouseMoveEvent (QMouseEvent *event);
+  void mousePressEvent (QMouseEvent *event);
+  void mouseReleaseEvent (QMouseEvent *event);
 
 private slots:
   void scrollValueChanged (int value);
   void monitorConsole (void);
+  void updateSelection (void);
 
 private:
   QConsolePrivate* d;