mirror of
https://github.com/Drezil/imgui.git
synced 2025-04-01 17:02:45 +00:00
Scrollbar: horizontal scrollbar demo allows to enable simultanaeous scrollbars on both axises.
This commit is contained in:
parent
b92daf0ba2
commit
5d3d136733
@ -966,10 +966,12 @@ void ImGui::ShowTestWindow(bool* opened)
|
|||||||
{
|
{
|
||||||
ImGui::Bullet(); ImGui::TextWrapped("Horizontal scrolling for a window has to be enabled explicitly via the ImGuiWindowFlags_HorizontalScrollbar flag.");
|
ImGui::Bullet(); ImGui::TextWrapped("Horizontal scrolling for a window has to be enabled explicitly via the ImGuiWindowFlags_HorizontalScrollbar flag.");
|
||||||
ImGui::Bullet(); ImGui::TextWrapped("You may want to explicitly specify content width by calling SetNextWindowContentWidth() before Begin().");
|
ImGui::Bullet(); ImGui::TextWrapped("You may want to explicitly specify content width by calling SetNextWindowContentWidth() before Begin().");
|
||||||
|
static int lines = 7;
|
||||||
|
ImGui::SliderInt("Lines", &lines, 1, 15);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f);
|
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f));
|
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f));
|
||||||
ImGui::BeginChild("scrolling", ImVec2(0, ImGui::GetItemsLineHeightWithSpacing()*7 + 30), true, ImGuiWindowFlags_HorizontalScrollbar);
|
ImGui::BeginChild("scrolling", ImVec2(0, ImGui::GetItemsLineHeightWithSpacing()*7 + 30), true, ImGuiWindowFlags_HorizontalScrollbar);
|
||||||
for (int line = 0; line < 7; line++)
|
for (int line = 0; line < lines; line++)
|
||||||
{
|
{
|
||||||
// Display random stuff
|
// Display random stuff
|
||||||
int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3);
|
int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user