Ejemplo n.º 1
0
        public void Render(float width, float height)
        {
            var backgroundColor    = ImGui.GetColorU32(ImGuiCol.WindowBg);
            var newBackgroundColor = ImGui.ColorConvertU32ToFloat4(backgroundColor);

            newBackgroundColor.W = 1.0f;
            ImGui.PushStyleColor(ImGuiCol.WindowBg, newBackgroundColor);

            _menuBar.Render(out var menuHeight);
            if (_menuBar.DemoMode)
            {
                ImGui.ShowDemoWindow();
                return;
            }

            ImGui.PushStyleVar(ImGuiStyleVar.WindowRounding, 0);
            if (ImGui.Begin("", ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoNav | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse))
            {
                ImGui.SetWindowPos(new Vector2(0.0f, menuHeight));
                ImGui.SetWindowSize(new Vector2(width, height - menuHeight));

                _titleBar.Render(_wizard.CurrentPageIndex);

                _wizard.CancelButton.Visble  = false;
                _wizard.CancelButton.Enabled = true;
                _wizard.CancelButton.Title   = "Cancel";

                _wizard.ValidateButton.Visble  = false;
                _wizard.ValidateButton.Enabled = true;
                _wizard.ValidateButton.Title   = "Validate";

                _wizard.PreviousButton.Visble  = true;
                _wizard.PreviousButton.Enabled = _wizard.CurrentPageIndex > 0;
                _wizard.PreviousButton.Title   = "Previous";

                _wizard.NextButton.Visble  = true;
                _wizard.NextButton.Enabled = _wizard.CurrentPageIndex < (_wizard.Pages - 1);
                _wizard.NextButton.Title   = "Next";
                _wizard.Render(RenderPage_Action);

                if (_busy)
                {
                    var position = ImGui.GetWindowPos() + (ImGui.GetWindowSize() / 2);
                    Widgets.RenderSpinner(position, 20, 3);
                }

                ImGui.End();
            }
            ImGui.PopStyleVar();
            ImGui.PopStyleColor();
        }