mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Added TextDisabled(), TextDisabledV() helpers.
This commit is contained in:
parent
3a6e6645e6
commit
15113f682e
18
imgui.cpp
18
imgui.cpp
@ -4593,6 +4593,21 @@ void ImGui::TextColored(const ImVec4& col, const char* fmt, ...)
|
|||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ImGui::TextDisabledV(const char* fmt, va_list args)
|
||||||
|
{
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, GImGui->Style.Colors[ImGuiCol_TextDisabled]);
|
||||||
|
TextV(fmt, args);
|
||||||
|
ImGui::PopStyleColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGui::TextDisabled(const char* fmt, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
va_start(args, fmt);
|
||||||
|
TextDisabledV(fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
void ImGui::TextWrappedV(const char* fmt, va_list args)
|
void ImGui::TextWrappedV(const char* fmt, va_list args)
|
||||||
{
|
{
|
||||||
ImGui::PushTextWrapPos(0.0f);
|
ImGui::PushTextWrapPos(0.0f);
|
||||||
@ -10382,6 +10397,7 @@ void ImGui::ShowTestWindow(bool* opened)
|
|||||||
// Using shortcut. You can use PushStyleColor()/PopStyleColor() for more flexibility.
|
// Using shortcut. You can use PushStyleColor()/PopStyleColor() for more flexibility.
|
||||||
ImGui::TextColored(ImVec4(1.0f,0.0f,1.0f,1.0f), "Pink");
|
ImGui::TextColored(ImVec4(1.0f,0.0f,1.0f,1.0f), "Pink");
|
||||||
ImGui::TextColored(ImVec4(1.0f,1.0f,0.0f,1.0f), "Yellow");
|
ImGui::TextColored(ImVec4(1.0f,1.0f,0.0f,1.0f), "Yellow");
|
||||||
|
ImGui::TextDisabled("Disabled");
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10663,7 +10679,7 @@ void ImGui::ShowTestWindow(bool* opened)
|
|||||||
static int i2=42;
|
static int i2=42;
|
||||||
ImGui::DragInt("drag int", &i1, 1);
|
ImGui::DragInt("drag int", &i1, 1);
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::TextColored(ImColor(170,170,170,255), "(?)");
|
ImGui::TextDisabled("(?)");
|
||||||
if (ImGui::IsItemHovered())
|
if (ImGui::IsItemHovered())
|
||||||
ImGui::SetTooltip("Click and drag to edit value.\nHold SHIFT/ALT for faster/slower edit.\nDouble-click or CTRL+click to input text");
|
ImGui::SetTooltip("Click and drag to edit value.\nHold SHIFT/ALT for faster/slower edit.\nDouble-click or CTRL+click to input text");
|
||||||
|
|
||||||
|
2
imgui.h
2
imgui.h
@ -215,6 +215,8 @@ namespace ImGui
|
|||||||
IMGUI_API void TextV(const char* fmt, va_list args);
|
IMGUI_API void TextV(const char* fmt, va_list args);
|
||||||
IMGUI_API void TextColored(const ImVec4& col, const char* fmt, ...); // shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();
|
IMGUI_API void TextColored(const ImVec4& col, const char* fmt, ...); // shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();
|
||||||
IMGUI_API void TextColoredV(const ImVec4& col, const char* fmt, va_list args);
|
IMGUI_API void TextColoredV(const ImVec4& col, const char* fmt, va_list args);
|
||||||
|
IMGUI_API void TextDisabled(const char* fmt, ...); // shortcut for PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); Text(fmt, ...); PopStyleColor();
|
||||||
|
IMGUI_API void TextDisabledV(const char* fmt, va_list args);
|
||||||
IMGUI_API void TextWrapped(const char* fmt, ...); // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();
|
IMGUI_API void TextWrapped(const char* fmt, ...); // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();
|
||||||
IMGUI_API void TextWrappedV(const char* fmt, va_list args);
|
IMGUI_API void TextWrappedV(const char* fmt, va_list args);
|
||||||
IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // doesn't require null terminated string if 'text_end' is specified. no copy done to any bounded stack buffer, recommended for long chunks of text
|
IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // doesn't require null terminated string if 'text_end' is specified. no copy done to any bounded stack buffer, recommended for long chunks of text
|
||||||
|
Loading…
Reference in New Issue
Block a user