Git Product home page Git Product logo

imgui.forms's Introduction

ImGui.Forms

A WinForms-inspired object-oriented framework around Dear ImGui.

Get started

You only need to install the imGui.Forms nuget package in your project.

To create your own GUI, you have to add those two lines to your main method:

var form = new MainForm();
new Application().Execute(form);

MainForm is your own derivation of the abstract class Form, in which you set your components for your design. MainForm is used as an example name, and you can freely choose the name of your derivative class.
You set your components to the property Content iny your derived class.

The constructor of Application takes an ILocalizer as well, which can be called via Application.Localizer.Localize() to localize a string used in the application. Currently localizations get only set, when they are set explicitly. A system is planned, where you can set up automatic re-setting of application strings, after the locale of the ILocalizer was changed.

Namespaces

ImGui.Forms

Containing the Application and Form classes, which act as the main entry point into the library.

ImGui.Forms.Controls

Containing all controls usable on a form.

You can create your own controls by deriving from ImGui.Forms.Controls.Base.Component and using ImGuiNET to emit Dear ImGui commands in the UpdateInternal method. The UpdateInternal method of the control will retrieve the absolute coordinates and size of itself as a parameter, as they would be needed in ImGui DrawList calls. Those information are derived from parent layouts and the Size value returned from GetSize in the same control.

ImGui.Forms.Modals

Containing various modals and dialogs, such as MessageBox, OpenFileDialog, and SaveFileDialog.

Use MessageBox.ShowErrorAsync, MessageBox.ShowInformationAsync, or MessageBox.ShowYesNoAsync to show a blocking messagebox over the remaining form content.

OpenFileDialog and SaveFileDialog were designed to look and feel like the equally named dialogs in WinForms. Consult their Microsoft documentation for further information.

Credits

ocurnut - For creating Dear ImGui mellinoe - For creating ImGui.NET (bindings for Dear ImGui) Veldrid Team - For creating the Veldrid rendering pipeline

imgui.forms's People

Contributors

onepiecefreak3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

imgui.forms's Issues

TableLayout issue

image
Code:

public static Component Resolve(object obj)
{
    var stackLayout = new TableLayout
    {
        VerticalAlignment = VerticalAlignment.Top,
        Spacing = new Vector2(10, 10),
        
    };
    foreach (var v in obj.GetType().GetFields())
    {
        var row = new TableRow();
        row.Cells.Add(Resolve(obj,v));
        stackLayout.Rows.Add(row);
    }

    return stackLayout;
}

It looks like the Spacing between the rows of the TableLayout is not Vector2(10,10) .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.