changeset 68:77e1fa5497e7

MultiPaneLayerContainer (manage several panes in the layer list) is added
author benoitrigolleau
date Wed, 13 Jun 2007 09:35:02 +0000
parents 2c011280ca0b
children 72123059fa93
files widgets/MultiPaneLayerContainer.cpp widgets/MultiPaneLayerContainer.h widgets/widgets.pro
diffstat 3 files changed, 193 insertions(+), 74 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/widgets/MultiPaneLayerContainer.cpp	Wed Jun 13 09:35:02 2007 +0000
@@ -0,0 +1,65 @@
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
+
+/*   
+Sound Access
+EASAIER client application.
+Silogic 2007. Benoit Rigolleau.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.  See the file
+COPYING included with this distribution for more information.
+*/
+
+#include "MultiPaneLayerContainer.h" 
+
+MultiPaneLayerContainer::MultiPaneLayerContainer(QWidget *parent): QWidget(parent){
+	m_map = new QMap<Pane*,PropertyStack*>();
+	m_layout = new QVBoxLayout;
+	this->setLayout(m_layout);
+}
+
+MultiPaneLayerContainer::~MultiPaneLayerContainer(){
+	
+}
+
+void MultiPaneLayerContainer::addPane(Pane *pane){
+	PropertyStack *propertyStack = new PropertyStack(0, pane);
+	connect(propertyStack, SIGNAL(removeSelectedItem()), this, SIGNAL(removeSelectedItem())); 
+	m_map->insert(pane,propertyStack);
+	m_layout->addWidget(propertyStack);
+	m_layout->setMargin(0);
+	m_layout->setSpacing(0);
+}
+
+void MultiPaneLayerContainer::removePane(Pane *pane){
+	m_layout->removeWidget(m_map->value(pane));
+	delete m_map->value(pane);
+	m_map->remove(pane);
+
+}
+
+
+//////////////////SLOTS ///////////////////////
+
+void MultiPaneLayerContainer::currentPaneChanged(Pane *pane){
+
+	QMap<Pane*,PropertyStack*>::Iterator it;
+
+	for (it = m_map->begin(); it != m_map->end(); ++it ) {
+		m_map->value(it.key())->setVisible(false);
+    }
+	if(m_map->contains(pane)){
+		m_map->value(pane)->setVisible(true);
+	}
+}
+
+void MultiPaneLayerContainer::paneAdded(Pane *pane){
+	addPane(pane);
+}
+
+void MultiPaneLayerContainer::paneRemoved(Pane *pane){
+	removePane(pane);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/widgets/MultiPaneLayerContainer.h	Wed Jun 13 09:35:02 2007 +0000
@@ -0,0 +1,51 @@
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
+
+/*   
+Sound Access
+EASAIER client application.
+Silogic 2007. Benoit Rigolleau.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.  See the file
+COPYING included with this distribution for more information.
+*/
+
+#ifndef _MULTI_PANE_LAYER_CONTAINER_H
+#define _MULTI_PANE_LAYER_CONTAINER_H
+
+#include <QWidget>
+#include <QVBoxLayout>
+#include <QMap>
+
+#include "PropertyStack.h"
+#include "view/Pane.h"
+
+
+class MultiPaneLayerContainer : public QWidget
+{
+	Q_OBJECT
+
+public :
+		virtual ~MultiPaneLayerContainer();
+		MultiPaneLayerContainer(QWidget *parent=0);
+		void addPane(Pane *pane);
+		void removePane(Pane *pane);
+
+signals:
+		void removeSelectedItem();
+
+public slots :
+	void currentPaneChanged(Pane *pane);
+	void paneAdded(Pane *pane);
+	void paneRemoved(Pane *pane);
+
+
+private :
+	QMap<Pane*,PropertyStack*> *m_map;
+	QVBoxLayout *m_layout; 
+
+};
+
+#endif
\ No newline at end of file
--- a/widgets/widgets.pro	Wed Jun 13 09:11:48 2007 +0000
+++ b/widgets/widgets.pro	Wed Jun 13 09:35:02 2007 +0000
@@ -1,74 +1,77 @@
-TEMPLATE = lib
-
-SV_UNIT_PACKAGES = vamp-hostsdk fftw3f
-load(../sv.prf)
-
-CONFIG += sv staticlib qt thread warn_on stl rtti exceptions
-QT += xml
-
-TARGET = svwidgets
-
-DEPENDPATH += . ..
-INCLUDEPATH += . .. 
-OBJECTS_DIR = tmp_obj
-MOC_DIR = tmp_moc
-
-# Input
-HEADERS += AudioDial.h \
-           Fader.h \
-           ItemEditDialog.h \
-           LayerTree.h \
-           LEDButton.h \
-           ListInputDialog.h \
-           NotifyingCheckBox.h \
-           NotifyingComboBox.h \
-           NotifyingPushButton.h \
-           NotifyingTabBar.h \
-           Panner.h \
-           PluginParameterBox.h \
-           PluginParameterDialog.h \
-           PropertyBox.h \
-           PropertyStack.h \
-           RangeInputDialog.h \
-           SubdividingMenu.h \
-           Thumbwheel.h \
-           TipDialog.h \
-           WindowShapePreview.h \
-           WindowTypeSelector.h \
-           AdvancedToolBox.h \
-           ExpandWidget.h \
-           InfoWidget.h \
-           QueryResultsWidget.h \
-           SearchWidget.h \
-           WidgetGallery.h \
-           ConnectionSettings.h \
-           ConnectionStatus.h 
-SOURCES += AudioDial.cpp \
-           Fader.cpp \
-           ItemEditDialog.cpp \
-           LayerTree.cpp \
-           LEDButton.cpp \
-           ListInputDialog.cpp \
-           NotifyingCheckBox.cpp \
-           NotifyingComboBox.cpp \
-           NotifyingPushButton.cpp \
-           NotifyingTabBar.cpp \
-           Panner.cpp \
-           PluginParameterBox.cpp \
-           PluginParameterDialog.cpp \
-           PropertyBox.cpp \
-           PropertyStack.cpp \
-           RangeInputDialog.cpp \
-           SubdividingMenu.cpp \
-           Thumbwheel.cpp \
-           TipDialog.cpp \
-           WindowShapePreview.cpp \
-           WindowTypeSelector.cpp \
-           AdvancedToolBox.cpp \
-           ExpandWidget.cpp \
-           InfoWidget.cpp \
-           QueryResultsWidget.cpp \
-           SearchWidget.cpp \
-           WidgetGallery.cpp \
-           ConnectionSettings.cpp \
-           ConnectionStatus.cpp 
+TEMPLATE = lib
+
+SV_UNIT_PACKAGES = vamp-hostsdk fftw3f
+load(../sv.prf)
+
+CONFIG += sv staticlib qt thread warn_on stl rtti exceptions
+QT += xml
+
+TARGET = svwidgets
+
+DEPENDPATH += . ..
+INCLUDEPATH += . .. 
+OBJECTS_DIR = tmp_obj
+MOC_DIR = tmp_moc
+
+# Input
+HEADERS += AudioDial.h \
+           Fader.h \
+           ItemEditDialog.h \
+           LayerTree.h \
+           LEDButton.h \
+           ListInputDialog.h \
+           NotifyingCheckBox.h \
+           NotifyingComboBox.h \
+           NotifyingPushButton.h \
+           NotifyingTabBar.h \
+           Panner.h \
+           PluginParameterBox.h \
+           PluginParameterDialog.h \
+           PropertyBox.h \
+           PropertyStack.h \
+           RangeInputDialog.h \
+           SubdividingMenu.h \
+           Thumbwheel.h \
+           TipDialog.h \
+           WindowShapePreview.h \
+           WindowTypeSelector.h \
+           AdvancedToolBox.h \
+           ExpandWidget.h \
+           InfoWidget.h \
+           QueryResultsWidget.h \
+           SearchWidget.h \
+           WidgetGallery.h \
+           ConnectionSettings.h \
+           ConnectionStatus.h \
+           MultiPaneLayerContainer.h  
+SOURCES += AudioDial.cpp \
+           Fader.cpp \
+           ItemEditDialog.cpp \
+           LayerTree.cpp \
+           LEDButton.cpp \
+           ListInputDialog.cpp \
+           NotifyingCheckBox.cpp \
+           NotifyingComboBox.cpp \
+           NotifyingPushButton.cpp \
+           NotifyingTabBar.cpp \
+           Panner.cpp \
+           PluginParameterBox.cpp \
+           PluginParameterDialog.cpp \
+           PropertyBox.cpp \
+           PropertyStack.cpp \
+           RangeInputDialog.cpp \
+           SubdividingMenu.cpp \
+           Thumbwheel.cpp \
+           TipDialog.cpp \
+           WindowShapePreview.cpp \
+           WindowTypeSelector.cpp \
+           AdvancedToolBox.cpp \
+           ExpandWidget.cpp \
+           InfoWidget.cpp \
+           QueryResultsWidget.cpp \
+           SearchWidget.cpp \
+           WidgetGallery.cpp \
+           ConnectionSettings.cpp \
+           ConnectionStatus.cpp \
+           MultiPaneLayerContainer.cpp 
+