mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Reworked file structure
This commit is contained in:
26
NuakeEditor/Source/Editor/Misc/ImGuiTextHelper.cpp
Normal file
26
NuakeEditor/Source/Editor/Misc/ImGuiTextHelper.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "ImGuiTextHelper.h"
|
||||
|
||||
#include <imgui/imgui.h>
|
||||
|
||||
void ImGuiTextSTD(const std::string& label, std::string& value)
|
||||
{
|
||||
char buffer[256];
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
strncpy_s(buffer, value.c_str(), sizeof(buffer));
|
||||
if (ImGui::InputText(label.c_str(), buffer, sizeof(buffer)))
|
||||
{
|
||||
|
||||
value = std::string(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
void ImGuiTextMultiline(const std::string& label, std::string& value)
|
||||
{
|
||||
char buffer[256];
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
strncpy_s(buffer, value.c_str(), sizeof(buffer));
|
||||
if (ImGui::InputTextMultiline(label.c_str(), buffer, sizeof(buffer)))
|
||||
{
|
||||
value = std::string(buffer);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user