0.4.1
Loading...
Searching...
No Matches
FileMenu.cpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9#include "FileMenu.hpp"
10
11#include <imgui.h>
12#include <imgui_node_editor.h>
13
15namespace nm = NAV::NodeManager;
16
18
19#include <iostream>
20
22{
23 if (ImGui::MenuItem("New Flow", "Ctrl+N"))
24 {
26 {
27 globalAction = GlobalActions::Clear;
28 }
29 else
30 {
34 }
35 }
36 if (ImGui::MenuItem("Open Flow", "Ctrl+O"))
37 {
38 globalAction = GlobalActions::Load;
39 }
40 if (ImGui::BeginMenu("Open Recent", false))
41 {
42 ImGui::MenuItem("fish_hat.c");
43 ImGui::MenuItem("fish_hat.inl");
44 ImGui::MenuItem("fish_hat.h");
45 ImGui::MenuItem("fish_hat.h");
46 // ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 5);
47 ImGui::Separator();
48 ImGui::MenuItem("More...");
49 ImGui::EndMenu();
50 }
51 if (ImGui::MenuItem("Save", "Ctrl+S"))
52 {
53 flow::SaveFlow(globalAction);
54 }
55 if (ImGui::MenuItem("Save As..", "Ctrl+Shift+S"))
56 {
57 globalAction = GlobalActions::SaveAs;
58 }
59
60 ImGui::Separator();
61
62 if (ImGui::MenuItem("Quit", "Ctrl+Q"))
63 {
64 globalAction = GlobalActions::Quit;
65 }
66}
The File Menu.
Save/Load the Nodes.
GlobalActions
Possible Global Actions to perform in the GUI.
@ Clear
Clear the flow.
@ Quit
Quit the program.
@ Load
Load a flow.
@ SaveAs
Save the flow as filename.
Manages all Nodes.
void DeleteAllNodes()
Delete all nodes.
void SetCurrentFilename(const std::string &newFilename)
Set the current filename of the open flow.
void DiscardChanges()
Discards the unsaved changes flag. Does not really discard the changes.
bool HasUnsavedChanges()
Checks if the currently open flow has unsaved changes.
void SaveFlow(GlobalActions &globalAction)
Saves the current flow into a file.
void ShowFileMenu(GlobalActions &globalAction)
Show the file menu dropdown.
Definition FileMenu.cpp:21