3 #include <spdlog/spdlog.h>
10 this->target = target;
14 this->font_size = font_size;
23 if (current_fs != font_size)
28 float wrap_width = (
width + (
x > -1 ?
x : 0)) > 480 ? (480 -
x - 10) :
width;
29 ImVec2 cpos = ImGui::GetCursorPos();
30 ImGui::PushTextWrapPos(cpos.x + wrap_width);
35 ImGui::TextWrapped(
"%d", *((
int*) target));
38 ImGui::TextWrapped(
"%ld", *((
long*) target));
41 ImGui::TextWrapped(
"%.3f", *((
float*) target));
45 ImGui::TextWrapped(
"%s", (
const char*) target);
56 spdlog::error(
"gui_observer.cpp - Unknown observed type. This can only occur on memory corruption (overflow)");
60 ImGui::PopTextWrapPos();
63 if (current_fs != font_size)
static std::unique_ptr< app_workspace > & get_instance()
Get the instance app_workspace which is a singleton.
virtual void render_element()
gui_observer(observed_type type, void *target, int x=-1, int y=-1, int width=-1, app_workspace_ns::font_size font_size=app_workspace_ns::font_size::NORMAL_FONT)
Construct a new gui observer object.
observed_type
Types, that can be observed.
font_size
This enum defines sizes of corresponding fonts. E.g.: SMALL_FONT is 12px.