From 1fd1e4b5f2418e3ac2909658993bfedb615537ec Mon Sep 17 00:00:00 2001 From: rtk0c Date: Thu, 6 May 2021 21:56:40 -0700 Subject: Change brace style to on new line, add initial deliveries view when an order entry is selected --- core/src/UI/UI_Workflows.cpp | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'core/src/UI/UI_Workflows.cpp') diff --git a/core/src/UI/UI_Workflows.cpp b/core/src/UI/UI_Workflows.cpp index fe504e2..108410c 100644 --- a/core/src/UI/UI_Workflows.cpp +++ b/core/src/UI/UI_Workflows.cpp @@ -17,11 +17,13 @@ namespace ImNodes = ax::NodeEditor; namespace { -class WorkflowCreationMenu { +class WorkflowCreationMenu +{ private: using WorkflowNodeConstructor = std::unique_ptr (*)(); - enum Category { + enum Category + { NumericCategory, TextCategory, DocumentsCategory, @@ -30,7 +32,8 @@ private: OutputCategory, }; - struct Candidate { + struct Candidate + { WorkflowNodeConstructor Constructor; std::string Name; Category Category; @@ -39,7 +42,10 @@ private: std::vector mCandidates; #define SUB_RANGE_ACCESS(Type, AccessorName, storage, begin, nextBegin) \ - std::span AccessorName() { return { &storage[begin], (size_t)(nextBegin - begin) }; } + std::span AccessorName() \ + { \ + return { &storage[begin], (size_t)(nextBegin - begin) }; \ + } int mTextOffset; int mDocumentOffset; @@ -57,12 +63,14 @@ private: #undef SUB_RANGE_ACCESS public: - WorkflowCreationMenu() { + WorkflowCreationMenu() + { SetupCandidates(); } private: - void SetupCandidates() { + void SetupCandidates() + { // Numeric nodes offset start at 0 mCandidates.push_back(Candidate{ .Constructor = []() -> std::unique_ptr { return std::make_unique(NumericOperationNode::Addition); }, @@ -127,21 +135,25 @@ private: } }; -class WorkflowUI { +class WorkflowUI +{ private: Workflow* mWorkflow; ImNodes::EditorContext* mContext; public: - WorkflowUI() { + WorkflowUI() + { mContext = ImNodes::CreateEditor(); } - ~WorkflowUI() { + ~WorkflowUI() + { ImNodes::DestroyEditor(mContext); } - void Draw() { + void Draw() + { ImNodes::SetCurrentEditor(mContext); ImNodes::Begin(""); @@ -164,7 +176,8 @@ public: }; } // namespace -void UI::WorkflowsTab() { +void UI::WorkflowsTab() +{ static std::unique_ptr openWorkflow; // TODO } -- cgit v1.2.3-70-g09d2