// USER START (Optionally insert additional defines)
// USER END
/*********************************************************************
*
* Static data
*
**********************************************************************
*/
// USER START (Optionally insert additional static data)
// USER END
/*********************************************************************
*
* _aDialogCreate
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
{ FRAMEWIN_CreateIndirect, "WIFI", ID_FRAMEWIN_0, 0, 0, 240, 320, 0, 0x0, 0 },
{ BUTTON_CreateIndirect, "PC", ID_BUTTON_0, 40, 50, 130, 40, 0, 0x0, 0 },
{ BUTTON_CreateIndirect, "Cell", ID_BUTTON_1, 40, 120, 130, 40, 0, 0x0, 0 },
{ BUTTON_CreateIndirect, "Back", ID_BUTTON_2, 40, 180, 130, 40, 0, 0x0, 0 },
// USER START (Optionally insert additional widgets)
// USER END
};
char flag1;
/*********************************************************************
*
* Static code
*
**********************************************************************
*/
// USER START (Optionally insert additional static code)
// USER END
/*********************************************************************
*
* _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
int NCode;
int Id;
WM_HWIN hItem;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
hItem = pMsg->hWin;
FRAMEWIN_SetTitleHeight(hItem, 30);
FRAMEWIN_SetText(hItem, "WIFI");
FRAMEWIN_SetFont(hItem, GUI_FONT_24_ASCII);
FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
FRAMEWIN_SetTextColor(hItem, 0x0000FFFF);
//Initialization of 'BUTTON'
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
BUTTON_SetFont(hItem, GUI_FONT_24_ASCII);
BUTTON_SetText(hItem, "PC");
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1);
BUTTON_SetFont(hItem, GUI_FONT_24_ASCII);
BUTTON_SetText(hItem, "Cell");
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_2);
BUTTON_SetFont(hItem, GUI_FONT_24_ASCII);
BUTTON_SetText(hItem, "Back");
switch(Id) {
case ID_BUTTON_0: // Notifications sent by 'ToComputer'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
case ID_BUTTON_1: // Notifications sent by 'Mobile'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
flag1='1';
while(flag1=='1'){
GUI_Delay(100);
macESP8266_USART_APBxClock_FUN ( macESP8266_USART_CLK, ENABLE );//ʹÄÜ´®¿Ú3
ESP8266_StaTcpClient_UnvarnishTest ();//ÊÖ»úAPP¿Éͨ¹ýWIFI¿ØÖÆÓ²¼þµÄº¯Êý
GUI_Delay(100);
}
//
// USER START (Optionally insert code for reacting on notification message)
// USER END// GUI_Delay(100);// GUI_Clear();
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
// USER START (Optionally insert additional code for further Ids)
// USER END
}
break;
// USER START (Optionally insert additional message handling)
// USER END
default:
WM_DefaultProc(pMsg);
break;
}
}
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* CreateWIFI
*/
WM_HWIN CreateWIFI(void);
WM_HWIN CreateWIFI(void) {
WM_HWIN hWin;
hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
return hWin;
}
void WIFI_Demo(void)
{
CreateWIFI();
// WM_HWIN hWin;
//hWin=CreateFramewin();//ÉÏÃæµÄÒ»Ðб¾À´ÓÉÔ ÏÈ×¢Ê͵ÄÁ½ÐдúÌæ
while(1)
{
GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
GUI_Delay(100);
}
}
// USER START (Optionally insert additional public code)
// USER END
/*************************** End of file ****************************/