uEZ GUI Start Here Guide
UEZGUI-1788-43WQR
Rev. 1.11 Aug 31, 2016
Page 11
To see where the window is developed, examine the folder structure of the initial
project.
All of the source code used to provide functionality to the project is within the
“Source\App” directory. The “Source\App\emWin” directory contains the code that
uses emWin to create and manage windows and other graphic designs for the GUI.
C.
Adding a Button to the Home Screen
To demonstrate the process for adding widgets to a window, this section will walk you
through the steps to create a button on the home screen which, once pressed, will open
to a new window. To begin, open the HomeScreen.c file in the emWin directory.
The HomeScreen.c file contains the information that is used to create a window and any
widgets (buttons, etc) that will load with the window. The beginning of the file contains
the #includes and a list of definitions that define the ID, size, and position of each object
within the window including the window itself.
In the next section, “Local Data”, there are two array variables which define the window
and widgets and associate callback functions to them. The first array,
_iHomeScreenDialog[ ], is an emWin array that holds the ID, position, and size for each
widget. The second array, HomeScreenMapping[ ] is a µEZ array which holds their text
label, color, font, and callback functions.
NOTE: A callback function is a function which is called when an associated event occurs.
For buttons, this event is a touch event. When the button is pressed (or depressed), the
callback function is run to perform the desired task.
Figure 15:
File
Hierarchy