初级会员
- 积分
- 75
- 金钱
- 75
- 注册时间
- 2014-12-14
- 在线时间
- 0 小时
|
5金钱
hEDIT0001为EDIT1句柄 hEDIT0002为EDIT2句柄 由9个按键输入值
tatic void _cbCallback(WM_MESSAGE * pMsg)
{
int NCode, Id;
WM_HWIN hWin = pMsg->hWin;
switch (pMsg->MsgId)
{
case WM_PAINT:
PaintDialog04(pMsg);
break;
case WM_INIT_DIALOG:
InitDialog04(pMsg);
break;
case WM_KEY:
switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key)
{
case GUI_KEY_ESCAPE:
GUI_EndDialog(hWin, 1);
break;
case GUI_KEY_ENTER:
GUI_EndDialog(hWin, 0);
break;
}
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch (Id)
{
// case GUI_ID_OK:
// if(NCode==WM_NOTIFICATION_RELEASED)
// GUI_EndDialog(hWin, 0);
// break;
// case GUI_ID_CANCEL:
// if(NCode==WM_NOTIFICATION_RELEASED)
// GUI_EndDialog(hWin, 0);
// break;
case GUI_ID_BUTTON0:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
EDIT_SetText(hEDIT0002,NULL);//EDIT????????
EDIT_SetText(hEDIT0001,NULL);//EDIT????????
GUI_Exec1();
WM_HideWindow(HWIN4);//?????ù??????
WM_ShowWindow(HWIN3);
NUMBER3=0 ;
break;
}
break;
case GUI_ID_BUTTON1:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
EDIT_SetText(hEDIT0002,NULL);//EDIT????????
EDIT_SetText(hEDIT0001,NULL);//EDIT????????
GUI_Exec1();
WM_HideWindow(HWIN4);//?????ù??????
WM_ShowWindow(HWIN3);
NUMBER3=0 ;
break;
}
break;
case GUI_ID_YES:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
// WM_SetFocus(Cd_edit_handle); // ??±ê???¨edit?
EDIT_SetValue(Cd_edit_handle,0);
// if(WM_HasFocus(hWin)==hEDIT0001)
// // if(WM_GetFocussedWindow()==hEDIT0001)
// { //WM_SetFocus(hEDIT0001);
//// EDIT_AddKey(hEDIT0001,'0');//????0 ???
// EDIT_SetValue(Cd_edit_handle,0);
// }
// else if(WM_HasFocus(hWin)==hEDIT0002)
// {
// //WM_SetFocus(hEDIT0002);
// //EDIT_AddKey(hEDIT0002,'0');//????0 ????
// EDIT_SetValue(hEDIT0001,0);
// }
// //EDIT_AddKey(hedit,'0');
//
GUI_Exec1();
break;
}
break;
case GUI_ID_NO:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
// WM_SetFocus(Cd_edit_handle); // ??±ê???¨edit?
// EDIT_SetValue(Cd_edit_handle,1);
// if(WM_HasFocus(hWin)==hEDIT0001)
// // if(WM_GetFocussedWindow()==hEDIT0001)
// { // WM_SetFocus(hEDIT0001);
// // EDIT_AddKey(hEDIT0001,'0');//????0 ???
// EDIT_SetValue(Cd_edit_handle,1);
// }
// else if(WM_HasFocus(hWin)==hEDIT0002)
// {
// // WM_SetFocus(hEDIT0002);
// //EDIT_AddKey(hEDIT0002,'0');//????0 ????
// EDIT_SetValue(hEDIT0001,1);
// }
GUI_Exec1();
break;
}
break;
case GUI_ID_BUTTON2:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
// WM_SetFocus(Cd_edit_handle); // ??±ê???¨edit?
// EDIT_SetValue(Cd_edit_handle,2);
// if(WM_HasFocus(hWin)==hEDIT0001)
// { //WM_SetFocus(hEDIT0001);
//// EDIT_AddKey(hEDIT0001,'0');//????0 ???
// EDIT_SetValue(Cd_edit_handle,2);
// }
// else if(WM_HasFocus(hWin)==hEDIT0002)
// {
// //WM_SetFocus(hEDIT0002);
// //EDIT_AddKey(hEDIT0002,'0');//????0 ????
// EDIT_SetValue(hEDIT0001,2);
// }//EDIT_AddKey(hedit,'2');
//
GUI_Exec1();
break;
}
break;
case GUI_ID_BUTTON3:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
// WM_SetFocus(Cd_edit_handle); // ??±ê???¨edit?
// EDIT_SetValue(Cd_edit_handle,3);
// if(WM_HasFocus(hWin)==hEDIT0001)
// { //WM_SetFocus(hEDIT0001);
//// EDIT_AddKey(hEDIT0001,'0');//????0 ???
// EDIT_SetValue(Cd_edit_handle,3);
// }
// else if(WM_HasFocus(hWin)==hEDIT0002)
// {
// //WM_SetFocus(hEDIT0002);
// //EDIT_AddKey(hEDIT0002,'0');//????0 ????
// EDIT_SetValue(hEDIT0001,3);
// }//EDIT_AddKey(hedit,'3');
//
GUI_Exec1();
break;
}
break;
case GUI_ID_BUTTON4:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
// WM_SetFocus(Cd_edit_handle); // ??±ê???¨edit?
// EDIT_SetValue(Cd_edit_handle,4);
// if(WM_HasFocus(hWin)==hEDIT0001)
// { //WM_SetFocus(hEDIT0001);
//// EDIT_AddKey(hEDIT0001,'0');//????0 ???
// EDIT_SetValue(Cd_edit_handle,4);
// }
// else if(WM_HasFocus(hWin)==hEDIT0002)
// {
// //WM_SetFocus(hEDIT0002);
// //EDIT_AddKey(hEDIT0002,'0');//????0 ????
// EDIT_SetValue(hEDIT0001,4);
// }//EDIT_AddKey(hedit,'4');
//
GUI_Exec1();
break;
}
break;
case GUI_ID_BUTTON5:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
//WM_SetFocus(Cd_edit_handle); // ??±ê???¨edit?
// EDIT_SetValue(Cd_edit_handle,5);
// if(WM_HasFocus(hWin)==hEDIT0001)
// { //WM_SetFocus(hEDIT0001);
//// EDIT_AddKey(hEDIT0001,'0');//????0 ???
// EDIT_SetValue(Cd_edit_handle,5);
// }
// else if(WM_HasFocus(hWin)==hEDIT0002)
// {
// //WM_SetFocus(hEDIT0002);
// //EDIT_AddKey(hEDIT0002,'0');//????0 ????
// EDIT_SetValue(hEDIT0001,5);
// }//EDIT_AddKey(hedit,'5');
//
GUI_Exec1();
break;
}
break;
case GUI_ID_BUTTON6:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
//WM_SetFocus(Cd_edit_handle); // ??±ê???¨edit?
// EDIT_SetValue(Cd_edit_handle,6);
// if(WM_HasFocus(hWin)==hEDIT0001)
// { //WM_SetFocus(hEDIT0001);
//// EDIT_AddKey(hEDIT0001,'0');//????0 ???
// EDIT_SetValue(Cd_edit_handle,6);
// }
// else if(WM_HasFocus(hWin)==hEDIT0002)
// {
// //WM_SetFocus(hEDIT0002);
// //EDIT_AddKey(hEDIT0002,'0');//????0 ????
// EDIT_SetValue(hEDIT0001,6);
// }//EDIT_AddKey(hedit,'6');
GUI_Exec1();
break;
}
break;
case GUI_ID_BUTTON7:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
// WM_SetFocus(Cd_edit_handle); // ??±ê???¨edit?
// EDIT_SetValue(Cd_edit_handle,7);
// if(WM_HasFocus(hWin)==hEDIT0001)
// { //WM_SetFocus(hEDIT0001);
//// EDIT_AddKey(hEDIT0001,'0');//????0 ???
// EDIT_SetValue(Cd_edit_handle,7);
// }
// else if(WM_HasFocus(hWin)==hEDIT0002)
// {
// //WM_SetFocus(hEDIT0002);
// //EDIT_AddKey(hEDIT0002,'0');//????0 ????
// EDIT_SetValue(hEDIT0001,7);
// }//EDIT_AddKey(hedit,'7');
//
GUI_Exec1();
break;
}
break;
case GUI_ID_BUTTON8:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
// WM_SetFocus(Cd_edit_handle); // ??±ê???¨edit?
// EDIT_SetValue(Cd_edit_handle,8);
// if(WM_HasFocus(hWin)==hEDIT0001)
// { //WM_SetFocus(hEDIT0001);
//// EDIT_AddKey(hEDIT0001,'0');//????0 ???
// EDIT_SetValue(Cd_edit_handle,8);
// }
// else if(WM_HasFocus(hWin)==hEDIT0002)
// {
// //WM_SetFocus(hEDIT0002);
// //EDIT_AddKey(hEDIT0002,'0');//????0 ????
// EDIT_SetValue(hEDIT0001,8);
// }//EDIT_AddKey(hedit,'8');
//
GUI_Exec1();
break;
}
break;
case GUI_ID_BUTTON9:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
// WM_SetFocus(Cd_edit_handle); // ??±ê???¨edit?
// EDIT_SetValue(Cd_edit_handle,9);
// if(WM_HasFocus(hWin)==hEDIT0001)
// { //WM_SetFocus(hEDIT0001);
//// EDIT_AddKey(hEDIT0001,'0');//????0 ???
// EDIT_SetValue(Cd_edit_handle,9);
// }
// else if(WM_HasFocus(hWin)==hEDIT0002)
// {
// //WM_SetFocus(hEDIT0002);
// //EDIT_AddKey(hEDIT0002,'0');//????0 ????
// EDIT_SetValue(hEDIT0001,9);
// }//EDIT_AddKey(hedit,'9');
//
GUI_Exec1();
break;
}
break;
case GUI_ID_HELP:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
// if(WM_HasFocus(hWin)==hEDIT0001)
// { //WM_SetFocus(hEDIT0001);
// EDIT_SetText(Cd_edit_handle,NULL);//??????????°¤??????????????2??
// }
// else if(WM_HasFocus(hWin)==hEDIT0002)
// {
// // WM_SetFocus(hEDIT0002);
// EDIT_SetText(hEDIT0002,NULL);//??????????°¤??????????????2??
// }
GUI_Exec1();
// EDIT_SetText(hEDIT0001,NULL);//??????????°¤??????????????2??
// EDIT_SetText(hEDIT0002,NULL);//??????????°¤??????????????2??
// GUI_Exec1();
// WM_SetFocus(hEDIT0001);
// GUI_SendKeyMsg(GUI_KEY_BACKSPACE,1);//????????EDIT????
// WM_SetFocus(hEDIT0002);
// GUI_SendKeyMsg(GUI_KEY_BACKSPACE,1);//????????EDIT????
break;
}
break;
case GUI_ID_EDIT0:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
// if(WM_HasFocus(WM_GetDialogItem(hWin,GUI_ID_EDIT1)))
// {
// Cd_edit_handle = WM_GetDialogItem(hWin,GUI_ID_EDIT1);
// }else
// if(WM_HasFocus(WM_GetDialogItem(hWin,GUI_ID_EDIT0)))
// {
// Cd_edit_handle = WM_GetDialogItem(hWin,GUI_ID_EDIT0);
// }
break;
case WM_NOTIFICATION_RELEASED:
break;
case WM_NOTIFICATION_VALUE_CHANGED:
break;
}
break;
case GUI_ID_EDIT1:
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
// if(WM_HasFocus(WM_GetDialogItem(hWin,GUI_ID_EDIT1)))
// {
// Cd_edit_handle = WM_GetDialogItem(hWin,GUI_ID_EDIT1);
// }else
// if(WM_HasFocus(WM_GetDialogItem(hWin,GUI_ID_EDIT0)))
// {
// Cd_edit_handle = WM_GetDialogItem(hWin,GUI_ID_EDIT0);
// }
break;
case WM_NOTIFICATION_RELEASED:
break;
case WM_NOTIFICATION_VALUE_CHANGED:
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
}
}
|
|