Skip to content

GUI generator for "Activity tracker done right™"

Notifications You must be signed in to change notification settings

szymek156/bc-gui-maker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bc-gui-maker

Quick And Dirty GUI generator for my embedded project

  1. You declare GUI layout
let welcome_page = v_layout([
            h_line(),
            v_line(),
            h_layout([
                v_layout([tile("Paused").with_font_size(42), h_line(), tile("")]),
                v_list(["Resume", "Save", "Discard"]).with_font_size(24),
            ]),
        ]);
  1. Application calculates font sizes, coordinates of GUI elements and dumps it to the C++ code (so you don't have to write it anymore!)
// Following code is generated automagically,
// don't bother understand it.
// Paused
display_->enqueueDraw(
    [&](Paint &paint) {
        const int msg_size = 128;
        char message[msg_size];

        snprintf(message, msg_size, "Paused");
        paint.DrawStringAt(28, 57, message, &Font42, COLORED);
},
{1, 25, 199, 131});

// 
display_->enqueueDraw(
    [&](Paint &paint) {
        const int msg_size = 128;
        char message[msg_size];

        snprintf(message, msg_size, "");
        paint.DrawStringAt(100, 158, message, &Font56, COLORED);
},
{1, 133, 199, 239});

// CTOR
VListWidget(display, {"Resume", "Save", "Discard"}, Font24, {201, 25, 399, 239})
  1. You can peek how GUI will look like using the preview window:

drawing

About

GUI generator for "Activity tracker done right™"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages