comparison base/Layer.h @ 8:214054a0d8b8

* Hook up tool selection buttons to switch the cursor mode * Implement simple and multi-selection, snapping to the resolution of the current layer. You can't actually do anything with a selection yet
author Chris Cannam
date Mon, 23 Jan 2006 17:02:57 +0000
parents 49a95b174050
children ec6886f0e673
comparison
equal deleted inserted replaced
7:49a95b174050 8:214054a0d8b8
58 } 58 }
59 59
60 virtual int getVerticalScaleWidth(QPainter &) const { return 0; } 60 virtual int getVerticalScaleWidth(QPainter &) const { return 0; }
61 virtual void paintVerticalScale(QPainter &, QRect) const { } 61 virtual void paintVerticalScale(QPainter &, QRect) const { }
62 62
63 //!!! I don't like these. The layer should return a structured
64 //string-based description list and the pane should render it
65 //itself.
66
63 virtual QRect getFeatureDescriptionRect(QPainter &, QPoint) const { 67 virtual QRect getFeatureDescriptionRect(QPainter &, QPoint) const {
64 return QRect(0, 0, 0, 0); 68 return QRect(0, 0, 0, 0);
65 } 69 }
66 virtual void paintLocalFeatureDescription(QPainter &, QRect, QPoint) const { 70 virtual void paintLocalFeatureDescription(QPainter &, QRect, QPoint) const {
67 } 71 }
72
73 //!!! We also need a method (like the vertical scale method) for
74 //drawing additional scales like a colour scale. That is, unless
75 //all applicable layers can actually do this from
76 //paintVerticalScale as well?
77
78 // Select mode:
79 //
80 //!!! Next, a method that gets the frame of the nearest feature in
81 //a particular snap direction. This would be used for selection
82 //mode, where we're selecting from the waveform based on feature
83 //location. Do we need multi-select on features as well? This is
84 //an issue; if you select a feature are you selecting that feature
85 //(in which case what do you do with it?) or a section of the
86 //underlying waveform?
87
88 virtual int getNearestFeatureFrame(int frame,
89 size_t &resolution,
90 bool snapRight = true) const {
91 resolution = 1;
92 return frame;
93 }
94
95 // Paint and edit modes:
96 //
97 // Layer needs to get actual mouse events, I guess. Paint mode is
98 // probably the easier.
99
100 // Text mode:
101 //
102 // Label nearest feature. We need to get the feature coordinates
103 // and current label from the layer, and then the pane can pop up
104 // a little text entry dialog at the right location. Or we edit
105 // in place? Probably the dialog is easier.
68 106
69 /** 107 /**
70 * This should return true if the view can safely be scrolled 108 * This should return true if the view can safely be scrolled
71 * automatically by the widget (simply copying the existing data 109 * automatically by the widget (simply copying the existing data
72 * and then refreshing the exposed area) without altering its 110 * and then refreshing the exposed area) without altering its