add base dialogs

This commit is contained in:
chatlanin
2023-03-13 13:29:59 +03:00
parent 44ed461df9
commit 681327e663
13 changed files with 431 additions and 28 deletions

View File

@@ -0,0 +1,55 @@
#pragma once
#include "try_engine/try_engine.hpp"
#include "rrr/content/content.hpp"
namespace rrr::layers::gui
{
class dialogs : public try_engine::layer
{
using font_type = try_engine::style::fonts::font_type;
BASE_TYPE_DEFINE();
public:
CONSTRUCT_IMPL(dialogs);
public:
BASE_OVERIDE_IMPL();
public:
SET_EVENT_MANAGER_IMPL();
void set_content(content* c) { };
private:
FLAGS_STRUCT_DEFINED();
bool show = false;
event_manager* em;
float width = 0.f;
float height = 0.f;
bool delete_dialog = false;
bool create_dialog = false;
file current_file;
bool shift = false;
std::string title;
private:
ImGuiIO& io = ImGui::GetIO();
ImFontAtlas* atlas = io.Fonts;
ImFont* font;
private:
void resize();
void cancel();
void draw_delete_dialog();
void draw_create_dialog();
void create_file();
void pressed(system_event& e);
void released(system_event& e);
};
}