Menu bar is coming

This commit is contained in:
Pcornat 2022-01-11 22:33:40 +01:00
parent 45c92db758
commit 58a16c68e4
Signed by: Pcornat
GPG Key ID: 2F3932FF46D9ECA0
3 changed files with 38 additions and 0 deletions

View File

@ -27,6 +27,7 @@ set(SOURCE_HEADERS
include/characteristic/adresse.hpp include/characteristic/adresse.hpp
include/characteristic/endurance.hpp include/characteristic/endurance.hpp
include/characteristic/chance.hpp include/characteristic/chance.hpp
include/gui/menu.hpp
) )
set(SOURCE_FILES set(SOURCE_FILES
@ -44,6 +45,7 @@ set(SOURCE_FILES
src/characteristic/adresse.cpp src/characteristic/adresse.cpp
src/characteristic/endurance.cpp src/characteristic/endurance.cpp
src/characteristic/chance.cpp src/characteristic/chance.cpp
src/gui/menu.cpp
) )
set(SOURCES set(SOURCES

23
include/gui/menu.hpp Normal file
View File

@ -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

13
src/gui/menu.cpp Normal file
View File

@ -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();
}
}