/imrad

ImRAD is a GUI builder for the ImGui library

Primary LanguageC++GNU General Public License v3.0GPL-3.0

img

ImRAD

ImRAD is a GUI builder for the ImGui library. It generates and parses C++ code.

ImRAD runs on Windows and Linux.

Features

ImRAD is under active development but these are the main features:

  • supports designing all kinds of ImGui windows

    • floating windows, popups and modal popups. These are ImGui backend independent
    • MainWindow with GLFW integration. ImRAD generates GLFW calls which will synchronize ImGui window with its OS window (title bar, resizability flags, autosize etc.)
    • contains a GLFW template for generating generic main.cpp
  • supports wide range of widgets

    • basic widgets like Text, Checkbox, Combo, Button, Slider, ColorEdit etc.
    • container widgets like Child, Table, CollapsingHeader, TreeNode, TabBar,
    • more exotic widgets such as Splitter
    • MenuBar and context menu editing
    • CustomWidget (a placeholder to user code)
  • generates layout using SameLine/Spacing/NextColumn/BeginGroup instead of absolute positioning

    • This ensures widgets respect item spacing and frame padding in a consistent way
    • There is a clear relationship between parent - child widget as well as children ordering which is important for container widgets like Table
  • supports property binding

    • class variables can be managed through simple class wizard or from binding dialog
    • property binding is important because ImGui is immediate mode GUI library so widget states like input text or combobox items must be set at the time of drawing from within the generated code.
    • using property binding generated UI becomes dynamic and yet it can still be designed at the same time
  • supports generating event handlers and other support code

    • for example modal dialog will generate OpenPopup member function with a lambda callback called when dialog is closed
    • event handlers allow event handling user code to be separated from the generated part so the designer still works
  • generated code is delimited by comment markers and user is free to add additional code around and continue to use ImRAD at the same time

    • this can be used to call dependent popup Draw calls or to calculate some variables
    • it is also possible to use CustomWidget which will just call to a user code callback
  • target window style is fully configurable

    • apart from default styles provided by ImGui user can define new style and save it as an INI file under the style folder. Colors, style variables and used fonts can all be configured.
    • ImRAD will follow style settings when designing your UI
    • stored style can be loaded in your app by using simple imrad.h function
  • generated code is ready to use in your project and depends only on ImGui library and one accompanying header file (imrad.h)

    • some features such as MainWindow or Image widget require GLFW dependency. Compile your code with IMRAD_WITH_GLFW to activate it
    • currently Image widget requires stb library as well. Compile your code with IMRAD_WITH_STB or supply your own LoadTextureFromFile()
    • optional support for the popular fmt library can be activated by defining IMRAD_WITH_FMT. This will allow you to use formating flags throughout all string properties
  • ImRAD tracks changes to the opened files so files can be designed in ImRAD and edited in your IDE of choice at the same time

    • maybe the auto-save feature would be useful to have

License

  • ImRAD source code is licensed under the GPL license
  • Any code generated by the tool is excluded from GPL and can be included in any project either open-source or commercial and it's up to the user to decide the license for it.
  • Additionally since imrad.h is used by the generated code it is also excluded from the GPL license

Download binaries

for up-to date version clone & build the repository using CMake.

Somewhat older version can be downloaded from Releases

How to build

Windows

  1. Use CMake GUI to configure and generate sln file
  2. Open the generated sln file in Visual Studio 2017 or newer (you can use Express or Community editions which are downloadable for free)
  3. Build the INSTALL project in Release mode. It may require running VS with admin rights
  4. If you didn't alter CMAKE_INSTALL_PREFIX variable ImRAD will be installed into C:\Program Files\imrad\latest

Linux

  1. Run the provided installation script (script parameter is the ImRAD version you want to name the folder)

    sudo ./release-linux 0.5

  2. ImRAD will be installed into ./install/imrad-0.5

How to debug

Windows

  1. Build the INSTALL target in VS as described above
  2. Set imrad as startup project, set its working directory to the installed folder
  3. Debug & Run

Screenshots

screen1

More information

Please check wiki for tutorials and more detailed content

Credits

Design and implementation - Tomas Pecholt

Thanks to Omar Cornut for Dear ImGui