ui: graphView
Added basic graph view with simple nodes (just text, no edges or anything...) fortune cookie message = Don't be afraid to take that big step.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "component/ComponentManager.h"
|
||||
|
||||
#include "component/view/CodeView.h"
|
||||
#include "component/view/GraphView.h"
|
||||
#include "component/view/ViewLayout.h"
|
||||
|
||||
std::shared_ptr<ComponentManager> ComponentManager::create(
|
||||
@@ -20,6 +21,13 @@ ComponentManager::~ComponentManager()
|
||||
|
||||
void ComponentManager::setup()
|
||||
{
|
||||
std::shared_ptr<Component> graphComponent = m_componentFactory->createGraphComponent();
|
||||
GraphView* graphView = dynamic_cast<GraphView*>(graphComponent->getView());
|
||||
graphView->addNode(Vec2i(-100, -100), "foo");
|
||||
graphView->addNode(Vec2i(50, 50), "bar");
|
||||
|
||||
m_components.push_back(graphComponent);
|
||||
|
||||
std::shared_ptr<Component> codeComponent = m_componentFactory->createCodeComponent();
|
||||
m_components.push_back(codeComponent);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user