comparison view/Pane.cpp @ 341:998786b3174f

...
author Chris Cannam
date Fri, 14 Dec 2007 14:17:05 +0000
parents ac954fc0ec6f
children 1b6879d03cb6
comparison
equal deleted inserted replaced
340:ffa448b0e1bc 341:998786b3174f
1209 emit contextHelpChanged(""); 1209 emit contextHelpChanged("");
1210 emit rightButtonMenuRequested(mapToGlobal(e->pos())); 1210 emit rightButtonMenuRequested(mapToGlobal(e->pos()));
1211 return; 1211 return;
1212 } 1212 }
1213 1213
1214 std::cerr << "mousePressEvent" << std::endl;
1215
1216
1217 //!!! need to avoid spurious mouse events when e.g. double-clicking.
1218
1219 // when double clicking, we get:
1220 // mousePressEvent
1221 // mouseReleaseEvent
1222 // mouseMoveEvent <- called from mouseReleaseEvent
1223 // mouseDoubleClickEvent
1224 // mouseReleaseEvent
1225 // mouseMoveEvent <- called from mouseReleaseEvent
1226
1227 // so we set a timer on the first press, if we're in a mode in
1228 // which moving the mouse will do something
1229
1230 // the move method doesn't do anything unless that timer has
1231 // elapsed
1232
1233
1214 m_clickPos = e->pos(); 1234 m_clickPos = e->pos();
1215 m_mousePos = m_clickPos; 1235 m_mousePos = m_clickPos;
1216 m_clickedInRange = true; 1236 m_clickedInRange = true;
1217 m_editingSelection = Selection(); 1237 m_editingSelection = Selection();
1218 m_editingSelectionEdge = 0; 1238 m_editingSelectionEdge = 0;
1327 { 1347 {
1328 if (e->buttons() & Qt::RightButton) { 1348 if (e->buttons() & Qt::RightButton) {
1329 return; 1349 return;
1330 } 1350 }
1331 1351
1352 std::cerr << "mouseReleaseEvent" << std::endl;
1353
1332 ViewManager::ToolMode mode = ViewManager::NavigateMode; 1354 ViewManager::ToolMode mode = ViewManager::NavigateMode;
1333 if (m_manager) mode = m_manager->getToolMode(); 1355 if (m_manager) mode = m_manager->getToolMode();
1334 1356
1335 if (m_clickedInRange) { 1357 if (m_clickedInRange) {
1336 mouseMoveEvent(e); 1358 mouseMoveEvent(e);
1423 Pane::mouseMoveEvent(QMouseEvent *e) 1445 Pane::mouseMoveEvent(QMouseEvent *e)
1424 { 1446 {
1425 if (e->buttons() & Qt::RightButton) { 1447 if (e->buttons() & Qt::RightButton) {
1426 return; 1448 return;
1427 } 1449 }
1450
1451 std::cerr << "mouseMoveEvent" << std::endl;
1452
1453 //!!! if no buttons pressed, and not called from
1454 //mouseReleaseEvent, we want to reset clicked-ness (to avoid
1455 //annoying continual drags when we moved the mouse outside the
1456 //window after pressing button first time).
1428 1457
1429 updateContextHelp(&e->pos()); 1458 updateContextHelp(&e->pos());
1430 1459
1431 ViewManager::ToolMode mode = ViewManager::NavigateMode; 1460 ViewManager::ToolMode mode = ViewManager::NavigateMode;
1432 if (m_manager) mode = m_manager->getToolMode(); 1461 if (m_manager) mode = m_manager->getToolMode();
1797 { 1826 {
1798 if (e->buttons() & Qt::RightButton) { 1827 if (e->buttons() & Qt::RightButton) {
1799 return; 1828 return;
1800 } 1829 }
1801 1830
1802 // std::cerr << "mouseDoubleClickEvent" << std::endl; 1831 std::cerr << "mouseDoubleClickEvent" << std::endl;
1803 1832
1804 m_clickPos = e->pos(); 1833 m_clickPos = e->pos();
1805 m_clickedInRange = true; 1834 m_clickedInRange = true;
1806 m_shiftPressed = (e->modifiers() & Qt::ShiftModifier); 1835 m_shiftPressed = (e->modifiers() & Qt::ShiftModifier);
1807 m_ctrlPressed = (e->modifiers() & Qt::ControlModifier); 1836 m_ctrlPressed = (e->modifiers() & Qt::ControlModifier);