comparison widgets/Pane.cpp @ 89:803830f186ef

* Move matrix/fft file code to fileio (from base) * Add right-button menu to panes
author Chris Cannam
date Fri, 05 May 2006 13:06:47 +0000
parents 82482231b6b1
children 453f7da3534e
comparison
equal deleted inserted replaced
88:6b864e6864cb 89:803830f186ef
477 } 477 }
478 478
479 void 479 void
480 Pane::mousePressEvent(QMouseEvent *e) 480 Pane::mousePressEvent(QMouseEvent *e)
481 { 481 {
482 if (e->buttons() & Qt::RightButton) {
483 emit rightButtonMenuRequested(mapToGlobal(e->pos()));
484 return;
485 }
486
482 m_clickPos = e->pos(); 487 m_clickPos = e->pos();
483 m_clickedInRange = true; 488 m_clickedInRange = true;
484 m_editingSelection = Selection(); 489 m_editingSelection = Selection();
485 m_editingSelectionEdge = 0; 490 m_editingSelectionEdge = 0;
486 m_shiftPressed = (e->modifiers() & Qt::ShiftModifier); 491 m_shiftPressed = (e->modifiers() & Qt::ShiftModifier);
564 } 569 }
565 570
566 void 571 void
567 Pane::mouseReleaseEvent(QMouseEvent *e) 572 Pane::mouseReleaseEvent(QMouseEvent *e)
568 { 573 {
574 if (e->buttons() & Qt::RightButton) {
575 return;
576 }
577
569 ViewManager::ToolMode mode = ViewManager::NavigateMode; 578 ViewManager::ToolMode mode = ViewManager::NavigateMode;
570 if (m_manager) mode = m_manager->getToolMode(); 579 if (m_manager) mode = m_manager->getToolMode();
571 580
572 if (m_clickedInRange) { 581 if (m_clickedInRange) {
573 mouseMoveEvent(e); 582 mouseMoveEvent(e);
659 } 668 }
660 669
661 void 670 void
662 Pane::mouseMoveEvent(QMouseEvent *e) 671 Pane::mouseMoveEvent(QMouseEvent *e)
663 { 672 {
673 if (e->buttons() & Qt::RightButton) {
674 return;
675 }
676
664 ViewManager::ToolMode mode = ViewManager::NavigateMode; 677 ViewManager::ToolMode mode = ViewManager::NavigateMode;
665 if (m_manager) mode = m_manager->getToolMode(); 678 if (m_manager) mode = m_manager->getToolMode();
666 679
667 QPoint prevPoint = m_identifyPoint; 680 QPoint prevPoint = m_identifyPoint;
668 m_identifyPoint = e->pos(); 681 m_identifyPoint = e->pos();
812 } 825 }
813 826
814 void 827 void
815 Pane::mouseDoubleClickEvent(QMouseEvent *e) 828 Pane::mouseDoubleClickEvent(QMouseEvent *e)
816 { 829 {
830 if (e->buttons() & Qt::RightButton) {
831 return;
832 }
833
817 std::cerr << "mouseDoubleClickEvent" << std::endl; 834 std::cerr << "mouseDoubleClickEvent" << std::endl;
818 835
819 m_clickPos = e->pos(); 836 m_clickPos = e->pos();
820 m_clickedInRange = true; 837 m_clickedInRange = true;
821 m_shiftPressed = (e->modifiers() & Qt::ShiftModifier); 838 m_shiftPressed = (e->modifiers() & Qt::ShiftModifier);