uEZ GUI Start Here Guide
UEZGUI-1788-56VI
Rev. 1.11 Aug 31, 2016
Page 15
5.
Build, download, debug, and run the updated project to display the created button.
For IAR: Press [Ctrl]+[D].
For Crossworks: Press [F5].
The button does not do anything yet because it lacks a callback function, but this
will be added later once a second window has been created for the button to switch
to.
D.
Creating a New Window
In order to have the button open a new window, a new window file similar to the
HomeScreen.c file needs to be created. Since each window requires the same general
structure, copy the existing HomeScreen.c file, instead of creating a new file from
scratch.
1.
Right click the HomeScreen.c file
For IAR: Select “Open Containing Folder…”.
For Crossworks: Select “Select in File Explorer”.
2.
Copy the HomeScreen.c file located in the emWin directory and rename it
SecondScreen.c.
3.
Back in the IDE, right click the emWin folder.
For IAR: Select “Add > Add Files…”.
For Crossworks: Select “Add Existing File...”.
4.
In the browse files dialog that appears, select SecondScreen.c and click Open.
5.
Open the new file by double clicking it in the IDE workspace or project explorer.
6.
Rename all instances of “HomeScreen” to “SecondScreen” (only in that file).
/** Generic Mapping of Screen Layout*/
static
T_LAFMapping HomeScreenMapping
[]
=
{
{
ID_WINDOW
,
""
,
GUI_BLACK
,
GUI_WHITE
,
&
FONT_SMALL
,
LAFSetupWindow
,
0
},
{
ID_TITLE_TEXT
,
"My Main Screen"
,
GUI_BLACK
,
GUI_WHITE
,
&
FONT_LARGE
,
LAFSetupText
,
0
},
{
ID_MYBUTTON_BUTTON
,
"Temperature"
,
GUI_GRAY
,
GUI_BLACK
,
&
FONT_LARGE
,
LAFSetupButton
,
0
},
{
ID_FDIINFO_TEXT
,
"Future Designs, Inc. 2016 www.TeamFDI.com"
,
GUI_BLACK
,
GUI_WHITE
,
FONTSIZE
,
LAFSetupText
,
0
},
{
0
},
};
Figure 16:
Button
Added