Mercurial > octave-nkf
comparison 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 |
comparison
equal
deleted
inserted
replaced
16611:999400bebe5e | 16612:dae674adf045 |
---|---|
28 class QKeyEvent; | 28 class QKeyEvent; |
29 class QPainter; | 29 class QPainter; |
30 class QPaintEvent; | 30 class QPaintEvent; |
31 class QResizeEvent; | 31 class QResizeEvent; |
32 class QWheelEvent; | 32 class QWheelEvent; |
33 class QPoint; | |
33 | 34 |
34 class QConsolePrivate; | 35 class QConsolePrivate; |
35 class QConsoleThread; | 36 class QConsoleThread; |
36 class QConsoleView; | 37 class QConsoleView; |
37 | 38 |
72 void focusInEvent (QFocusEvent*); | 73 void focusInEvent (QFocusEvent*); |
73 void focusOutEvent (QFocusEvent*); | 74 void focusOutEvent (QFocusEvent*); |
74 void keyPressEvent (QKeyEvent*); | 75 void keyPressEvent (QKeyEvent*); |
75 bool winEvent (MSG*, long*); | 76 bool winEvent (MSG*, long*); |
76 virtual void start (void); | 77 virtual void start (void); |
78 void mouseMoveEvent (QMouseEvent *event); | |
79 void mousePressEvent (QMouseEvent *event); | |
80 void mouseReleaseEvent (QMouseEvent *event); | |
77 | 81 |
78 private slots: | 82 private slots: |
79 void scrollValueChanged (int value); | 83 void scrollValueChanged (int value); |
80 void monitorConsole (void); | 84 void monitorConsole (void); |
85 void updateSelection (void); | |
81 | 86 |
82 private: | 87 private: |
83 QConsolePrivate* d; | 88 QConsolePrivate* d; |
84 }; | 89 }; |
85 | 90 |