最近因为需要,移植了原子的历程,emwin扩展历程40软键盘实验,前后调试了好几天,实在是想不出问题原因了发帖求助大神
说下问题:我是用button按钮控制调出一个framewin窗口,然后窗口里有multiedit多文本控件,调这个窗口同时软键盘也被调用出来,当我什么也不变,关闭键盘和界面后再打开就没问题,因为默认是英文输入法,当我换成符号输入或者数字输入或者中文输入时,不打字在退出界面和关闭键盘,再打开就会出现卡死,系统进入hardfault
很奇怪
我认为问题应该出现在键盘这里,不调用键盘怎么整都没事,调用键盘,键盘的按钮一个也不按,退出再进来就没问题,一旦切换输入模式,退出再进来就完蛋,不知各位坛友有没有遇到过这种问题,也求助论坛大佬给个指点建议,我可以多多尝试,感谢感谢。
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
{
WM_HWIN hFrame;
WM_HWIN hItem;
WM_MESSAGE Msg;
WM_HWIN hWin = pMsg->hWin;
u8 dbuf[50];
int datalen=0;
int NCode;
int Id;
switch (pMsg->MsgId)
{
case WM_PAINT:
break;
case WM_INIT_DIALOG:
hItem = pMsg->hWin;
FRAMEWIN_SetFont(hItem, &GUI_FontHZ24);
FRAMEWIN_SetTextColor(hItem,0x0000FFFF);
FRAMEWIN_SetTextAlign(hItem,GUI_TA_HCENTER |GUI_TA_VCENTER);
FRAMEWIN_SetText(hItem,"¼èë3éÔ±DÅÏ¢");
GUI_SetTextMode(GUI_TM_TRANS);
TEXT_SetTextColor(WM_GetDialogItem(hWin,ID_TEXT_14), GUI_RED);
TEXT_SetFont(WM_GetDialogItem(hWin,ID_TEXT_14), &GUI_FontHZ24);
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_14);
BUTTON_SetFont(hItem, &GUI_FontHZ32);
BUTTON_SetText(hItem, "íË3ö");
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_15);
BUTTON_SetFont(hItem, &GUI_FontHZ32);
BUTTON_SetText(hItem, "è·èÏ");
// keypad_dev.xpos=0;
// keypad_dev.ypos=160;
// keypad_dev.width=480;
// keypad_dev.height=320;
if(aa==0)
{
keypad_dev.padtype=ENGLISH_KEYPAD; //ĬèÏÎaó¢ÎļüÅì
keypad_dev.signpad_flag=0;
keypad_dev.signpad_num=2;
keypad_dev.inputlen=0;
keypad_dev.pynowpage=0;
keypad_dev.cur_index=0;
keypad_dev.sta=0;
//
//éèÖÃkeypadËùê1óÃμÄ°′Å¥μÄƤ·ô
BUTTON_SetDefaultSkin(_DrawSkinFlex_BUTTON); //éèÖÃBUTTONμÄƤ·ô
//′′½¨keypad
keypad_dev.hKeypad = WM_CreateWindowAsChild(0,160,480,320, WM_HBKWIN, WM_CF_SHOW | WM_CF_STAYONTOP, _cbKeyPad, 0);
//éèÖÃnotepadêôDÔ
BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX);
FRAMEWIN_SetDefaultTextAlign(GUI_TA_HCENTER);
aa=1;
}
if(aa==1)
WM_ShowWindow(keypad_dev.hKeypad);
//3õê¼»ˉEDIT
hMulti = WM_GetDialogItem(pMsg->hWin, ID_MULTIEDIT_0);
MULTIEDIT_EnableBlink(hMulti,500,1); //¿aÆô1a±ê,ÖüÆú500ms
// MULTIEDIT_SetInsertMode(hMulti,1); //¿aÆô2åèëÄ£ê½
// MULTIEDIT_SetMaxNumChars(hMulti,20);
MULTIEDIT_SetFont(hMulti, &GUI_FontHZ24);
// MULTIEDIT_SetFocussable(hMulti,1);
// MULTIEDIT_SetText(hMulti, "ÄãoÃÄã»1 ÄãoÃÄãoÃ");
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id)
{
case ID_BUTTON_14:
//hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_14);
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED: //°′Å¥±»°′ÏÂ2¢êí·Å
hMulti = WM_GetDialogItem(pMsg->hWin, ID_MULTIEDIT_0);
MULTIEDIT_SetText(hMulti,NULL);
WM_DeleteWindow(hMulti);
WM_HideWindow(keypad_dev.hKeypad);
Msg.MsgId=WM_DELETEWIN;
Msg.hWinSrc=pMsg->hWin;
WM_SendMessage(WM_HBKWIN,&Msg);
break;
}
break;
case ID_MULTIEDIT_0: //EDIT¿Ø¼tí¨ÖaÏûÏ¢
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
// keypad_dev.hKeypad = WM_CreateWindowAsChild(keypad_dev.xpos,keypad_dev.ypos,keypad_dev.width,keypad_dev.height, WM_HBKWIN, WM_CF_SHOW | WM_CF_STAYONTOP, _cbKeyPad, 0);
break;
case WM_NOTIFICATION_VALUE_CHANGED:
break;
}
break;
case ID_BUTTON_15:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
hItem=WM_GetDialogItem(pMsg->hWin,ID_MULTIEDIT_0);
datalen=MULTIEDIT_GetTextSize(hItem)+1;
MULTIEDIT_GetText(hItem,(char*)dbuf,datalen);
TEXT_SetText(WM_GetDialogItem(hWin,ID_TEXT_14), (const char *)dbuf);
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}[/mw_shl_code]
一周热门 更多>