Version 2 issues: C code generation, preview

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Version 2 issues: C code generation, preview

452 Views
poldo
Contributor I

Hi!

I started testing GUI Guider version 2, and I found a couple of issues (starting with an empty template, Windows simulator).

I started defining the content of the top layer putting an image button, creating an event handler to switch state when the button is long pressed.

The generated the code has some errors, like:

gg_event_layer_top.c:
  static void lv_layer_top()_event_handler(lv_event_t * e) {
    ...
  }

void gg_event_init_layer_top(gg_ui_t * ui
  lv_obj_add_event_cb(ui->layer_top.lv_layer_top(),  lv_layer_top()_event_handler, LV_EVENT_ALL, ui);

 

(parenthesis create a parsing error)

Manually removing the parenthesis, the error below is generated:


.../generated/events/gg_event_layer_top.c:59:38: error: 'gg_layer_top_t' has no member named 'lv_layer_top'

(gg_layer_top_t definition doesn't include that member)

Am I missing some definition to make a correct generation of those functions?

 

0 Kudos
Reply
7 Replies

176 Views
poldo
Contributor I

Hi @Harry_Zhang .

 

The issue is when you create objects on the top layr. I'm attaching my file for your review and test.

0 Kudos
Reply

47 Views
meibao
Fresh Out Contributor

This is a bug, and the fix is simple. Find your guiguider file and open it in text mode. Locate the event_list, remove any extra content, and then use the guider to reload the project. The generated code will return to normal.

 

0 Kudos
Reply

62 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @poldo 

Thanks for your project, we have reproduced this issue.

This is a bug.

We will fix it in the next version.

Thank you for your understanding.

BR

Harry

0 Kudos
Reply

51 Views
poldo
Contributor I

Thank you, @Harry_Zhang .

 

Is there a workaround that could be used while waiting for the update?

 

BR

0 Kudos
Reply

368 Views
poldo
Contributor I

Hi @Harry_Zhang , thank you for your reply.

This is what I did:

- On layer_top (clickable flag added, is this necessary?) I created a container for my buttons (no clickable flag added) 
- Inside the container I created an image button (clickable flag added) 
- I attached the event "Long Pressed" to the button

poldo_0-1784023768341.png

Generated code contains the syntax errors above.

// In gg_event_layer_top.c
static void lv_layer_top()_event_handler(lv_event_t * e)
{
    gg_ui_t * ui = lv_event_get_user_data(e);

    lv_event_code_t code = lv_event_get_code(e);

    switch(code) {

        default:
            break;
    }
}

void gg_event_init_layer_top(gg_ui_t * ui)
{
    lv_obj_add_event_cb(ui->layer_top.lv_layer_top(), lv_layer_top()_event_handler, LV_EVENT_ALL, ui);
    lv_obj_add_event_cb(ui->layer_top.Keypad_btnEnable, Keypad_btnEnable_event_handler, LV_EVENT_ALL, ui);
}

 

Removing the parenthesis the syntax error is about the member lv_layer_top not existing:

 

// In custom.h
typedef struct {

    lv_obj_t * Keypad;
    lv_obj_t * Keypad_btnEnable;
} gg_layer_top_t;

BR

Poldo

0 Kudos
Reply

339 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @poldo 

I tried to reproduce this issue.

Harry_Zhang_0-1784102463813.png

The generated code is correct.

Harry_Zhang_1-1784102495298.png

May I ask what I missed?

BR

Harry

0 Kudos
Reply

394 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @poldo 

May i ask how can i reproduce this issue?

Harry_Zhang_0-1783917409079.png

BR

Harry

0 Kudos
Reply