Mercurial > hg > svgui
changeset 341:998786b3174f
...
author | Chris Cannam |
---|---|
date | Fri, 14 Dec 2007 14:17:05 +0000 |
parents | ffa448b0e1bc |
children | a904364dfb6e |
files | view/Pane.cpp |
diffstat | 1 files changed, 30 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/view/Pane.cpp Thu Dec 13 17:14:33 2007 +0000 +++ b/view/Pane.cpp Fri Dec 14 14:17:05 2007 +0000 @@ -1211,6 +1211,26 @@ return; } + std::cerr << "mousePressEvent" << std::endl; + + + //!!! need to avoid spurious mouse events when e.g. double-clicking. + + // when double clicking, we get: + // mousePressEvent + // mouseReleaseEvent + // mouseMoveEvent <- called from mouseReleaseEvent + // mouseDoubleClickEvent + // mouseReleaseEvent + // mouseMoveEvent <- called from mouseReleaseEvent + + // so we set a timer on the first press, if we're in a mode in + // which moving the mouse will do something + + // the move method doesn't do anything unless that timer has + // elapsed + + m_clickPos = e->pos(); m_mousePos = m_clickPos; m_clickedInRange = true; @@ -1329,6 +1349,8 @@ return; } + std::cerr << "mouseReleaseEvent" << std::endl; + ViewManager::ToolMode mode = ViewManager::NavigateMode; if (m_manager) mode = m_manager->getToolMode(); @@ -1426,6 +1448,13 @@ return; } + std::cerr << "mouseMoveEvent" << std::endl; + + //!!! if no buttons pressed, and not called from + //mouseReleaseEvent, we want to reset clicked-ness (to avoid + //annoying continual drags when we moved the mouse outside the + //window after pressing button first time). + updateContextHelp(&e->pos()); ViewManager::ToolMode mode = ViewManager::NavigateMode; @@ -1799,7 +1828,7 @@ return; } -// std::cerr << "mouseDoubleClickEvent" << std::endl; + std::cerr << "mouseDoubleClickEvent" << std::endl; m_clickPos = e->pos(); m_clickedInRange = true;