diff main/MainWindow.cpp @ 227:718aaac046e7

* Update overview when current pane changes
author Chris Cannam
date Tue, 11 Dec 2007 17:36:56 +0000
parents d7ded015af32
children b99c6449c2ed
line wrap: on
line diff
--- a/main/MainWindow.cpp	Tue Dec 11 17:36:22 2007 +0000
+++ b/main/MainWindow.cpp	Tue Dec 11 17:36:56 2007 +0000
@@ -3119,6 +3119,25 @@
 }
 
 void
+MainWindow::currentPaneChanged(Pane *pane)
+{
+    if (!pane || !m_panLayer) return;
+    for (int i = pane->getLayerCount(); i > 0; ) {
+        --i;
+        Layer *layer = pane->getLayer(i);
+        if (LayerFactory::getInstance()->getLayerType(layer) ==
+            LayerFactory::Waveform) {
+            RangeSummarisableTimeValueModel *tvm = 
+                dynamic_cast<RangeSummarisableTimeValueModel *>(layer->getModel());
+            if (tvm) {
+                m_panLayer->setModel(tvm);
+                return;
+            }
+        }
+    }
+}
+
+void
 MainWindow::updateVisibleRangeDisplay(Pane *p) const
 {
     if (!getMainModel() || !p) {