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.

lgui's People

Contributors

frank256 avatar jacmoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

magelive mfkiwl

lgui's Issues

Examples wanted

I am currently overwhelmed by browsing through the many, many files in the tests directory.

A couple of simple examples of how to integrate this with your existing projects would be really nice!

I notice that it uses some Allegro transforms, so that probably has to be set for the GUI. I am not using transform in my project because I draw pixels only.

I am sure that I can manage to figure it out, but I am sure that people will appreciate if there are a couple of "getting started" examples for this library :)

Drop Down Box item ignores the selection when the user switches from mouse to keyboard input

First of all, awesome work!
While playing around with the lguitest I think I've just found a little bug in the drop down list control.

Here's how you reproduce the strange behaviour:
If you click a drop down list control and leave the mouse cursor on an item but then choose some other item from the list via keyboard, the control ignores what you've chosen via the keyboard and selects the item which was under the cursor.

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.