logic/ui: added CompositeView for combining Views to one DockWidget

Added CompositView, which implements both View and ViewLayout, for combining Views to one Widget. The layout can be set
to either horizontal or vertical. SearchView, RefreshView and UndoRedoView are combined to one DockWidget by the
ComponentManager now.

fortune cookie message = You'll get more secure and confident with your relationship with your co-workers.
This commit is contained in:
Eberhard Graether
2015-02-09 16:27:23 +01:00
parent 8bc11c9d9c
commit 5ecc4fb39a
43 changed files with 360 additions and 139 deletions
+19 -9
View File
@@ -1,13 +1,19 @@
#include "component/ComponentManager.h"
#include "component/view/CodeView.h"
#include "component/view/CompositeView.h"
#include "component/view/GraphView.h"
#include "component/view/RefreshView.h"
#include "component/view/SearchView.h"
#include "component/view/UndoRedoView.h"
#include "component/view/ViewFactory.h"
std::shared_ptr<ComponentManager> ComponentManager::create(
ViewFactory* viewFactory, ViewLayout* viewLayout, GraphAccess* graphAccess, LocationAccess* locationAccess
ViewFactory* viewFactory, GraphAccess* graphAccess, LocationAccess* locationAccess
){
std::shared_ptr<ComponentManager> ptr(new ComponentManager());
ptr->m_componentFactory = ComponentFactory::create(viewFactory, viewLayout, graphAccess, locationAccess);
ptr->m_componentFactory = ComponentFactory::create(viewFactory, graphAccess, locationAccess);
return ptr;
}
@@ -16,24 +22,28 @@ ComponentManager::~ComponentManager()
{
}
void ComponentManager::setup()
void ComponentManager::setup(ViewLayout* viewLayout)
{
std::shared_ptr<Component> graphComponent = m_componentFactory->createGraphComponent();
std::shared_ptr<Component> graphComponent = m_componentFactory->createGraphComponent(viewLayout);
m_components.push_back(graphComponent);
std::shared_ptr<Component> codeComponent = m_componentFactory->createCodeComponent();
std::shared_ptr<Component> codeComponent = m_componentFactory->createCodeComponent(viewLayout);
m_components.push_back(codeComponent);
std::shared_ptr<Component> undoRedoComponent = m_componentFactory->createUndoRedoComponent();
std::shared_ptr<CompositeView> compositeView =
m_componentFactory->getViewFactory()->createCompositeView(viewLayout, CompositeView::DIRECTION_HORIZONTAL);
m_views.push_back(compositeView);
std::shared_ptr<Component> undoRedoComponent = m_componentFactory->createUndoRedoComponent(compositeView.get());
m_components.push_back(undoRedoComponent);
std::shared_ptr<Component> refreshComponent = m_componentFactory->createRefreshComponent();
std::shared_ptr<Component> refreshComponent = m_componentFactory->createRefreshComponent(compositeView.get());
m_components.push_back(refreshComponent);
std::shared_ptr<Component> searchComponent = m_componentFactory->createSearchComponent();
std::shared_ptr<Component> searchComponent = m_componentFactory->createSearchComponent(compositeView.get());
m_components.push_back(searchComponent);
std::shared_ptr<Component> statusBarComponent = m_componentFactory->createStatusBarComponent();
std::shared_ptr<Component> statusBarComponent = m_componentFactory->createStatusBarComponent(viewLayout);
m_components.push_back(statusBarComponent);
}