初级会员
- 积分
- 124
- 金钱
- 124
- 注册时间
- 2019-5-12
- 在线时间
- 61 小时
|
1金钱
刚把emwin移植好,目前想把edit内的数据进行实时更新,但是试了好多次不行,不知道哪里出问题了,希望大佬们指导一下
static void _cbDialog(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int NCode;
int Id;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
//
// Initialization of 'Framewin'
//
hItem = pMsg->hWin;
FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
FRAMEWIN_SetText(hItem, "Framewin");
FRAMEWIN_SetTextColor(hItem, GUI_MAKE_COLOR(0x00A00000));
FRAMEWIN_SetFont(hItem, GUI_FONT_16B_ASCII);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0);
EDIT_SetText(hItem, "123");
EDIT_SetTextColor(hItem, EDIT_CI_ENABLED, GUI_MAKE_COLOR(0x000000FF));
EDIT_SetFont(hItem, GUI_FONT_16B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
// USER START (Optionally insert additional code for further widget initialization)
// USER END
break;
case WM_TIMER://在此处对edit内数据更新。但是并不会更新
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0);//获取小工具的句柄
EDIT_SetText(hItem, "110");
//EDIT_SetTextColor(hItem, EDIT_CI_ENABLED, GUI_MAKE_COLOR(0x000000FF));
EDIT_SetFont(hItem, GUI_FONT_16B_ASCII);
EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
WM_RestartTimer(pMsg->Data.v, 1000);
|
|