Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

How to implement window switching on the LCD screen

$
0
0

Hi,everyone

I created some small objects in GUIX and I hope to implement window switching by operating on small objects. In e2 studio, after running the code, I didn't have any errors or warnings, but when I was burning the program, only the first window's interface could be displayed on the LCD screen, and the window could not be switched by clicking. . I hope you can help me.
The source code is as follows:

 

UINT window1_handler(GX_WINDOW *widget, GX_EVENT *event_ptr)
{
UINT result = gx_window_event_process(widget, event_ptr);

switch (event_ptr->gx_event_type)
{
case GX_SIGNAL(ID_CHECKBOX, GX_EVENT_TOGGLE_ON):
button_enabled = true;
update_text_id(widget->gx_widget_parent, ID_PROMPT_MAIN, GX_STRING_ID_BUTTON_STATUS);
update_text_id(widget->gx_widget_parent, ID_TEXT_BUTTON_STARTED, GX_STRING_ID_BUTTON_CONTINUE);
break;
case GX_SIGNAL(ID_CHECKBOX, GX_EVENT_TOGGLE_OFF):
button_enabled = false;
update_text_id(widget->gx_widget_parent, ID_PROMPT_MAIN, GX_STRING_ID_PROMPT_HOME);
update_text_id(widget->gx_widget_parent, ID_TEXT_BUTTON_STARTED, GX_STRING_ID_BUTTON_STATUS);
break;
case GX_SIGNAL(ID_TEXT_BUTTON_STARTED, GX_EVENT_CLICKED):
if(button_enabled){
show_window((GX_WINDOW*)&window2, (GX_WIDGET*)widget, true);
}
break;
default:
gx_window_event_process(widget, event_ptr);
break;
}

return result;
}

UINT window2_handler(GX_WINDOW *widget, GX_EVENT *event_ptr)
{
UINT result = gx_window_event_process(widget, event_ptr);

switch (event_ptr->gx_event_type)
{
case GX_SIGNAL(ID_BUTTON_HOME, GX_EVENT_CLICKED):
button_enabled = true;
if(button_enabled){
show_window((GX_WINDOW*)&window1, (GX_WIDGET*)widget, true);
}
break;
default:
gx_window_event_process(widget, event_ptr);
break;
}
return result;
}

 

Best regards,

ghg


Viewing all articles
Browse latest Browse all 5781

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>