comparison view/Pane.cpp @ 257:1ab41ee36952

* Add a measurement mode tool -- no functionality yet
author Chris Cannam
date Wed, 13 Jun 2007 12:00:01 +0000
parents c492902dba40
children 6732a5b8a2c4
comparison
equal deleted inserted replaced
256:c492902dba40 257:1ab41ee36952
23 #include "base/CommandHistory.h" 23 #include "base/CommandHistory.h"
24 #include "layer/WaveformLayer.h" 24 #include "layer/WaveformLayer.h"
25 25
26 #include <QPaintEvent> 26 #include <QPaintEvent>
27 #include <QPainter> 27 #include <QPainter>
28 #include <QBitmap>
29 #include <QCursor>
28 #include <iostream> 30 #include <iostream>
29 #include <cmath> 31 #include <cmath>
30 32
31 //!!! for HUD -- pull out into a separate class 33 //!!! for HUD -- pull out into a separate class
32 #include <QFrame> 34 #include <QFrame>
1718 Pane::toolModeChanged() 1720 Pane::toolModeChanged()
1719 { 1721 {
1720 ViewManager::ToolMode mode = m_manager->getToolMode(); 1722 ViewManager::ToolMode mode = m_manager->getToolMode();
1721 // std::cerr << "Pane::toolModeChanged(" << mode << ")" << std::endl; 1723 // std::cerr << "Pane::toolModeChanged(" << mode << ")" << std::endl;
1722 1724
1725 static QCursor measureCursor;
1726 static bool measureCursorCreated = false;
1727
1728 if (!measureCursorCreated) {
1729 measureCursor = QCursor(QBitmap(":/icons/measure1cursor.xbm"),
1730 QBitmap(":/icons/measure1mask.xbm"),
1731 15, 14);
1732 measureCursorCreated = true;
1733 }
1734
1723 switch (mode) { 1735 switch (mode) {
1724 1736
1725 case ViewManager::NavigateMode: 1737 case ViewManager::NavigateMode:
1726 setCursor(Qt::PointingHandCursor); 1738 setCursor(Qt::PointingHandCursor);
1727 break; 1739 break;
1735 break; 1747 break;
1736 1748
1737 case ViewManager::DrawMode: 1749 case ViewManager::DrawMode:
1738 setCursor(Qt::CrossCursor); 1750 setCursor(Qt::CrossCursor);
1739 break; 1751 break;
1752
1753 case ViewManager::MeasureMode:
1754 setCursor(measureCursor);
1755 break;
1756
1740 /* 1757 /*
1741 case ViewManager::TextMode: 1758 case ViewManager::TextMode:
1742 setCursor(Qt::IBeamCursor); 1759 setCursor(Qt::IBeamCursor);
1743 break; 1760 break;
1744 */ 1761 */