From 58a16c68e48202466dc6d38bbd52e5f312ec4b09 Mon Sep 17 00:00:00 2001 From: Pcornat Date: Tue, 11 Jan 2022 22:33:40 +0100 Subject: [PATCH] Menu bar is coming --- CMakeLists.txt | 2 ++ include/gui/menu.hpp | 23 +++++++++++++++++++++++ src/gui/menu.cpp | 13 +++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 include/gui/menu.hpp create mode 100644 src/gui/menu.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index d095263..a2bbd96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ set(SOURCE_HEADERS include/characteristic/adresse.hpp include/characteristic/endurance.hpp include/characteristic/chance.hpp + include/gui/menu.hpp ) set(SOURCE_FILES @@ -44,6 +45,7 @@ set(SOURCE_FILES src/characteristic/adresse.cpp src/characteristic/endurance.cpp src/characteristic/chance.cpp + src/gui/menu.cpp ) set(SOURCES diff --git a/include/gui/menu.hpp b/include/gui/menu.hpp new file mode 100644 index 0000000..3575d8b --- /dev/null +++ b/include/gui/menu.hpp @@ -0,0 +1,23 @@ +#ifndef BILLYSHEET_MENU_HPP +#define BILLYSHEET_MENU_HPP + + +namespace gui { + class GuiData; + + class Menu final { + private: + GuiData &data; + public: + Menu() noexcept = delete; + + explicit Menu(GuiData &data) noexcept: data(data) {} + + ~Menu() noexcept = default; + + void gui() const noexcept; + }; +} + + +#endif //BILLYSHEET_MENU_HPP diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp new file mode 100644 index 0000000..0b2a620 --- /dev/null +++ b/src/gui/menu.cpp @@ -0,0 +1,13 @@ +#include "gui/menu.hpp" +#include "imgui.h" + +void gui::Menu::gui() const noexcept { + if (ImGui::BeginMainMenuBar()) { + if (ImGui::BeginMenu("File")) { + + + ImGui::EndMenu(); + } + ImGui::EndMainMenuBar(); + } +}