mirror of
https://github.com/xemu-project/imgui.git
synced 2024-11-23 18:29:51 +00:00
Demo: using DragFloat instead of SliderFloat
This commit is contained in:
parent
e1f8fed734
commit
afa0346a0b
@ -737,22 +737,22 @@ void ImGui::ShowTestWindow(bool* opened)
|
|||||||
static float f = 0.0f;
|
static float f = 0.0f;
|
||||||
ImGui::Text("PushItemWidth(100)");
|
ImGui::Text("PushItemWidth(100)");
|
||||||
ImGui::PushItemWidth(100);
|
ImGui::PushItemWidth(100);
|
||||||
ImGui::InputFloat("float##1", &f);
|
ImGui::DragFloat("float##1", &f);
|
||||||
ImGui::PopItemWidth();
|
ImGui::PopItemWidth();
|
||||||
|
|
||||||
ImGui::Text("PushItemWidth(GetWindowWidth() * 0.5f);");
|
ImGui::Text("PushItemWidth(GetWindowWidth() * 0.5f);");
|
||||||
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.5f);
|
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.5f);
|
||||||
ImGui::InputFloat("float##2", &f);
|
ImGui::DragFloat("float##2", &f);
|
||||||
ImGui::PopItemWidth();
|
ImGui::PopItemWidth();
|
||||||
|
|
||||||
ImGui::Text("PushItemWidth(GetContentRegionAvailWidth() * 0.5f);");
|
ImGui::Text("PushItemWidth(GetContentRegionAvailWidth() * 0.5f);");
|
||||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() * 0.5f);
|
ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() * 0.5f);
|
||||||
ImGui::InputFloat("float##3", &f);
|
ImGui::DragFloat("float##3", &f);
|
||||||
ImGui::PopItemWidth();
|
ImGui::PopItemWidth();
|
||||||
|
|
||||||
ImGui::Text("PushItemWidth(-100);");
|
ImGui::Text("PushItemWidth(-100);");
|
||||||
ImGui::PushItemWidth(-100);
|
ImGui::PushItemWidth(-100);
|
||||||
ImGui::InputFloat("float##4", &f);
|
ImGui::DragFloat("float##4", &f);
|
||||||
ImGui::PopItemWidth();
|
ImGui::PopItemWidth();
|
||||||
|
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
|
Loading…
Reference in New Issue
Block a user