Giter Club home page Giter Club logo

lgui's Introduction

lgui

lgui is a C++ 11/14 GUI currently coming with an Allegro 5 backend.

Features

  • easy to use signals & slots to connect widgets (just register something callable - a std::function)
  • two pass layout system, Android style; separate widgets and layouts, nestable layouts
  • drawing done in separate style classes
  • internal drag and drop
  • transformations
  • animations
  • modal widgets, GUI stacks
  • event filters
  • 9-patch images

Screenshots

Dark theme:

Dark theme

Bright theme:

Bright theme

Code samples

React to button click:

button.on_activated.connect([this]() {
    do_something();    
});

Mirror text from a text input field in a text label somewhere else:

input.on_text_changed.connect([this](const std::string& text) {
    text_label.set_text(text);
});

Construct a relative layout:

using Constraint = lgui::RelativeLayout::Constraint;
lgui::RelativeLayout layout;
layout.add_item(bt1, { {Constraint::AlignParentTop} });
layout.add_item(bt2, { {Constraint::AlignLeft,  bt1}, {Constraint::Below, bt1} });
layout.add_item(bt3, { {Constraint::RightOf,    bt2}, {Constraint::Below, bt2} });
layout.add_item(bt4, { {Constraint::AlignRight, bt3}, {Constraint::Below, bt3},
                       {Constraint::AlignParentBottom } });
layout.add_item_ltrb(big_button, 0.7, 0.3, 0.9, 0.4);
container.set_layout(&layout);

Dependencies

You need to have Allegro5 and CMake installed; for the documentation, doxygen is needed as well.

The documentation has to be generated explicitly by issuing the make doc command from within your build directory.

Feel free to report any issues you might have. Or fix them right away ;) -- pull requests are welcome.

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.