u 通过实例来学习emWin是最佳的学习捷径。
u 本章节讲解的例子中用到的部分功能还没有讲解到,但是不影响大家学习窗口管理器相关的知识。没有讲解到的知识基本都会在后面章节中跟大家讲解。
u 窗口管理器这块的API函数应该是emWin手册所有章节中函数最多的,以后需要用到什么功能了,查询就行,或者看官方的实例,哪个函数不理解了也可以查手册。下图是中文版手册里面API函数位置:
/*******************************************************************
*
* _ChangeInfoText
*
* Function description
* Sends a message to the background window and invalidate it, so
* the callback of the background window display the new text.
*/
static void _ChangeInfoText(char * pStr) { //--------------(2)
WM_MESSAGE Message;
/*******************************************************************
*
* _DrawInfoText
*
* Function description
* Drawes the info text directly on the display. This function is for
* the moments when no callback is set.
*/
static void _DrawInfoText(char * pStr) { //--------------(3)
GUI_SetColor(GUI_WHITE);
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("WindowManager - Sample", 160, 5);
GUI_SetFont(&GUI_Font8x16);
GUI_DispStringAtCEOL(pStr, 5, 40);
}
/*******************************************************************
*
* _ChangeInfoText
*
* Function description
* Sends a message to the background window and invalidate it, so
* the callback of the background window display the new text.
*/
static void _ChangeInfoText(char * pStr) { //--------------(2)
WM_MESSAGE Message;
/*******************************************************************
*
* _DrawInfoText
*
* Function description
* Drawes the info text directly on the display. This function is for
* the moments when no callback is set.
*/
static void _DrawInfoText(char * pStr) { //--------------(3)
GUI_SetColor(GUI_WHITE);
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("WindowManager - Sample", 160, 5);
GUI_SetFont(&GUI_Font8x16);
GUI_DispStringAtCEOL(pStr, 5, 40);
}
/*******************************************************************
*
* _ChangeInfoText
*
* Function description
* Sends a message to the background window and invalidate it, so
* the callback of the background window display the new text.
*/
static void _ChangeInfoText(char * pStr) { //--------------(2)
WM_MESSAGE Message;
/*******************************************************************
*
* _DrawInfoText
*
* Function description
* Drawes the info text directly on the display. This function is for
* the moments when no callback is set.
*/
static void _DrawInfoText(char * pStr) { //--------------(3)
GUI_SetColor(GUI_WHITE);
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("WindowManager - Sample", 160, 5);
GUI_SetFont(&GUI_Font8x16);
GUI_DispStringAtCEOL(pStr, 5, 40);
}
/*******************************************************************
*
* _ChangeInfoText
*
* Function description
* Sends a message to the background window and invalidate it, so
* the callback of the background window display the new text.
*/
static void _ChangeInfoText(char * pStr) { //--------------(2)
WM_MESSAGE Message;
/*******************************************************************
*
* _DrawInfoText
*
* Function description
* Drawes the info text directly on the display. This function is for
* the moments when no callback is set.
*/
static void _DrawInfoText(char * pStr) { //--------------(3)
GUI_SetColor(GUI_WHITE);
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("WindowManager - Sample", 160, 5);
GUI_SetFont(&GUI_Font8x16);
GUI_DispStringAtCEOL(pStr, 5, 40);
}