5165 views|7 replies

9

Posts

2

Resources
The OP
 

Ultra-lightweight open source GUI, about 4,000 lines of effective code, extremely easy to port [Copy link]

Open source small GUI, only two files are needed, gui.c and gui.h
1. Resource requirements
Estimated minimum hardware requirements:
ROM 13K
RAM 2K


2. Open source address
Open source GUI address
https://github.com/achimdoebler/UGUI


3. GUI Framework
The GUI framework consists of:
1. Window: multiple windows can be drawn;
2. Control: other controls such as buttons and text boxes can be displayed in the window;
3. Event processing: interface and user interaction, event callback, such as touch events;
4. Interface function: a developer-friendly interface is provided;
5. Extension: users can modify the source code to add other controls.

4. Migration Instructions

4.1. First you need to prepare the project template, and then you can start the migration.
4.2. Construct the following three functions, namely line drawing, filling, and point drawing. The point drawing function is the most basic and must be established when transplanting UGUI. Please note that it is necessary to confirm that the three functions can be displayed normally on the display screen. As shown in the following figure:

4.3. Initialize the GUI to complete the migration

4.4. Some MCUs have built-in graphics accelerators, which require the following functions to be registered and enabled
5. Introduction to GUI functions
For all GUI function descriptions, please refer to the official manual
5.1. For example, to create a window, the following figure shows the code and display effect:
Note that at this point , we have simply completed the definition of the window1 control. The LCD has not yet displayed the drawing window. To display the window, you must call UG_Update() in the main loop or timer interrupt .
5.2. Another thing is to implement the callback click processing function of the controls in the window , as follows:

5.3. Window Control Management
Window control management: If you need several spaces in a window, you need to define several related type variables. The obj_buff[] array is used to record the space in your window and manage and retrieve these controls in array mode. A window can hold N controls, which is controlled by the macro switch MAX_OBJECTS .
6. How to implement touch control
As shown in the following code, first get the touch coordinates, then confirm that the touch state is pressed, call UG_TouchUpdate to update the coordinate information, and then UG_Update()window_1_callback described above , which determines which control is pressed and then processes the corresponding function.
For detailed instructions, please refer to the migration documentation.
GUI移植和使用说明.pdf (1.47 MB, downloads: 43)

This post is from Embedded System

Latest reply

Of course, the more stable and reliable a system is, the more UI elements and functions it has, the better. After all, porting only takes a little time, but using it may take a long time. ThreadX's GUI may be the only GUI system that has passed various rigorous certifications. You can check it out on the official website.   Details Published on 2020-9-9 13:36

2

Posts

0

Resources
2
 
Can you tell me how to implement Chinese display and EDIT control?
This post is from Embedded System
 
 

9

Posts

2

Resources
3
 
dwj0 posted on 2020-9-6 14:13 Can you tell me how to implement Chinese display and how to implement EDIT control

Hello, Chinese display is not supported yet. I will add Chinese display later. You can refer to the example above for the use of controls.

This post is from Embedded System
 
 
 

7422

Posts

2

Resources
4
 

There has been no update for 5 years, so it’s better to wait and see.

This post is from Embedded System
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

9

Posts

2

Resources
5
 
freebsder posted on 2020-9-7 19:45 It has not been updated for 5 years, so it is better to wait and see.

The source code is completely open source, this can be improved by yourself

This post is from Embedded System

Comments

Check out threadx's open source gui.  Details Published on 2020-9-8 15:39
 
 
 

7422

Posts

2

Resources
6
 
LONGSHEN1 posted on 2020-9-8 13:55 The source code is completely open source, this can be improved by yourself

Check out threadx's open source gui.

This post is from Embedded System
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

9

Posts

2

Resources
7
 
freebsder posted on 2020-9-8 15:39 Check out threadx's open source gui.

I have never used threadx's GUI, but I think each has its own advantages. I used ugui because it was small and easy to port, because the resources of the microcontroller I used were limited.

This post is from Embedded System

Comments

Of course, the more stable and reliable a system is, the more UI elements and functions it has, the better. After all, porting only takes a little time, but using it may take a long time. ThreadX's GUI may be the only GUI system that has passed various rigorous certifications. You can check it out on the official website.  Details Published on 2020-9-9 13:36
 
 
 

7422

Posts

2

Resources
8
 
LONGSHEN1 posted on 2020-9-9 09:50 I have never used threadx's GUI, but I think each has its own advantages. I used ugui because it was small and easy to port, because the microcontroller resources I used at the time...

Of course, the more stable and reliable a system is, the more UI elements and functions it has, the better. After all, porting only takes a little time, but using it may take a long time. ThreadX's GUI may be the only GUI system that has passed various rigorous certifications. You can check it out on the official website.

This post is from Embedded System
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list