初级会员
- 积分
- 149
- 金钱
- 149
- 注册时间
- 2019-9-4
- 在线时间
- 39 小时
|
1金钱
刚接触EMWIN没多久,想做个自定义位置的输入浮点数的EDIT,并给他个自定义回调函数但是EDIT一直显示纯灰色,想请大牛帮忙找找问题,
void EDIT_CURSORCreate(int EDIT_X, int EDIT_Y) {
EDIT_Handle hEdit;
hEdit = EDIT_CreateEx(
EDIT_X,
EDIT_Y,
70,
50,
0,
WM_CF_SHOW,
0,
ID_EDIT_Cursor,
7
);
//EDIT_SetTextAlign(hEdit, GUI_TA_VCENTER | GUI_TA_HCENTER);
//EDIT_SetFloatMode(hEdit, 0, 0, 60, 2, 0);//①
//EDIT_SetFloatValue(hEdit, set_volt);//设置编辑框新浮点数值
WM_SetCallback(hEdit, _cbEDITCursor);
KeyBoard_page();
WM_SetFocus(hEdit);
};
static void _cbEDITCursor(WM_MESSAGE *pMsg)
{
WM_HWIN hEdit;
switch (pMsg->MsgId) {
case WM_PAINT:
GUI_SetBkColor(GUI_WHITE);
GUI_Clear;
break;
case WM_INIT_DIALOG:
hEdit = pMsg->hWin;
EDIT_SetTextAlign(hEdit, GUI_TA_VCENTER | GUI_TA_HCENTER);
EDIT_SetFloatMode(hEdit, 0, 0, 60, 2, 0);//①
EDIT_SetFloatValue(hEdit, set_volt);//设置编辑框新浮点数值
// USER START (Optionally insert additional code for further widget initialization)
// USER END
break;
case WM_NOTIFY_PARENT:
break;
// USER START (Optionally insert additional message handling)
// USER END
default:
WM_DefaultProc(pMsg);
break;
}
}
右边是EDIT框
|
|