From 4dbd495012034263fea309752ef738eb2833af0c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 01:09:58 +0000 Subject: [PATCH 1/3] Initial plan From b7a2df737223ccc7402ce9bdf3d4d88f09cce64a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 01:17:04 +0000 Subject: [PATCH 2/3] Wrap demo tab content in BeginChild() to keep tabs visible when scrolling Co-authored-by: matt-edmondson <19528727+matt-edmondson@users.noreply.github.com> --- .../ImGuiAppDemo/Demos/AdvancedWidgetsDemo.cs | 5 + examples/ImGuiAppDemo/Demos/AnimationDemo.cs | 50 ++++--- .../ImGuiAppDemo/Demos/BasicWidgetsDemo.cs | 112 +++++++------- .../ImGuiAppDemo/Demos/CleanImNodesDemo.cs | 26 ++-- .../Demos/DataVisualizationDemo.cs | 70 ++++----- examples/ImGuiAppDemo/Demos/GraphicsDemo.cs | 106 ++++++------- examples/ImGuiAppDemo/Demos/ImGuizmoDemo.cs | 140 +++++++++--------- examples/ImGuiAppDemo/Demos/ImNodesDemo.cs | 12 +- examples/ImGuiAppDemo/Demos/ImPlotDemo.cs | 112 +++++++------- .../ImGuiAppDemo/Demos/InputHandlingDemo.cs | 98 ++++++------ examples/ImGuiAppDemo/Demos/LayoutDemo.cs | 8 +- examples/ImGuiAppDemo/Demos/NerdFontDemo.cs | 114 +++++++------- examples/ImGuiAppDemo/Demos/UnicodeDemo.cs | 66 +++++---- examples/ImGuiAppDemo/Demos/UtilityDemo.cs | 90 +++++------ 14 files changed, 533 insertions(+), 476 deletions(-) diff --git a/examples/ImGuiAppDemo/Demos/AdvancedWidgetsDemo.cs b/examples/ImGuiAppDemo/Demos/AdvancedWidgetsDemo.cs index e6d3c0f2..38ee28ae 100644 --- a/examples/ImGuiAppDemo/Demos/AdvancedWidgetsDemo.cs +++ b/examples/ImGuiAppDemo/Demos/AdvancedWidgetsDemo.cs @@ -24,6 +24,8 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { + if (ImGui.BeginChild("##content")) + { // Color controls ImGui.SeparatorText("Color Controls:"); ImGui.ColorEdit3("Color RGB", ref colorPickerValue); @@ -83,6 +85,9 @@ public void Render() } } + } + ImGui.EndChild(); + ImGui.EndTabItem(); } } diff --git a/examples/ImGuiAppDemo/Demos/AnimationDemo.cs b/examples/ImGuiAppDemo/Demos/AnimationDemo.cs index 661cc905..f0d442e5 100644 --- a/examples/ImGuiAppDemo/Demos/AnimationDemo.cs +++ b/examples/ImGuiAppDemo/Demos/AnimationDemo.cs @@ -34,36 +34,40 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - ImGui.SeparatorText("Animation Examples:"); + if (ImGui.BeginChild("##content")) + { + ImGui.SeparatorText("Animation Examples:"); - // Simple animations - ImGui.Text("Bouncing Animation:"); - Vector2 ballPos = ImGui.GetCursorScreenPos(); - ballPos.Y += bounceOffset; - ImDrawListPtr drawList = ImGui.GetWindowDrawList(); - drawList.AddCircleFilled(ballPos + new Vector2(50, 50), 20, ImGui.ColorConvertFloat4ToU32(new Vector4(1, 0.5f, 0, 1))); - ImGui.Dummy(new Vector2(100, 100)); + // Simple animations + ImGui.Text("Bouncing Animation:"); + Vector2 ballPos = ImGui.GetCursorScreenPos(); + ballPos.Y += bounceOffset; + ImDrawListPtr drawList = ImGui.GetWindowDrawList(); + drawList.AddCircleFilled(ballPos + new Vector2(50, 50), 20, ImGui.ColorConvertFloat4ToU32(new Vector4(1, 0.5f, 0, 1))); + ImGui.Dummy(new Vector2(100, 100)); - // Pulsing element - ImGui.Text("Pulse Animation:"); - Vector2 pulsePos = ImGui.GetCursorScreenPos(); - float pulseSize = 20 * pulseScale; - drawList.AddCircleFilled(pulsePos + new Vector2(50, 50), pulseSize, - ImGui.ColorConvertFloat4ToU32(new Vector4(0.5f, 0, 1, 0.7f))); - ImGui.Dummy(new Vector2(100, 100)); + // Pulsing element + ImGui.Text("Pulse Animation:"); + Vector2 pulsePos = ImGui.GetCursorScreenPos(); + float pulseSize = 20 * pulseScale; + drawList.AddCircleFilled(pulsePos + new Vector2(50, 50), pulseSize, + ImGui.ColorConvertFloat4ToU32(new Vector4(0.5f, 0, 1, 0.7f))); + ImGui.Dummy(new Vector2(100, 100)); - ImGui.SeparatorText("Animated Text:"); - ImGui.SliderFloat("Text Speed", ref textSpeed, 10.0f, 200.0f); + ImGui.SeparatorText("Animated Text:"); + ImGui.SliderFloat("Text Speed", ref textSpeed, 10.0f, 200.0f); - for (int i = 0; i < 20; i++) - { - float wave = (MathF.Sin((animationTime * 3.0f) + (i * 0.5f)) * 0.5f) + 0.5f; - ImGui.TextColored(new Vector4(wave, 1.0f - wave, 0.5f, 1.0f), i % 5 == 4 ? " " : "▓"); - if (i % 5 != 4) + for (int i = 0; i < 20; i++) { - ImGui.SameLine(); + float wave = (MathF.Sin((animationTime * 3.0f) + (i * 0.5f)) * 0.5f) + 0.5f; + ImGui.TextColored(new Vector4(wave, 1.0f - wave, 0.5f, 1.0f), i % 5 == 4 ? " " : "▓"); + if (i % 5 != 4) + { + ImGui.SameLine(); + } } } + ImGui.EndChild(); ImGui.EndTabItem(); } diff --git a/examples/ImGuiAppDemo/Demos/BasicWidgetsDemo.cs b/examples/ImGuiAppDemo/Demos/BasicWidgetsDemo.cs index 2d2c741c..2eb69af9 100644 --- a/examples/ImGuiAppDemo/Demos/BasicWidgetsDemo.cs +++ b/examples/ImGuiAppDemo/Demos/BasicWidgetsDemo.cs @@ -37,62 +37,66 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - ImGui.TextWrapped("This tab demonstrates basic ImGui widgets and controls."); - - // Buttons - ImGui.SeparatorText("Buttons:"); - if (ImGui.Button("Regular Button")) - { - counter++; - } - - ImGui.SameLine(); - if (ImGui.SmallButton("Small")) + if (ImGui.BeginChild("##content")) { - counter++; + ImGui.TextWrapped("This tab demonstrates basic ImGui widgets and controls."); + + // Buttons + ImGui.SeparatorText("Buttons:"); + if (ImGui.Button("Regular Button")) + { + counter++; + } + + ImGui.SameLine(); + if (ImGui.SmallButton("Small")) + { + counter++; + } + + ImGui.SameLine(); + if (ImGui.ArrowButton("##left", ImGuiDir.Left)) + { + counter--; + } + + ImGui.SameLine(); + if (ImGui.ArrowButton("##right", ImGuiDir.Right)) + { + counter++; + } + + ImGui.SameLine(); + ImGui.Text($"Counter: {counter}"); + + // Checkboxes and Radio buttons + ImGui.SeparatorText("Selection Controls"); + ImGui.Checkbox("Checkbox", ref checkboxState); + + ImGui.RadioButton("Option 1", ref radioSelection, 0); + ImGui.SameLine(); + ImGui.RadioButton("Option 2", ref radioSelection, 1); + ImGui.SameLine(); + ImGui.RadioButton("Option 3", ref radioSelection, 2); + + // Sliders + ImGui.SeparatorText("Sliders"); + ImGui.SliderFloat("Float Slider", ref sliderValue, 0.0f, 1.0f); + ImGui.SliderFloat("Angle", ref angle, 0.0f, 360.0f, "%.1f deg"); + ImGui.SliderInt("Int Slider", ref dragInt, 0, 100); + + // Input fields + ImGui.SeparatorText("Input Fields"); + ImGui.InputText("Text Input", ref inputText, 100); + ImGui.InputFloat("Float Input", ref dragFloat); + ImGui.InputFloat3("Vector3 Input", ref dragVector); + + // Combo boxes + ImGui.SeparatorText("Dropdowns"); + ImGui.Combo("Combo Box", ref comboSelection, comboItems, comboItems.Length); + ImGui.ListBox("List Box", ref listboxSelection, listboxItems, listboxItems.Length, 4); } - - ImGui.SameLine(); - if (ImGui.ArrowButton("##left", ImGuiDir.Left)) - { - counter--; - } - - ImGui.SameLine(); - if (ImGui.ArrowButton("##right", ImGuiDir.Right)) - { - counter++; - } - - ImGui.SameLine(); - ImGui.Text($"Counter: {counter}"); - - // Checkboxes and Radio buttons - ImGui.SeparatorText("Selection Controls"); - ImGui.Checkbox("Checkbox", ref checkboxState); - - ImGui.RadioButton("Option 1", ref radioSelection, 0); - ImGui.SameLine(); - ImGui.RadioButton("Option 2", ref radioSelection, 1); - ImGui.SameLine(); - ImGui.RadioButton("Option 3", ref radioSelection, 2); - - // Sliders - ImGui.SeparatorText("Sliders"); - ImGui.SliderFloat("Float Slider", ref sliderValue, 0.0f, 1.0f); - ImGui.SliderFloat("Angle", ref angle, 0.0f, 360.0f, "%.1f deg"); - ImGui.SliderInt("Int Slider", ref dragInt, 0, 100); - - // Input fields - ImGui.SeparatorText("Input Fields"); - ImGui.InputText("Text Input", ref inputText, 100); - ImGui.InputFloat("Float Input", ref dragFloat); - ImGui.InputFloat3("Vector3 Input", ref dragVector); - - // Combo boxes - ImGui.SeparatorText("Dropdowns"); - ImGui.Combo("Combo Box", ref comboSelection, comboItems, comboItems.Length); - ImGui.ListBox("List Box", ref listboxSelection, listboxItems, listboxItems.Length, 4); + ImGui.EndChild(); ImGui.EndTabItem(); } diff --git a/examples/ImGuiAppDemo/Demos/CleanImNodesDemo.cs b/examples/ImGuiAppDemo/Demos/CleanImNodesDemo.cs index 54053a39..70015fd1 100644 --- a/examples/ImGuiAppDemo/Demos/CleanImNodesDemo.cs +++ b/examples/ImGuiAppDemo/Demos/CleanImNodesDemo.cs @@ -58,20 +58,24 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - // Create horizontal layout: editor on left, controls on right - ImGui.BeginTable("CleanNodeEditorLayout", 2, ImGuiTableFlags.Resizable | ImGuiTableFlags.BordersInnerV); - ImGui.TableSetupColumn("Editor", ImGuiTableColumnFlags.WidthStretch, 0.7f); - ImGui.TableSetupColumn("Controls", ImGuiTableColumnFlags.WidthStretch, 0.3f); + if (ImGui.BeginChild("##content")) + { + // Create horizontal layout: editor on left, controls on right + ImGui.BeginTable("CleanNodeEditorLayout", 2, ImGuiTableFlags.Resizable | ImGuiTableFlags.BordersInnerV); + ImGui.TableSetupColumn("Editor", ImGuiTableColumnFlags.WidthStretch, 0.7f); + ImGui.TableSetupColumn("Controls", ImGuiTableColumnFlags.WidthStretch, 0.3f); - // Editor column - ImGui.TableNextColumn(); - RenderNodeEditor(); + // Editor column + ImGui.TableNextColumn(); + RenderNodeEditor(); - // Controls column - ImGui.TableNextColumn(); - RenderControlsPanel(); + // Controls column + ImGui.TableNextColumn(); + RenderControlsPanel(); - ImGui.EndTable(); + ImGui.EndTable(); + } + ImGui.EndChild(); ImGui.EndTabItem(); } diff --git a/examples/ImGuiAppDemo/Demos/DataVisualizationDemo.cs b/examples/ImGuiAppDemo/Demos/DataVisualizationDemo.cs index d0ca9c3e..45658444 100644 --- a/examples/ImGuiAppDemo/Demos/DataVisualizationDemo.cs +++ b/examples/ImGuiAppDemo/Demos/DataVisualizationDemo.cs @@ -40,46 +40,50 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - ImGui.SeparatorText("Real-time Data Plots:"); - - // Line plot - if (plotValues.Count > 0) + if (ImGui.BeginChild("##content")) { - float[] values = [.. plotValues]; - ImGui.PlotLines("Random Values", ref values[0], values.Length, 0, - $"Current: {values[^1]:F2}", 0.0f, 1.0f, new Vector2(ImGui.GetContentRegionAvail().X, 100)); + ImGui.SeparatorText("Real-time Data Plots:"); - ImGui.PlotHistogram("Distribution", ref values[0], values.Length, 0, - "Histogram", 0.0f, 1.0f, new Vector2(ImGui.GetContentRegionAvail().X, 100)); - } + // Line plot + if (plotValues.Count > 0) + { + float[] values = [.. plotValues]; + ImGui.PlotLines("Random Values", ref values[0], values.Length, 0, + $"Current: {values[^1]:F2}", 0.0f, 1.0f, new Vector2(ImGui.GetContentRegionAvail().X, 100)); - // Performance note - ImGui.SeparatorText("Performance Metrics:"); - ImGui.TextWrapped("Performance monitoring is now available in the Debug menu! Use 'Debug > Show Performance Monitor' to see real-time FPS graphs and throttling state."); + ImGui.PlotHistogram("Distribution", ref values[0], values.Length, 0, + "Histogram", 0.0f, 1.0f, new Vector2(ImGui.GetContentRegionAvail().X, 100)); + } - // Font demonstrations - ImGui.SeparatorText("Custom Font Rendering:"); - using (new FontAppearance(nameof(Resources.CARDCHAR), 16)) - { - ImGui.Text("Small custom font text"); - } + // Performance note + ImGui.SeparatorText("Performance Metrics:"); + ImGui.TextWrapped("Performance monitoring is now available in the Debug menu! Use 'Debug > Show Performance Monitor' to see real-time FPS graphs and throttling state."); - using (new FontAppearance(nameof(Resources.CARDCHAR), 24)) - { - ImGui.Text("Medium custom font text"); - } + // Font demonstrations + ImGui.SeparatorText("Custom Font Rendering:"); + using (new FontAppearance(nameof(Resources.CARDCHAR), 16)) + { + ImGui.Text("Small custom font text"); + } - using (new FontAppearance(nameof(Resources.CARDCHAR), 32)) - { - ImGui.Text("Large custom font text"); - } + using (new FontAppearance(nameof(Resources.CARDCHAR), 24)) + { + ImGui.Text("Medium custom font text"); + } - // Text formatting examples - ImGui.SeparatorText("Text Formatting:"); - ImGui.TextColored(new Vector4(1, 0, 0, 1), "Red text"); - ImGui.TextColored(new Vector4(0, 1, 0, 1), "Green text"); - ImGui.TextColored(new Vector4(0, 0, 1, 1), "Blue text"); - ImGui.TextWrapped("This is a long line of text that should wrap to multiple lines when the window is not wide enough to contain it all on a single line."); + using (new FontAppearance(nameof(Resources.CARDCHAR), 32)) + { + ImGui.Text("Large custom font text"); + } + + // Text formatting examples + ImGui.SeparatorText("Text Formatting:"); + ImGui.TextColored(new Vector4(1, 0, 0, 1), "Red text"); + ImGui.TextColored(new Vector4(0, 1, 0, 1), "Green text"); + ImGui.TextColored(new Vector4(0, 0, 1, 1), "Blue text"); + ImGui.TextWrapped("This is a long line of text that should wrap to multiple lines when the window is not wide enough to contain it all on a single line."); + } + ImGui.EndChild(); ImGui.EndTabItem(); } diff --git a/examples/ImGuiAppDemo/Demos/GraphicsDemo.cs b/examples/ImGuiAppDemo/Demos/GraphicsDemo.cs index b99c47c8..191aaee3 100644 --- a/examples/ImGuiAppDemo/Demos/GraphicsDemo.cs +++ b/examples/ImGuiAppDemo/Demos/GraphicsDemo.cs @@ -28,68 +28,72 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - // Image display - AbsoluteFilePath iconPath = AppContext.BaseDirectory.As() / "icon.png".As(); - ImGuiAppTextureInfo iconTexture = ImGuiApp.GetOrLoadTexture(iconPath); - - ImGui.SeparatorText("Image Display:"); - ImGui.Image(iconTexture.TextureRef, new Vector2(64, 64)); - ImGui.SameLine(); - ImGui.Image(iconTexture.TextureRef, new Vector2(32, 32)); - ImGui.SameLine(); - ImGui.Image(iconTexture.TextureRef, new Vector2(16, 16)); - - // Custom drawing with ImDrawList - ImGui.SeparatorText("Custom Drawing Canvas:"); - ImGui.ColorEdit4("Draw Color", ref drawColor); - ImGui.SliderFloat("Brush Size", ref brushSize, 1.0f, 20.0f); - - if (ImGui.Button("Clear Canvas")) + if (ImGui.BeginChild("##content")) { - canvasPoints.Clear(); - } + // Image display + AbsoluteFilePath iconPath = AppContext.BaseDirectory.As() / "icon.png".As(); + ImGuiAppTextureInfo iconTexture = ImGuiApp.GetOrLoadTexture(iconPath); + + ImGui.SeparatorText("Image Display:"); + ImGui.Image(iconTexture.TextureRef, new Vector2(64, 64)); + ImGui.SameLine(); + ImGui.Image(iconTexture.TextureRef, new Vector2(32, 32)); + ImGui.SameLine(); + ImGui.Image(iconTexture.TextureRef, new Vector2(16, 16)); + + // Custom drawing with ImDrawList + ImGui.SeparatorText("Custom Drawing Canvas:"); + ImGui.ColorEdit4("Draw Color", ref drawColor); + ImGui.SliderFloat("Brush Size", ref brushSize, 1.0f, 20.0f); + + if (ImGui.Button("Clear Canvas")) + { + canvasPoints.Clear(); + } - Vector2 canvasPos = ImGui.GetCursorScreenPos(); - Vector2 canvasSize = new(400, 200); + Vector2 canvasPos = ImGui.GetCursorScreenPos(); + Vector2 canvasSize = new(400, 200); - // Draw canvas background - ImDrawListPtr drawList = ImGui.GetWindowDrawList(); - drawList.AddRectFilled(canvasPos, canvasPos + canvasSize, ImGui.ColorConvertFloat4ToU32(new Vector4(0.1f, 0.1f, 0.1f, 1.0f))); - drawList.AddRect(canvasPos, canvasPos + canvasSize, ImGui.ColorConvertFloat4ToU32(new Vector4(0.5f, 0.5f, 0.5f, 1.0f))); + // Draw canvas background + ImDrawListPtr drawList = ImGui.GetWindowDrawList(); + drawList.AddRectFilled(canvasPos, canvasPos + canvasSize, ImGui.ColorConvertFloat4ToU32(new Vector4(0.1f, 0.1f, 0.1f, 1.0f))); + drawList.AddRect(canvasPos, canvasPos + canvasSize, ImGui.ColorConvertFloat4ToU32(new Vector4(0.5f, 0.5f, 0.5f, 1.0f))); - // Handle mouse input for drawing - ImGui.InvisibleButton("Canvas", canvasSize); - if (ImGui.IsItemActive() && ImGui.IsMouseDown(ImGuiMouseButton.Left)) - { - Vector2 mousePos = ImGui.GetMousePos() - canvasPos; - if (mousePos.X >= 0 && mousePos.Y >= 0 && mousePos.X <= canvasSize.X && mousePos.Y <= canvasSize.Y) + // Handle mouse input for drawing + ImGui.InvisibleButton("Canvas", canvasSize); + if (ImGui.IsItemActive() && ImGui.IsMouseDown(ImGuiMouseButton.Left)) { - canvasPoints.Add(mousePos); + Vector2 mousePos = ImGui.GetMousePos() - canvasPos; + if (mousePos.X >= 0 && mousePos.Y >= 0 && mousePos.X <= canvasSize.X && mousePos.Y <= canvasSize.Y) + { + canvasPoints.Add(mousePos); + } } - } - // Draw points - uint color = ImGui.ColorConvertFloat4ToU32(drawColor); - foreach (Vector2 point in canvasPoints) - { - drawList.AddCircleFilled(canvasPos + point, brushSize, color); - } + // Draw points + uint color = ImGui.ColorConvertFloat4ToU32(drawColor); + foreach (Vector2 point in canvasPoints) + { + drawList.AddCircleFilled(canvasPos + point, brushSize, color); + } - // Draw some simple shapes for demonstration - ImGui.SeparatorText("Shape Examples:"); - Vector2 shapeStart = ImGui.GetCursorScreenPos(); + // Draw some simple shapes for demonstration + ImGui.SeparatorText("Shape Examples:"); + Vector2 shapeStart = ImGui.GetCursorScreenPos(); - // Simple animated circle - float t = animationTime; - Vector2 center = shapeStart + new Vector2(100, 50); - float radius = 20 + (MathF.Sin(t * 2) * 5); - drawList.AddCircle(center, radius, ImGui.ColorConvertFloat4ToU32(new Vector4(1, 0, 0, 1)), 16, 2.0f); + // Simple animated circle + float t = animationTime; + Vector2 center = shapeStart + new Vector2(100, 50); + float radius = 20 + (MathF.Sin(t * 2) * 5); + drawList.AddCircle(center, radius, ImGui.ColorConvertFloat4ToU32(new Vector4(1, 0, 0, 1)), 16, 2.0f); - // Moving rectangle - Vector2 rectPos = shapeStart + new Vector2(200 + (MathF.Sin(t) * 30), 30); - drawList.AddRectFilled(rectPos, rectPos + new Vector2(40, 40), ImGui.ColorConvertFloat4ToU32(new Vector4(0, 1, 0, 0.7f))); + // Moving rectangle + Vector2 rectPos = shapeStart + new Vector2(200 + (MathF.Sin(t) * 30), 30); + drawList.AddRectFilled(rectPos, rectPos + new Vector2(40, 40), ImGui.ColorConvertFloat4ToU32(new Vector4(0, 1, 0, 0.7f))); - ImGui.Dummy(new Vector2(400, 100)); // Reserve space + ImGui.Dummy(new Vector2(400, 100)); // Reserve space + } + ImGui.EndChild(); ImGui.EndTabItem(); } diff --git a/examples/ImGuiAppDemo/Demos/ImGuizmoDemo.cs b/examples/ImGuiAppDemo/Demos/ImGuizmoDemo.cs index ae60cfaf..2e963b65 100644 --- a/examples/ImGuiAppDemo/Demos/ImGuizmoDemo.cs +++ b/examples/ImGuiAppDemo/Demos/ImGuizmoDemo.cs @@ -38,88 +38,92 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - ImGui.TextWrapped("ImGuizmo provides 3D manipulation gizmos for translate, rotate, and scale operations."); - - // Gizmo controls - ImGui.SeparatorText("Gizmo Controls:."); - ImGui.Checkbox("Enable Gizmo", ref gizmoEnabled); - - // Operation selection - string[] operationNames = Enum.GetNames(); - ImGuizmoOperation[] operations = Enum.GetValues(); - int opIndex = Array.IndexOf(operations, gizmoOperation); - if (ImGui.Combo("Operation", ref opIndex, operationNames, operationNames.Length)) - { - gizmoOperation = operations[opIndex]; - } - - // Mode selection - string[] modeNames = Enum.GetNames(); - ImGuizmoMode[] modes = Enum.GetValues(); - int modeIndex = Array.IndexOf(modes, gizmoMode); - if (ImGui.Combo("Mode", ref modeIndex, modeNames, modeNames.Length)) + if (ImGui.BeginChild("##content")) { - gizmoMode = modes[modeIndex]; - } + ImGui.TextWrapped("ImGuizmo provides 3D manipulation gizmos for translate, rotate, and scale operations."); - // Display transform matrix values - ImGui.SeparatorText("Transform Matrix:"); - ImGui.Text($"[{gizmoTransform.M11:F2}, {gizmoTransform.M12:F2}, {gizmoTransform.M13:F2}, {gizmoTransform.M14:F2}]"); - ImGui.Text($"[{gizmoTransform.M21:F2}, {gizmoTransform.M22:F2}, {gizmoTransform.M23:F2}, {gizmoTransform.M24:F2}]"); - ImGui.Text($"[{gizmoTransform.M31:F2}, {gizmoTransform.M32:F2}, {gizmoTransform.M33:F2}, {gizmoTransform.M34:F2}]"); - ImGui.Text($"[{gizmoTransform.M41:F2}, {gizmoTransform.M42:F2}, {gizmoTransform.M43:F2}, {gizmoTransform.M44:F2}]"); + // Gizmo controls + ImGui.SeparatorText("Gizmo Controls:."); + ImGui.Checkbox("Enable Gizmo", ref gizmoEnabled); - if (ImGui.Button("Reset Transform")) - { - gizmoTransform = Matrix4x4.Identity; - } - - // Gizmo viewport - use a reasonable size instead of all available space - Vector2 availableSize = ImGui.GetContentRegionAvail(); - Vector2 gizmoSize = new(availableSize.X, Math.Min(availableSize.Y, availableSize.X * 0.6f)); // Use width-based aspect ratio + // Operation selection + string[] operationNames = Enum.GetNames(); + ImGuizmoOperation[] operations = Enum.GetValues(); + int opIndex = Array.IndexOf(operations, gizmoOperation); + if (ImGui.Combo("Operation", ref opIndex, operationNames, operationNames.Length)) + { + gizmoOperation = operations[opIndex]; + } - // Get position for gizmo (NO space reservation - see what happens!) - Vector2 gizmoPos = ImGui.GetCursorScreenPos(); + // Mode selection + string[] modeNames = Enum.GetNames(); + ImGuizmoMode[] modes = Enum.GetValues(); + int modeIndex = Array.IndexOf(modes, gizmoMode); + if (ImGui.Combo("Mode", ref modeIndex, modeNames, modeNames.Length)) + { + gizmoMode = modes[modeIndex]; + } - // Update projection matrix based on gizmo size - float aspectRatio = gizmoSize.Y > 0 ? gizmoSize.X / gizmoSize.Y : 1.0f; - gizmoProjection = Matrix4x4.CreatePerspectiveFieldOfView(MathF.PI / 4f, aspectRatio, 0.1f, 100f); + // Display transform matrix values + ImGui.SeparatorText("Transform Matrix:"); + ImGui.Text($"[{gizmoTransform.M11:F2}, {gizmoTransform.M12:F2}, {gizmoTransform.M13:F2}, {gizmoTransform.M14:F2}]"); + ImGui.Text($"[{gizmoTransform.M21:F2}, {gizmoTransform.M22:F2}, {gizmoTransform.M23:F2}, {gizmoTransform.M24:F2}]"); + ImGui.Text($"[{gizmoTransform.M31:F2}, {gizmoTransform.M32:F2}, {gizmoTransform.M33:F2}, {gizmoTransform.M34:F2}]"); + ImGui.Text($"[{gizmoTransform.M41:F2}, {gizmoTransform.M42:F2}, {gizmoTransform.M43:F2}, {gizmoTransform.M44:F2}]"); - // Set up ImGuizmo for this viewport - if (gizmoEnabled) - { - // IMPORTANT: Set the drawlist and enable ImGuizmo and set the rect, before using any ImGuizmo functions - ImGuizmo.SetDrawlist(); - ImGuizmo.Enable(true); - ImGuizmo.SetRect(gizmoPos.X, gizmoPos.Y, gizmoSize.X, gizmoSize.Y); + if (ImGui.Button("Reset Transform")) + { + gizmoTransform = Matrix4x4.Identity; + } - // Create view and projection matrices for the gizmo - Matrix4x4 view = gizmoView; - Matrix4x4 proj = gizmoProjection; + // Gizmo viewport - use a reasonable size instead of all available space + Vector2 availableSize = ImGui.GetContentRegionAvail(); + Vector2 gizmoSize = new(availableSize.X, Math.Min(availableSize.Y, availableSize.X * 0.6f)); // Use width-based aspect ratio - // Draw grid - Matrix4x4 identity = Matrix4x4.Identity; - ImGuizmo.DrawGrid(ref view, ref proj, ref identity, 10.0f); + // Get position for gizmo (NO space reservation - see what happens!) + Vector2 gizmoPos = ImGui.GetCursorScreenPos(); - // IMPORTANT: Use ID management for proper gizmo isolation - ImGuizmo.PushID(0); + // Update projection matrix based on gizmo size + float aspectRatio = gizmoSize.Y > 0 ? gizmoSize.X / gizmoSize.Y : 1.0f; + gizmoProjection = Matrix4x4.CreatePerspectiveFieldOfView(MathF.PI / 4f, aspectRatio, 0.1f, 100f); - // Draw the gizmo - Matrix4x4 transform = gizmoTransform; - if (ImGuizmo.Manipulate(ref view, ref proj, gizmoOperation, gizmoMode, ref transform)) + // Set up ImGuizmo for this viewport + if (gizmoEnabled) { - gizmoTransform = transform; + // IMPORTANT: Set the drawlist and enable ImGuizmo and set the rect, before using any ImGuizmo functions + ImGuizmo.SetDrawlist(); + ImGuizmo.Enable(true); + ImGuizmo.SetRect(gizmoPos.X, gizmoPos.Y, gizmoSize.X, gizmoSize.Y); + + // Create view and projection matrices for the gizmo + Matrix4x4 view = gizmoView; + Matrix4x4 proj = gizmoProjection; + + // Draw grid + Matrix4x4 identity = Matrix4x4.Identity; + ImGuizmo.DrawGrid(ref view, ref proj, ref identity, 10.0f); + + // IMPORTANT: Use ID management for proper gizmo isolation + ImGuizmo.PushID(0); + + // Draw the gizmo + Matrix4x4 transform = gizmoTransform; + if (ImGuizmo.Manipulate(ref view, ref proj, gizmoOperation, gizmoMode, ref transform)) + { + gizmoTransform = transform; + } + + ImGuizmo.PopID(); } - ImGuizmo.PopID(); - } - - // Display gizmo state below the gizmo area - if (gizmoEnabled) - { - ImGui.Text($"Gizmo Over: {ImGuizmo.IsOver()}"); - ImGui.Text($"Gizmo Using: {ImGuizmo.IsUsing()}"); + // Display gizmo state below the gizmo area + if (gizmoEnabled) + { + ImGui.Text($"Gizmo Over: {ImGuizmo.IsOver()}"); + ImGui.Text($"Gizmo Using: {ImGuizmo.IsUsing()}"); + } } + ImGui.EndChild(); ImGui.EndTabItem(); } diff --git a/examples/ImGuiAppDemo/Demos/ImNodesDemo.cs b/examples/ImGuiAppDemo/Demos/ImNodesDemo.cs index baf10485..834d93da 100644 --- a/examples/ImGuiAppDemo/Demos/ImNodesDemo.cs +++ b/examples/ImGuiAppDemo/Demos/ImNodesDemo.cs @@ -757,10 +757,14 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - RenderHeader(); - RenderControls(); - RenderNodeEditor(); - HandleLinkEvents(); + if (ImGui.BeginChild("##content")) + { + RenderHeader(); + RenderControls(); + RenderNodeEditor(); + HandleLinkEvents(); + } + ImGui.EndChild(); ImGui.EndTabItem(); } diff --git a/examples/ImGuiAppDemo/Demos/ImPlotDemo.cs b/examples/ImGuiAppDemo/Demos/ImPlotDemo.cs index 965f22d8..0ac4d2a4 100644 --- a/examples/ImGuiAppDemo/Demos/ImPlotDemo.cs +++ b/examples/ImGuiAppDemo/Demos/ImPlotDemo.cs @@ -57,88 +57,92 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - ImGui.TextWrapped("ImPlot provides advanced plotting capabilities with various chart types."); - ImGui.Separator(); - - // Plot controls - if (ImGui.Button("Generate New Data")) + if (ImGui.BeginChild("##content")) { - sinData.Clear(); - cosData.Clear(); - noiseData.Clear(); + ImGui.TextWrapped("ImPlot provides advanced plotting capabilities with various chart types."); + ImGui.Separator(); - for (int i = 0; i < 100; i++) + // Plot controls + if (ImGui.Button("Generate New Data")) { - float x = i * 0.1f; - sinData.Add(MathF.Sin(x + plotTime)); - cosData.Add(MathF.Cos(x + plotTime)); - noiseData.Add((float)((plotRandom.NextDouble() * 2.0) - 1.0)); + sinData.Clear(); + cosData.Clear(); + noiseData.Clear(); + + for (int i = 0; i < 100; i++) + { + float x = i * 0.1f; + sinData.Add(MathF.Sin(x + plotTime)); + cosData.Add(MathF.Cos(x + plotTime)); + noiseData.Add((float)((plotRandom.NextDouble() * 2.0) - 1.0)); + } } - } - ImGui.Separator(); + ImGui.Separator(); - // Line plot - if (ImPlot.BeginPlot("Trigonometric Functions", new Vector2(-1, 200))) - { - unsafe + // Line plot + if (ImPlot.BeginPlot("Trigonometric Functions", new Vector2(-1, 200))) { - fixed (float* sinPtr = sinData.ToArray()) - fixed (float* cosPtr = cosData.ToArray()) + unsafe { - ImPlot.PlotLine("sin(x)", sinPtr, sinData.Count); - ImPlot.PlotLine("cos(x)", cosPtr, cosData.Count); + fixed (float* sinPtr = sinData.ToArray()) + fixed (float* cosPtr = cosData.ToArray()) + { + ImPlot.PlotLine("sin(x)", sinPtr, sinData.Count); + ImPlot.PlotLine("cos(x)", cosPtr, cosData.Count); + } } + ImPlot.EndPlot(); } - ImPlot.EndPlot(); - } - // Scatter plot - if (ImPlot.BeginPlot("Noise Data (Scatter)", new Vector2(-1, 200))) - { - unsafe + // Scatter plot + if (ImPlot.BeginPlot("Noise Data (Scatter)", new Vector2(-1, 200))) { - fixed (float* noisePtr = noiseData.ToArray()) + unsafe { - ImPlot.PlotScatter("Random Noise", noisePtr, noiseData.Count); + fixed (float* noisePtr = noiseData.ToArray()) + { + ImPlot.PlotScatter("Random Noise", noisePtr, noiseData.Count); + } } + ImPlot.EndPlot(); } - ImPlot.EndPlot(); - } - // Bar chart - if (ImPlot.BeginPlot("Sample Bar Chart", new Vector2(-1, 200))) - { - float[] barData = [1.0f, 2.5f, 3.2f, 1.8f, 4.1f, 2.9f, 3.6f]; - unsafe + // Bar chart + if (ImPlot.BeginPlot("Sample Bar Chart", new Vector2(-1, 200))) { - fixed (float* barPtr = barData) + float[] barData = [1.0f, 2.5f, 3.2f, 1.8f, 4.1f, 2.9f, 3.6f]; + unsafe { - ImPlot.PlotBars("Values", barPtr, barData.Length); + fixed (float* barPtr = barData) + { + ImPlot.PlotBars("Values", barPtr, barData.Length); + } } + ImPlot.EndPlot(); } - ImPlot.EndPlot(); - } - // Real-time plot - if (ImPlot.BeginPlot("Real-time Data", new Vector2(-1, 200))) - { - // Update real-time data - if (plotValues.Count > 0) + // Real-time plot + if (ImPlot.BeginPlot("Real-time Data", new Vector2(-1, 200))) { - unsafe + // Update real-time data + if (plotValues.Count > 0) { - fixed (float* plotPtr = plotValues.ToArray()) + unsafe { - ImPlot.PlotLine("Live Data", plotPtr, plotValues.Count); + fixed (float* plotPtr = plotValues.ToArray()) + { + ImPlot.PlotLine("Live Data", plotPtr, plotValues.Count); + } } } + ImPlot.EndPlot(); } - ImPlot.EndPlot(); - } - ImGui.Text($"Plot Time: {plotTime:F2}"); - ImGui.Text($"Data Points: Sin({sinData.Count}), Cos({cosData.Count}), Noise({noiseData.Count})"); + ImGui.Text($"Plot Time: {plotTime:F2}"); + ImGui.Text($"Data Points: Sin({sinData.Count}), Cos({cosData.Count}), Noise({noiseData.Count})"); + } + ImGui.EndChild(); ImGui.EndTabItem(); } diff --git a/examples/ImGuiAppDemo/Demos/InputHandlingDemo.cs b/examples/ImGuiAppDemo/Demos/InputHandlingDemo.cs index dd5bfbe5..4744cd7b 100644 --- a/examples/ImGuiAppDemo/Demos/InputHandlingDemo.cs +++ b/examples/ImGuiAppDemo/Demos/InputHandlingDemo.cs @@ -37,55 +37,59 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - ImGui.SeparatorText("Mouse Information:"); - Vector2 mousePos = ImGui.GetMousePos(); - Vector2 mouseDelta = ImGui.GetMouseDragDelta(ImGuiMouseButton.Left); - ImGui.Text($"Mouse Position: ({mousePos.X:F1}, {mousePos.Y:F1})"); - ImGui.Text($"Mouse Delta: ({mouseDelta.X:F1}, {mouseDelta.Y:F1})"); - ImGui.Text($"Left Button: {(ImGui.IsMouseDown(ImGuiMouseButton.Left) ? "DOWN" : "UP")}"); - ImGui.Text($"Right Button: {(ImGui.IsMouseDown(ImGuiMouseButton.Right) ? "DOWN" : "UP")}"); - - // Simple drag demonstration - ImGui.SeparatorText("Drag & Drop:"); - ImGui.Button("Drag Source", new Vector2(100, 50)); - ImGui.SameLine(); - ImGui.Button("Drop Target", new Vector2(100, 50)); - ImGui.Text("(Drag and drop functionality would require more complex implementation)"); - - // Text editing - ImGui.SeparatorText("Multi-line Text Editor:"); - ImGui.Checkbox("Word Wrap", ref wrapText); - ImGuiInputTextFlags textFlags = ImGuiInputTextFlags.AllowTabInput; - if (!wrapText) - { - textFlags |= ImGuiInputTextFlags.NoHorizontalScroll; - } - - string textContent = textBuffer.ToString(); - if (ImGui.InputTextMultiline("##TextEditor", ref textContent, 1024, new Vector2(-1, 150), textFlags)) - { - textBuffer.Clear(); - textBuffer.Append(textContent); - } - - // Popup and modal buttons - ImGui.SeparatorText("Popups and Modals:"); - if (ImGui.Button("Show Modal")) - { - showModal = true; - modalResult = ""; - } - - ImGui.SameLine(); - if (ImGui.Button("Show Popup")) - { - showPopup = true; - } - - if (!string.IsNullOrEmpty(modalResult)) + if (ImGui.BeginChild("##content")) { - ImGui.Text($"Modal Result: {modalResult}"); + ImGui.SeparatorText("Mouse Information:"); + Vector2 mousePos = ImGui.GetMousePos(); + Vector2 mouseDelta = ImGui.GetMouseDragDelta(ImGuiMouseButton.Left); + ImGui.Text($"Mouse Position: ({mousePos.X:F1}, {mousePos.Y:F1})"); + ImGui.Text($"Mouse Delta: ({mouseDelta.X:F1}, {mouseDelta.Y:F1})"); + ImGui.Text($"Left Button: {(ImGui.IsMouseDown(ImGuiMouseButton.Left) ? "DOWN" : "UP")}"); + ImGui.Text($"Right Button: {(ImGui.IsMouseDown(ImGuiMouseButton.Right) ? "DOWN" : "UP")}"); + + // Simple drag demonstration + ImGui.SeparatorText("Drag & Drop:"); + ImGui.Button("Drag Source", new Vector2(100, 50)); + ImGui.SameLine(); + ImGui.Button("Drop Target", new Vector2(100, 50)); + ImGui.Text("(Drag and drop functionality would require more complex implementation)"); + + // Text editing + ImGui.SeparatorText("Multi-line Text Editor:"); + ImGui.Checkbox("Word Wrap", ref wrapText); + ImGuiInputTextFlags textFlags = ImGuiInputTextFlags.AllowTabInput; + if (!wrapText) + { + textFlags |= ImGuiInputTextFlags.NoHorizontalScroll; + } + + string textContent = textBuffer.ToString(); + if (ImGui.InputTextMultiline("##TextEditor", ref textContent, 1024, new Vector2(-1, 150), textFlags)) + { + textBuffer.Clear(); + textBuffer.Append(textContent); + } + + // Popup and modal buttons + ImGui.SeparatorText("Popups and Modals:"); + if (ImGui.Button("Show Modal")) + { + showModal = true; + modalResult = ""; + } + + ImGui.SameLine(); + if (ImGui.Button("Show Popup")) + { + showPopup = true; + } + + if (!string.IsNullOrEmpty(modalResult)) + { + ImGui.Text($"Modal Result: {modalResult}"); + } } + ImGui.EndChild(); ImGui.EndTabItem(); } diff --git a/examples/ImGuiAppDemo/Demos/LayoutDemo.cs b/examples/ImGuiAppDemo/Demos/LayoutDemo.cs index 3d170d6f..ffdcaea9 100644 --- a/examples/ImGuiAppDemo/Demos/LayoutDemo.cs +++ b/examples/ImGuiAppDemo/Demos/LayoutDemo.cs @@ -47,8 +47,10 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - // Columns - ImGui.SeparatorText("Columns Layout:"); + if (ImGui.BeginChild("##content")) + { + // Columns + ImGui.SeparatorText("Columns Layout:"); ImGui.Columns(3, "DemoColumns"); ImGui.Text("Column 1"); ImGui.NextColumn(); @@ -128,6 +130,8 @@ public void Render() } } ImGui.EndChild(); + } + ImGui.EndChild(); ImGui.EndTabItem(); } diff --git a/examples/ImGuiAppDemo/Demos/NerdFontDemo.cs b/examples/ImGuiAppDemo/Demos/NerdFontDemo.cs index be5c9036..06f1c973 100644 --- a/examples/ImGuiAppDemo/Demos/NerdFontDemo.cs +++ b/examples/ImGuiAppDemo/Demos/NerdFontDemo.cs @@ -22,61 +22,65 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - ImGui.TextWrapped("Nerd Font Icons (Patched Fonts)"); - ImGui.TextWrapped("This tab demonstrates Nerd Font icons if you're using a Nerd Font (like JetBrains Mono Nerd Font, Fira Code Nerd Font, etc.)."); - - // Powerline symbols - ImGui.SeparatorText("Powerline Symbols:"); - ImGui.Text("Basic: \uE0A0 \uE0A1 \uE0A2 \uE0B0 \uE0B1 \uE0B2 \uE0B3"); - ImGui.Text("Extra: \uE0A3 \uE0B4 \uE0B5 \uE0B6 \uE0B7 \uE0B8 \uE0CA \uE0CC \uE0CD \uE0D0 \uE0D1 \uE0D4"); - - // Font Awesome icons - ImGui.SeparatorText("Font Awesome Icons"); - ImGui.Text("Files & Folders: \uF07B \uF07C \uF15B \uF15C \uF016 \uF017 \uF019 \uF01A \uF093 \uF095"); - ImGui.Text("Git & Version Control: \uF1D3 \uF1D2 \uF126 \uF127 \uF128 \uF129 \uF12A \uF12B"); - ImGui.Text("Media & UI: \uF04B \uF04C \uF04D \uF050 \uF051 \uF048 \uF049 \uF067 \uF068 \uF00C \uF00D"); - - // Material Design icons - ImGui.SeparatorText("Material Design Icons"); - ImGui.Text("Navigation: \uF52A \uF52B \uF544 \uF53F \uF540 \uF541 \uF542 \uF543"); - ImGui.Text("Actions: \uF8D5 \uF8D6 \uF8D7 \uF8D8 \uF8D9 \uF8DA \uF8DB \uF8DC"); - ImGui.Text("Content: \uF1C1 \uF1C2 \uF1C3 \uF1C4 \uF1C5 \uF1C6 \uF1C7 \uF1C8"); - - // Weather icons - ImGui.SeparatorText("Weather Icons"); - ImGui.Text("Basic Weather: \uE30D \uE30E \uE30F \uE310 \uE311 \uE312 \uE313 \uE314"); - ImGui.Text("Temperature: \uE315 \uE316 \uE317 \uE318 \uE319 \uE31A \uE31B \uE31C"); - ImGui.Text("Wind & Pressure: \uE31D \uE31E \uE31F \uE320 \uE321 \uE322 \uE323 \uE324"); - - // Devicons - ImGui.SeparatorText("Developer Icons (Devicons)"); - ImGui.Text("Languages: \uE73C \uE73D \uE73E \uE73F \uE740 \uE741 \uE742 \uE743"); // Various programming languages - ImGui.Text("Frameworks: \uE744 \uE745 \uE746 \uE747 \uE748 \uE749 \uE74A \uE74B"); - ImGui.Text("Tools: \uE74C \uE74D \uE74E \uE74F \uE750 \uE751 \uE752 \uE753"); - - // Octicons - ImGui.SeparatorText("Octicons (GitHub Icons)"); - ImGui.Text("Version Control: \uF418 \uF419 \uF41A \uF41B \uF41C \uF41D \uF41E \uF41F"); - ImGui.Text("Issues & PRs: \uF420 \uF421 \uF422 \uF423 \uF424 \uF425 \uF426 \uF427"); - ImGui.Text("Social: \u2665 \u26A1 \uF428 \uF429 \uF42A \uF42B \uF42C \uF42D"); - - // Font Logos - ImGui.SeparatorText("Brand Logos (Font Logos)"); - ImGui.Text("Tech Brands: \uF300 \uF301 \uF302 \uF303 \uF304 \uF305 \uF306 \uF307"); - ImGui.Text("More Logos: \uF308 \uF309 \uF30A \uF30B \uF30C \uF30D \uF30E \uF30F"); - - // Pomicons - ImGui.SeparatorText("Pomicons"); - ImGui.Text("Small Icons: \uE000 \uE001 \uE002 \uE003 \uE004 \uE005 \uE006 \uE007"); - ImGui.Text("More Icons: \uE008 \uE009 \uE00A \uE00B \uE00C \uE00D"); - - ImGui.Separator(); - ImGui.TextWrapped("Note: These icons will only display correctly if you're using a Nerd Font. " + - "If you see question marks or boxes, switch to a Nerd Font like 'JetBrains Mono Nerd Font' or 'Fira Code Nerd Font'."); - - ImGui.Separator(); - ImGui.TextWrapped("Popular Nerd Fonts: JetBrains Mono Nerd Font, Fira Code Nerd Font, Hack Nerd Font, " + - "Source Code Pro Nerd Font, DejaVu Sans Mono Nerd Font, and many more at nerdfonts.com"); + if (ImGui.BeginChild("##content")) + { + ImGui.TextWrapped("Nerd Font Icons (Patched Fonts)"); + ImGui.TextWrapped("This tab demonstrates Nerd Font icons if you're using a Nerd Font (like JetBrains Mono Nerd Font, Fira Code Nerd Font, etc.)."); + + // Powerline symbols + ImGui.SeparatorText("Powerline Symbols:"); + ImGui.Text("Basic: \uE0A0 \uE0A1 \uE0A2 \uE0B0 \uE0B1 \uE0B2 \uE0B3"); + ImGui.Text("Extra: \uE0A3 \uE0B4 \uE0B5 \uE0B6 \uE0B7 \uE0B8 \uE0CA \uE0CC \uE0CD \uE0D0 \uE0D1 \uE0D4"); + + // Font Awesome icons + ImGui.SeparatorText("Font Awesome Icons"); + ImGui.Text("Files & Folders: \uF07B \uF07C \uF15B \uF15C \uF016 \uF017 \uF019 \uF01A \uF093 \uF095"); + ImGui.Text("Git & Version Control: \uF1D3 \uF1D2 \uF126 \uF127 \uF128 \uF129 \uF12A \uF12B"); + ImGui.Text("Media & UI: \uF04B \uF04C \uF04D \uF050 \uF051 \uF048 \uF049 \uF067 \uF068 \uF00C \uF00D"); + + // Material Design icons + ImGui.SeparatorText("Material Design Icons"); + ImGui.Text("Navigation: \uF52A \uF52B \uF544 \uF53F \uF540 \uF541 \uF542 \uF543"); + ImGui.Text("Actions: \uF8D5 \uF8D6 \uF8D7 \uF8D8 \uF8D9 \uF8DA \uF8DB \uF8DC"); + ImGui.Text("Content: \uF1C1 \uF1C2 \uF1C3 \uF1C4 \uF1C5 \uF1C6 \uF1C7 \uF1C8"); + + // Weather icons + ImGui.SeparatorText("Weather Icons"); + ImGui.Text("Basic Weather: \uE30D \uE30E \uE30F \uE310 \uE311 \uE312 \uE313 \uE314"); + ImGui.Text("Temperature: \uE315 \uE316 \uE317 \uE318 \uE319 \uE31A \uE31B \uE31C"); + ImGui.Text("Wind & Pressure: \uE31D \uE31E \uE31F \uE320 \uE321 \uE322 \uE323 \uE324"); + + // Devicons + ImGui.SeparatorText("Developer Icons (Devicons)"); + ImGui.Text("Languages: \uE73C \uE73D \uE73E \uE73F \uE740 \uE741 \uE742 \uE743"); // Various programming languages + ImGui.Text("Frameworks: \uE744 \uE745 \uE746 \uE747 \uE748 \uE749 \uE74A \uE74B"); + ImGui.Text("Tools: \uE74C \uE74D \uE74E \uE74F \uE750 \uE751 \uE752 \uE753"); + + // Octicons + ImGui.SeparatorText("Octicons (GitHub Icons)"); + ImGui.Text("Version Control: \uF418 \uF419 \uF41A \uF41B \uF41C \uF41D \uF41E \uF41F"); + ImGui.Text("Issues & PRs: \uF420 \uF421 \uF422 \uF423 \uF424 \uF425 \uF426 \uF427"); + ImGui.Text("Social: \u2665 \u26A1 \uF428 \uF429 \uF42A \uF42B \uF42C \uF42D"); + + // Font Logos + ImGui.SeparatorText("Brand Logos (Font Logos)"); + ImGui.Text("Tech Brands: \uF300 \uF301 \uF302 \uF303 \uF304 \uF305 \uF306 \uF307"); + ImGui.Text("More Logos: \uF308 \uF309 \uF30A \uF30B \uF30C \uF30D \uF30E \uF30F"); + + // Pomicons + ImGui.SeparatorText("Pomicons"); + ImGui.Text("Small Icons: \uE000 \uE001 \uE002 \uE003 \uE004 \uE005 \uE006 \uE007"); + ImGui.Text("More Icons: \uE008 \uE009 \uE00A \uE00B \uE00C \uE00D"); + + ImGui.Separator(); + ImGui.TextWrapped("Note: These icons will only display correctly if you're using a Nerd Font. " + + "If you see question marks or boxes, switch to a Nerd Font like 'JetBrains Mono Nerd Font' or 'Fira Code Nerd Font'."); + + ImGui.Separator(); + ImGui.TextWrapped("Popular Nerd Fonts: JetBrains Mono Nerd Font, Fira Code Nerd Font, Hack Nerd Font, " + + "Source Code Pro Nerd Font, DejaVu Sans Mono Nerd Font, and many more at nerdfonts.com"); + } + ImGui.EndChild(); ImGui.EndTabItem(); } diff --git a/examples/ImGuiAppDemo/Demos/UnicodeDemo.cs b/examples/ImGuiAppDemo/Demos/UnicodeDemo.cs index 32b9adf6..f41aefd3 100644 --- a/examples/ImGuiAppDemo/Demos/UnicodeDemo.cs +++ b/examples/ImGuiAppDemo/Demos/UnicodeDemo.cs @@ -22,41 +22,45 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - ImGui.TextWrapped("Unicode and Emoji Support (Enabled by Default)"); - ImGui.TextWrapped("ImGuiApp automatically includes support for Unicode characters and emojis. This feature works with your configured fonts."); + if (ImGui.BeginChild("##content")) + { + ImGui.TextWrapped("Unicode and Emoji Support (Enabled by Default)"); + ImGui.TextWrapped("ImGuiApp automatically includes support for Unicode characters and emojis. This feature works with your configured fonts."); - ImGui.SeparatorText("Basic ASCII:"); - ImGui.Text("Hello World!"); - ImGui.Text("Accented characters: café, naïve, résumé"); - ImGui.Text("Mathematical symbols: ∞ ≠ ≈ ≤ ≥ ± × ÷ ∂ ∑ ∏ √ ∫"); - ImGui.Text("Currency symbols: $ € £ ¥ ₹ ₿"); - ImGui.Text("Arrows: ← → ↑ ↓ ↔ ↕ ⇐ ⇒ ⇑ ⇓"); - ImGui.Text("Geometric shapes: ■ □ ▲ △ ● ○ ◆ ◇ ★ ☆"); - ImGui.Text("Miscellaneous symbols: ♠ ♣ ♥ ♦ ☀ ☁ ☂ ☃ ♪ ♫"); + ImGui.SeparatorText("Basic ASCII:"); + ImGui.Text("Hello World!"); + ImGui.Text("Accented characters: café, naïve, résumé"); + ImGui.Text("Mathematical symbols: ∞ ≠ ≈ ≤ ≥ ± × ÷ ∂ ∑ ∏ √ ∫"); + ImGui.Text("Currency symbols: $ € £ ¥ ₹ ₿"); + ImGui.Text("Arrows: ← → ↑ ↓ ↔ ↕ ⇐ ⇒ ⇑ ⇓"); + ImGui.Text("Geometric shapes: ■ □ ▲ △ ● ○ ◆ ◇ ★ ☆"); + ImGui.Text("Miscellaneous symbols: ♠ ♣ ♥ ♦ ☀ ☁ ☂ ☃ ♪ ♫"); - ImGui.SeparatorText("Full Emoji Range Support (if font supports them)"); - ImGui.Text("Faces: 😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 😍 😎 🤓 🧐 🤔 😴"); - ImGui.Text("Gestures: 👍 👎 👌 ✌️ 🤞 🤟 🤘 🤙 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐"); - ImGui.Text("Objects: 🚀 💻 📱 🎸 🎨 🏆 🌟 💎 ⚡ 🔥 💡 🔧 ⚙️ 🔑 💰"); - ImGui.Text("Nature: 🌈 🌞 🌙 ⭐ 🌍 🌊 🌳 🌸 🦋 🐝 🐶 🐱 🦊 🐻 🐼"); - ImGui.Text("Food: 🍎 🍌 🍕 🍔 🍟 🍦 🎂 ☕ 🍺 🍷 🍓 🥑 🥨 🧀 🍯"); - ImGui.Text("Transport: 🚗 🚂 ✈️ 🚲 🚢 🚁 🚌 🏍️ 🛸 🚜 🏎️ 🚙 🚕 🚐"); - ImGui.Text("Activities: ⚽ 🏀 🏈 ⚾ 🎾 🏐 🏉 🎱 🏓 🏸 🥊 ⛳ 🎯 🎪"); - ImGui.Text("Weather: ☀️ ⛅ ☁️ 🌤️ ⛈️ 🌧️ ❄️ ☃️ ⛄ 🌬️ 💨 🌊 💧"); - ImGui.Text("Symbols: ❤️ 💚 💙 💜 🖤 💛 💔 ❣️ 💕 💖 💗 💘 💝 ✨"); - ImGui.Text("Arrows: ← → ↑ ↓ ↔ ↕ ↖ ↗ ↘ ↙ ⤴️ ⤵️ 🔀 🔁 🔂 🔄 🔃"); - ImGui.Text("Math: ± × ÷ = ≠ ≈ ≤ ≥ ∞ √ ∑ ∏ ∂ ∫ Ω π α β γ δ"); - ImGui.Text("Geometric: ■ □ ▲ △ ● ○ ◆ ◇ ★ ☆ ♠ ♣ ♥ ♦ ▪ ▫ ◾ ◽"); - ImGui.Text("Currency: $ € £ ¥ ₹ ₿ ¢ ₽ ₩ ₡ ₪ ₫ ₱ ₴ ₦ ₨ ₵"); - ImGui.Text("Dingbats: ✂ ✈ ☎ ⌚ ⏰ ⏳ ⌛ ⚡ ☔ ☂ ☀ ⭐ ☁ ⛅ ❄"); - ImGui.Text("Enclosed: ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⓐ ⓑ ⓒ ⓓ ⓔ ⓕ"); + ImGui.SeparatorText("Full Emoji Range Support (if font supports them)"); + ImGui.Text("Faces: 😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 😍 😎 🤓 🧐 🤔 😴"); + ImGui.Text("Gestures: 👍 👎 👌 ✌️ 🤞 🤟 🤘 🤙 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐"); + ImGui.Text("Objects: 🚀 💻 📱 🎸 🎨 🏆 🌟 💎 ⚡ 🔥 💡 🔧 ⚙️ 🔑 💰"); + ImGui.Text("Nature: 🌈 🌞 🌙 ⭐ 🌍 🌊 🌳 🌸 🦋 🐝 🐶 🐱 🦊 🐻 🐼"); + ImGui.Text("Food: 🍎 🍌 🍕 🍔 🍟 🍦 🎂 ☕ 🍺 🍷 🍓 🥑 🥨 🧀 🍯"); + ImGui.Text("Transport: 🚗 🚂 ✈️ 🚲 🚢 🚁 🚌 🏍️ 🛸 🚜 🏎️ 🚙 🚕 🚐"); + ImGui.Text("Activities: ⚽ 🏀 🏈 ⚾ 🎾 🏐 🏉 🎱 🏓 🏸 🥊 ⛳ 🎯 🎪"); + ImGui.Text("Weather: ☀️ ⛅ ☁️ 🌤️ ⛈️ 🌧️ ❄️ ☃️ ⛄ 🌬️ 💨 🌊 💧"); + ImGui.Text("Symbols: ❤️ 💚 💙 💜 🖤 💛 💔 ❣️ 💕 💖 💗 💘 💝 ✨"); + ImGui.Text("Arrows: ← → ↑ ↓ ↔ ↕ ↖ ↗ ↘ ↙ ⤴️ ⤵️ 🔀 🔁 🔂 🔄 🔃"); + ImGui.Text("Math: ± × ÷ = ≠ ≈ ≤ ≥ ∞ √ ∑ ∏ ∂ ∫ Ω π α β γ δ"); + ImGui.Text("Geometric: ■ □ ▲ △ ● ○ ◆ ◇ ★ ☆ ♠ ♣ ♥ ♦ ▪ ▫ ◾ ◽"); + ImGui.Text("Currency: $ € £ ¥ ₹ ₿ ¢ ₽ ₩ ₡ ₪ ₫ ₱ ₴ ₦ ₨ ₵"); + ImGui.Text("Dingbats: ✂ ✈ ☎ ⌚ ⏰ ⏳ ⌛ ⚡ ☔ ☂ ☀ ⭐ ☁ ⛅ ❄"); + ImGui.Text("Enclosed: ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⓐ ⓑ ⓒ ⓓ ⓔ ⓕ"); - ImGui.Separator(); - ImGui.TextWrapped("Note: Character display depends on your configured font's Unicode support. " + - "If characters show as question marks, your font may not include those glyphs."); + ImGui.Separator(); + ImGui.TextWrapped("Note: Character display depends on your configured font's Unicode support. " + + "If characters show as question marks, your font may not include those glyphs."); - ImGui.Separator(); - ImGui.TextWrapped("To disable Unicode support (ASCII only), set EnableUnicodeSupport = false in your ImGuiAppConfig."); + ImGui.Separator(); + ImGui.TextWrapped("To disable Unicode support (ASCII only), set EnableUnicodeSupport = false in your ImGuiAppConfig."); + } + ImGui.EndChild(); ImGui.EndTabItem(); } diff --git a/examples/ImGuiAppDemo/Demos/UtilityDemo.cs b/examples/ImGuiAppDemo/Demos/UtilityDemo.cs index 201e224d..d883e4c1 100644 --- a/examples/ImGuiAppDemo/Demos/UtilityDemo.cs +++ b/examples/ImGuiAppDemo/Demos/UtilityDemo.cs @@ -44,59 +44,63 @@ public void Render() { if (ImGui.BeginTabItem(TabName)) { - // File operations - ImGui.SeparatorText("File Operations:"); - ImGui.InputText("File Path", ref filePath, 256); - ImGui.SameLine(); - if (ImGui.Button("Load") && !string.IsNullOrEmpty(filePath)) + if (ImGui.BeginChild("##content")) { - try + // File operations + ImGui.SeparatorText("File Operations:"); + ImGui.InputText("File Path", ref filePath, 256); + ImGui.SameLine(); + if (ImGui.Button("Load") && !string.IsNullOrEmpty(filePath)) { - fileContent = File.ReadAllText(filePath); + try + { + fileContent = File.ReadAllText(filePath); + } + catch (Exception ex) when (ex is FileNotFoundException or UnauthorizedAccessException) + { + // Handle file read errors gracefully + fileContent = $"Error loading file: {ex.Message}"; + } } - catch (Exception ex) when (ex is FileNotFoundException or UnauthorizedAccessException) + + if (!string.IsNullOrEmpty(fileContent)) { - // Handle file read errors gracefully - fileContent = $"Error loading file: {ex.Message}"; + ImGui.SeparatorText("File Content Preview:"); + ImGui.TextWrapped(fileContent.Length > 500 ? fileContent[..500] + "..." : fileContent); } - } - - if (!string.IsNullOrEmpty(fileContent)) - { - ImGui.SeparatorText("File Content Preview:"); - ImGui.TextWrapped(fileContent.Length > 500 ? fileContent[..500] + "..." : fileContent); - } - // System information - ImGui.SeparatorText("System Information:"); - unsafe - { - byte* ptr = ImGui.GetVersion(); - int length = 0; - while (ptr[length] != 0) + // System information + ImGui.SeparatorText("System Information:"); + unsafe { - length++; + byte* ptr = ImGui.GetVersion(); + int length = 0; + while (ptr[length] != 0) + { + length++; + } + ImGui.Text($"ImGui Version: {Encoding.UTF8.GetString(ptr, length)}"); } - ImGui.Text($"ImGui Version: {Encoding.UTF8.GetString(ptr, length)}"); - } - ImGui.Text($"Display Size: {ImGui.GetIO().DisplaySize}"); + ImGui.Text($"Display Size: {ImGui.GetIO().DisplaySize}"); - // Debugging tools - ImGui.SeparatorText("Debug Tools:"); - if (ImGui.Button("Show ImGui Demo")) - { - showImGuiDemo = !showImGuiDemo; - } - ImGui.SameLine(); - if (ImGui.Button("Show Style Editor")) - { - showStyleEditor = !showStyleEditor; - } - ImGui.SameLine(); - if (ImGui.Button("Show Metrics")) - { - showMetrics = !showMetrics; + // Debugging tools + ImGui.SeparatorText("Debug Tools:"); + if (ImGui.Button("Show ImGui Demo")) + { + showImGuiDemo = !showImGuiDemo; + } + ImGui.SameLine(); + if (ImGui.Button("Show Style Editor")) + { + showStyleEditor = !showStyleEditor; + } + ImGui.SameLine(); + if (ImGui.Button("Show Metrics")) + { + showMetrics = !showMetrics; + } } + ImGui.EndChild(); ImGui.EndTabItem(); } From 229ec450b05b75e4000aacfc81a06f7af5521721 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 01:18:46 +0000 Subject: [PATCH 3/3] Fix typo in Gizmo Controls separator text Co-authored-by: matt-edmondson <19528727+matt-edmondson@users.noreply.github.com> --- examples/ImGuiAppDemo/Demos/ImGuizmoDemo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ImGuiAppDemo/Demos/ImGuizmoDemo.cs b/examples/ImGuiAppDemo/Demos/ImGuizmoDemo.cs index 2e963b65..06f1dd75 100644 --- a/examples/ImGuiAppDemo/Demos/ImGuizmoDemo.cs +++ b/examples/ImGuiAppDemo/Demos/ImGuizmoDemo.cs @@ -43,7 +43,7 @@ public void Render() ImGui.TextWrapped("ImGuizmo provides 3D manipulation gizmos for translate, rotate, and scale operations."); // Gizmo controls - ImGui.SeparatorText("Gizmo Controls:."); + ImGui.SeparatorText("Gizmo Controls:"); ImGui.Checkbox("Enable Gizmo", ref gizmoEnabled); // Operation selection