I have a Edit on a Dialog which should display a default string like "123456_789abc". However, when I run this code, only "123456_7" is displayed while other chars are missing. I typed the missing chars into the Edit on touch screen manually and it is succesful. This means the Edit have enough space to display the whole string. The question is why the string is truncated in this Edit?
Display All
Source Code
- void _cbDialogSave(WM_MESSAGE * pMsg) {
- switch (pMsg->MsgId) {
- case WM_INIT_DIALOG:
- // Edit
- hItem = WM_GetDialogItem(pMsg->hWin, ID_WENJIANMING_EDIT);
- EDIT_SetText(hItem, "123456_789abc");
- EDIT_SetFont(hItem, GUI_FONT_20_1);
- EDIT_SetTextAlign(hItem, GUI_TA_LEFT | GUI_TA_VCENTER);
- EDIT_SetTextColor(hItem, EDIT_CI_ENABLED, GUI_BLACK);
- EDIT_SetMaxLen(hItem, 1000);
- WM_SetFocus(hItem);
- // BUTTON1 & BUTTON2
- ...
- break;
- case WM_PAINT:
- GUI_SetBkColor(GUI_DARKBLUE);
- GUI_Clear();
- break;
- case WM_NOTIFY_PARENT:
- Id = WM_GetId(pMsg->hWinSrc);
- NCode = pMsg->Data.v;
- switch (Id) {
- case BUTTON1:
- ...
- break;
- case BUTTON2:
- ...
- break;
- }
- break;
- default:
- WM_DefaultProc(pMsg);
- break;
- }
- }