mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 03:58:47 +02:00
Merge branch 'master' into viewport
# Conflicts: # imgui.cpp # imgui.h
This commit is contained in:
@ -1276,19 +1276,20 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
if (ImGui::TreeNode("Active, Focused, Hovered & Focused Tests"))
|
||||
if (ImGui::TreeNode("Querying Status (Active/Focused/Hovered etc.)"))
|
||||
{
|
||||
// Display the value of IsItemHovered() and other common item state functions. Note that the flags can be combined.
|
||||
// (because BulletText is an item itself and that would affect the output of IsItemHovered() we pass all state in a single call to simplify the code).
|
||||
static int item_type = 1;
|
||||
static bool b = false;
|
||||
static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f };
|
||||
ImGui::RadioButton("Text", &item_type, 0); ImGui::SameLine();
|
||||
ImGui::RadioButton("Button", &item_type, 1); ImGui::SameLine();
|
||||
ImGui::RadioButton("CheckBox", &item_type, 2); ImGui::SameLine();
|
||||
ImGui::RadioButton("SliderFloat", &item_type, 3); ImGui::SameLine();
|
||||
ImGui::RadioButton("ColorEdit4", &item_type, 4); ImGui::SameLine();
|
||||
ImGui::RadioButton("Text", &item_type, 0);
|
||||
ImGui::RadioButton("Button", &item_type, 1);
|
||||
ImGui::RadioButton("CheckBox", &item_type, 2);
|
||||
ImGui::RadioButton("SliderFloat", &item_type, 3);
|
||||
ImGui::RadioButton("ColorEdit4", &item_type, 4);
|
||||
ImGui::RadioButton("ListBox", &item_type, 5);
|
||||
ImGui::Separator();
|
||||
bool ret = false;
|
||||
if (item_type == 0) { ImGui::Text("ITEM: Text"); } // Testing text items with no identifier/interaction
|
||||
if (item_type == 1) { ret = ImGui::Button("ITEM: Button"); } // Testing button
|
||||
@ -1305,9 +1306,13 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
"IsItemHovered(_AllowWhenOverlapped) = %d\n"
|
||||
"IsItemHovered(_RectOnly) = %d\n"
|
||||
"IsItemActive() = %d\n"
|
||||
"IsItemEdited() = %d\n"
|
||||
"IsItemDeactivated() = %d\n"
|
||||
"IsItemDeactivatedAfterChange() = %d\n"
|
||||
"IsItemVisible() = %d\n",
|
||||
"IsItemDeactivatedEdit() = %d\n"
|
||||
"IsItemVisible() = %d\n"
|
||||
"GetItemRectMin() = (%.1f, %.1f)\n"
|
||||
"GetItemRectMax() = (%.1f, %.1f)\n"
|
||||
"GetItemRectSize() = (%.1f, %.1f)",
|
||||
ret,
|
||||
ImGui::IsItemFocused(),
|
||||
ImGui::IsItemHovered(),
|
||||
@ -1316,9 +1321,13 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenOverlapped),
|
||||
ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly),
|
||||
ImGui::IsItemActive(),
|
||||
ImGui::IsItemEdited(),
|
||||
ImGui::IsItemDeactivated(),
|
||||
ImGui::IsItemDeactivatedAfterChange(),
|
||||
ImGui::IsItemVisible()
|
||||
ImGui::IsItemDeactivatedAfterEdit(),
|
||||
ImGui::IsItemVisible(),
|
||||
ImGui::GetItemRectMin().x, ImGui::GetItemRectMin().y,
|
||||
ImGui::GetItemRectMax().x, ImGui::GetItemRectMax().y,
|
||||
ImGui::GetItemRectSize().x, ImGui::GetItemRectSize().y
|
||||
);
|
||||
|
||||
static bool embed_all_inside_a_child_window = false;
|
||||
|
Reference in New Issue
Block a user