MuseScore  3.4
Music composition and notation
navigator.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Linux Music Score Editor
4 //
5 // Copyright (C) 2002-2009 Werner Schweer and others
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __NAVIGATOR_H__
21 #define __NAVIGATOR_H__
22 
23 namespace Ms {
24 
25 class Score;
26 class ScoreView;
27 class Page;
28 class Navigator;
29 
30 //---------------------------------------------------------
31 // NScrollArea
32 // modified QScrollArea for Navigator
33 //---------------------------------------------------------
34 
35 class NScrollArea : public QScrollArea {
36  Q_OBJECT
37 
38  virtual void resizeEvent(QResizeEvent*);
39 
40  public:
41  NScrollArea(QWidget* w = 0);
42  void orientationChanged();
43  };
44 
45 //---------------------------------------------------------
46 // ViewRect
47 //---------------------------------------------------------
48 
49 class ViewRect : public QWidget {
50  Q_OBJECT
51 
52  virtual void paintEvent(QPaintEvent*);
53 
54  public:
55  ViewRect(QWidget* w = 0);
56  };
57 
58 
59 //---------------------------------------------------------
60 // Navigator
61 //---------------------------------------------------------
62 
63 class Navigator : public QWidget {
64  Q_OBJECT
65 
68  QPointer<ScoreView> _cv;
69 
71  QPoint startMove;
72  QTransform matrix;
74 
75  void rescale();
76 
77  virtual void paintEvent(QPaintEvent*);
78  virtual void mousePressEvent(QMouseEvent*);
79  virtual void mouseMoveEvent(QMouseEvent*);
80  virtual void resizeEvent(QResizeEvent*);
81 
82  public slots:
83  void updateViewRect();
84  void layoutChanged();
85 
86  signals:
87  void viewRectMoved(const QRectF&);
88 
89  public:
90  Navigator(NScrollArea* sa, QWidget* parent = 0);
91  void setScoreView(ScoreView*);
92  void setScore(Score*);
93  void setPreviewOnly(bool b) { _previewOnly = b; }
94  Score* score() const { return _score; }
95  void setViewRect(const QRectF& r);
96  };
97 
98 
99 } // namespace Ms
100 #endif
101 
void orientationChanged()
Definition: navigator.cpp:58
Definition: navigator.h:63
Definition: navigator.h:35
Definition: scoreview.h:90
QPointer< ScoreView > _cv
Definition: navigator.h:68
Definition: score.h:391
NScrollArea * scrollArea
Definition: navigator.h:67
QTransform matrix
Definition: navigator.h:72
ViewRect * viewRect
Definition: navigator.h:70
Definition: aeolus.cpp:26
QPoint startMove
Definition: navigator.h:71
Score * _score
Definition: navigator.h:66
Definition: navigator.h:49
bool _previewOnly
Definition: navigator.h:73
Score * score() const
Definition: navigator.h:94
void setPreviewOnly(bool b)
Definition: navigator.h:93
virtual void resizeEvent(QResizeEvent *)
Definition: navigator.cpp:74
NScrollArea(QWidget *w=0)
Definition: navigator.cpp:44