annotate widgets/Pane.h @ 101:0f36cdf407a6 sv1-v0.9rc1

* Make vertical scale alignment modes work in note layer as well as time-value layer, and several significant fixes to it * Make it possible to draw notes properly on the note layer * Show units (and frequencies etc in note layer's case) in the time-value and note layer description boxes * Minor fix to item edit dialog layout * Some minor menu rearrangement * Comment out a lot of debug output * Add SV website and reference URLs to Help menu, and add code to (attempt to) open them in the user's preferred browser
author Chris Cannam
date Fri, 12 May 2006 14:40:43 +0000
parents 803830f186ef
children
rev   line source
Chris@0 1
Chris@58 2 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@0 3
Chris@0 4 /*
Chris@59 5 Sonic Visualiser
Chris@59 6 An audio file viewer and annotation editor.
Chris@59 7 Centre for Digital Music, Queen Mary, University of London.
Chris@59 8 This file copyright 2006 Chris Cannam.
Chris@0 9
Chris@59 10 This program is free software; you can redistribute it and/or
Chris@59 11 modify it under the terms of the GNU General Public License as
Chris@59 12 published by the Free Software Foundation; either version 2 of the
Chris@59 13 License, or (at your option) any later version. See the file
Chris@59 14 COPYING included with this distribution for more information.
Chris@0 15 */
Chris@0 16
Chris@0 17 #ifndef _PANE_H_
Chris@0 18 #define _PANE_H_
Chris@0 19
Chris@0 20 #include <QFrame>
Chris@0 21 #include <QPoint>
Chris@0 22
Chris@0 23 #include "base/ZoomConstraint.h"
Chris@0 24 #include "base/View.h"
Chris@13 25 #include "base/Selection.h"
Chris@0 26
Chris@0 27 class QWidget;
Chris@0 28 class QPaintEvent;
Chris@0 29 class Layer;
Chris@0 30
Chris@0 31 class Pane : public View
Chris@0 32 {
Chris@0 33 Q_OBJECT
Chris@0 34
Chris@0 35 public:
Chris@0 36 Pane(QWidget *parent = 0);
Chris@34 37 virtual QString getPropertyContainerIconName() const { return "pane"; }
Chris@0 38
Chris@44 39 virtual bool shouldIlluminateLocalFeatures(const Layer *layer,
Chris@44 40 QPoint &pos) const;
Chris@42 41 virtual bool shouldIlluminateLocalSelection(QPoint &pos,
Chris@42 42 bool &closeToLeft,
Chris@44 43 bool &closeToRight) const;
Chris@0 44
Chris@0 45 void setCentreLineVisible(bool visible);
Chris@0 46 bool getCentreLineVisible() const { return m_centreLineVisible; }
Chris@0 47
Chris@8 48 virtual QString toXmlString(QString indent = "",
Chris@8 49 QString extraAttributes = "") const;
Chris@8 50
Chris@0 51 signals:
Chris@0 52 void paneInteractedWith();
Chris@89 53 void rightButtonMenuRequested(QPoint position);
Chris@0 54
Chris@13 55 public slots:
Chris@13 56 virtual void toolModeChanged();
Chris@13 57
Chris@0 58 protected:
Chris@0 59 virtual void paintEvent(QPaintEvent *e);
Chris@0 60 virtual void mousePressEvent(QMouseEvent *e);
Chris@0 61 virtual void mouseReleaseEvent(QMouseEvent *e);
Chris@0 62 virtual void mouseMoveEvent(QMouseEvent *e);
Chris@0 63 virtual void mouseDoubleClickEvent(QMouseEvent *e);
Chris@0 64 virtual void leaveEvent(QEvent *e);
Chris@0 65 virtual void wheelEvent(QWheelEvent *e);
Chris@0 66
Chris@44 67 Selection getSelectionAt(int x, bool &closeToLeft, bool &closeToRight) const;
Chris@17 68
Chris@42 69 bool editSelectionStart(QMouseEvent *e);
Chris@42 70 bool editSelectionDrag(QMouseEvent *e);
Chris@42 71 bool editSelectionEnd(QMouseEvent *e);
Chris@42 72 bool selectionIsBeingEdited() const;
Chris@42 73
Chris@0 74 bool m_identifyFeatures;
Chris@0 75 QPoint m_identifyPoint;
Chris@0 76 QPoint m_clickPos;
Chris@0 77 QPoint m_mousePos;
Chris@0 78 bool m_clickedInRange;
Chris@0 79 bool m_shiftPressed;
Chris@13 80 bool m_ctrlPressed;
Chris@17 81 bool m_navigating;
Chris@17 82 bool m_resizing;
Chris@0 83 size_t m_dragCentreFrame;
Chris@0 84 bool m_centreLineVisible;
Chris@13 85 size_t m_selectionStartFrame;
Chris@42 86 Selection m_editingSelection;
Chris@42 87 int m_editingSelectionEdge;
Chris@0 88 };
Chris@0 89
Chris@0 90 #endif
Chris@0 91