|
楼主 |
发表于 2016-1-18 13:29:11
|
显示全部楼层
#define ID_WINDOW2_0 (GUI_ID_USER + 0x09)
#define ID_TEXT2_0 (GUI_ID_USER + 0x0A)
#define ID_EDIT2_0 (GUI_ID_USER + 0x0B)
#define ID_EDIT2_1 (GUI_ID_USER + 0x0C)
#define ID_EDIT2_2 (GUI_ID_USER + 0x0D)
#define ID_EDIT2_3 (GUI_ID_USER + 0x0E)
#define ID_TEXT2_1 (GUI_ID_USER + 0x0F)
#define ID_TEXT2_2 (GUI_ID_USER + 0x10)
#define ID_TEXT2_3 (GUI_ID_USER + 0x11)
#define ID_TEXT2_4 (GUI_ID_USER + 0x12)
#define ID_TEXT2_5 (GUI_ID_USER + 0x13)
#define ID_TEXT2_6 (GUI_ID_USER + 0x14)
#define ID_TEXT2_7 (GUI_ID_USER + 0x15)
#define ID_EDIT2_4 (GUI_ID_USER + 0x16)
#define ID_EDIT2_5 (GUI_ID_USER + 0x17)
#define ID_EDIT2_6 (GUI_ID_USER + 0x18)
#define ID_EDIT2_7 (GUI_ID_USER + 0x19)
#define ID_EDIT2_8 (GUI_ID_USER + 0x1A)
#define ID_TEXT2_8 (GUI_ID_USER + 0x1B)
#define ID_EDIT2_9 (GUI_ID_USER + 0x1C)
#define ID_EDIT2_10 (GUI_ID_USER + 0x1D)
#define ID_EDIT2_11 (GUI_ID_USER + 0x1E)
#define ID_EDIT2_12 (GUI_ID_USER + 0x1F)
#define ID_EDIT2_13 (GUI_ID_USER + 0x20)
#define ID_TEXT2_9 (GUI_ID_USER + 0x21)
#define ID_TEXT2_10 (GUI_ID_USER + 0x22)
#define ID_TEXT2_11 (GUI_ID_USER + 0x23)
#define ID_EDIT2_14 (GUI_ID_USER + 0x24)
#define ID_EDIT2_15 (GUI_ID_USER + 0x25)
#define ID_TEXT2_12 (GUI_ID_USER + 0x26)
#define ID_TEXT2_13 (GUI_ID_USER + 0x29)
#define ID_EDIT2_16 (GUI_ID_USER + 0x2A)
#define ID_EDIT2_17 (GUI_ID_USER + 0x2B)
#define ID_BUTTON2_0 (GUI_ID_USER + 0x2C)
static const GUI_WIDGET_CREATE_INFO _aDialogCreate2[] = {
{ WINDOW_CreateIndirect, "Window", ID_WINDOW2_0, 0, 0, 800, 480, 0, 0, 0 },
{ TEXT_CreateIndirect, "工艺显示", ID_TEXT2_0, 0, 0, 800, 70, 0, 0, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_0, 0, 450, 360, 30, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_1, 364, 450, 193, 30, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_2, 563, 450, 129, 30, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_3, 699, 450, 92, 30, 0, 100, 0 },
{ TEXT_CreateIndirect, "项目", ID_TEXT2_1, 5, 105, 120, 50, 0, 0, 0 },
{ TEXT_CreateIndirect, "锭速 ", ID_TEXT2_2, 5, 155, 120, 50, 0, 0, 0 },
{ TEXT_CreateIndirect, "卷绕速度", ID_TEXT2_3, 5, 205, 120, 50, 0, 0, 0 },
{ TEXT_CreateIndirect, "捻度", ID_TEXT2_4, 5, 255, 120, 50, 0, 0, 0 },
{ TEXT_CreateIndirect, "横动行程 ", ID_TEXT2_5, 5, 305, 120, 50, 0, 0, 0 },
{ TEXT_CreateIndirect, "纱线定长 ", ID_TEXT2_6, 5, 355, 120, 50, 0, 0, 0 },
{ TEXT_CreateIndirect, "设定值", ID_TEXT2_7, 163, 105, 120, 50, 0, 0, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_4, 150, 155, 120, 50, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_5, 150, 205, 120, 50, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_6, 150, 255, 120, 50, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_7, 150, 305, 120, 50, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_8, 150, 355, 120, 50, 0, 100, 0 },
{ TEXT_CreateIndirect, "实际值", ID_TEXT2_8, 300, 105, 120, 50, 0, 0, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_9, 295, 155, 120, 50, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_10, 295, 205, 120, 50, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_11, 295, 255, 120, 50, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_12, 295, 305, 120, 50, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_13, 295, 355, 120, 50, 0, 100, 0 },
{ TEXT_CreateIndirect, "项目", ID_TEXT2_9, 455, 105, 120, 50, 0, 0, 0 },
{ TEXT_CreateIndirect, "设定值", ID_TEXT2_10, 571, 105, 120, 50, 0, 0, 0 },
// { TEXT_CreateIndirect, "卷绕角", ID_TEXT2_11, 691, 105, 120, 50, 0, 0, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_14, 555, 155, 120, 50, 0, 100, 0 },
// { EDIT_CreateIndirect, "Edit", ID_EDIT2_15, 665, 155, 120, 50, 0, 100, 0 },
{ TEXT_CreateIndirect, "加捻方向", ID_TEXT2_12, 440, 155, 120, 50, 0, 0, 0 },
{ TEXT_CreateIndirect, "卷绕角", ID_TEXT2_13, 440, 205, 120, 50, 0, 0, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT2_16, 555, 205, 120, 50, 0, 100, 0 },
// { EDIT_CreateIndirect, "Edit", ID_EDIT2_17, 665, 205, 120, 50, 0, 100, 0 },
{ BUTTON_CreateIndirect, "返回", ID_BUTTON2_0, 600, 15, 120, 50, 0, 0, 0 },
};
static void _cbDialog2(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int Id, NCode;
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
//
// Initialization of 'TS20A'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_0);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetBkColor(hItem,0x800080);
TEXT_SetTextAlign(hItem, GUI_TA_LEFT | GUI_TA_VCENTER);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_0);
EDIT_SetText(hItem, "");
EDIT_SetBkColor(hItem,1,GUI_GRAY);
EDIT_SetFont(hItem, &GUI_FontYahei);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_1);
EDIT_SetText(hItem, "");
EDIT_SetBkColor(hItem,1,GUI_GRAY);
EDIT_SetFont(hItem, &GUI_FontYahei);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_2);
EDIT_SetText(hItem, "软件版本");
EDIT_SetBkColor(hItem,1,GUI_GRAY);
EDIT_SetFont(hItem, &GUI_FontYahei);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_3);
EDIT_SetText(hItem, "1.0");
EDIT_SetBkColor(hItem,1,GUI_GRAY);
EDIT_SetFont(hItem, &GUI_FontYahei);
//
// Initialization of 'xiangmu'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_1);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetTextColor(hItem, 0x00000000);
//
// Initialization of 'dingsu '
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_2);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetTextColor(hItem, 0x00000000);
//
// Initialization of 'juanraosudu'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_3);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetTextColor(hItem, 0x00000000);
//
// Initialization of 'niandu'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_4);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetTextColor(hItem, 0x00000000);
//
// Initialization of 'niandu'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_5);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetTextColor(hItem, 0x00000000);
//
// Initialization of 'shaxiandingchaqng '
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_6);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetTextColor(hItem, 0x00000000);
//
// Initialization of 'shedingzhi'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_7);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetTextColor(hItem, 0x00000000);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_4);
EDIT_SetText(hItem, "");
EDIT_SetFont(hItem, &GUI_FontYahei);
WM_SetFocus(hItem);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_5);
EDIT_SetText(hItem, "3");
EDIT_SetFont(hItem, &GUI_FontYahei);
WM_SetFocus(hItem);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_6);
EDIT_SetText(hItem, "5");
EDIT_SetFont(hItem, &GUI_FontYahei);
WM_SetFocus(hItem);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_7);
EDIT_SetText(hItem, "7");
EDIT_SetFont(hItem, &GUI_FontYahei);
WM_SetFocus(hItem);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_8);
EDIT_SetText(hItem, "9");
EDIT_SetFont(hItem, &GUI_FontYahei);
WM_SetFocus(hItem);
//
// Initialization of 'shijizhi'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_8);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetTextColor(hItem, 0x00000000);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_9);
EDIT_SetText(hItem, "2");
EDIT_SetFont(hItem, &GUI_FontYahei);
WM_SetFocus(hItem);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_10);
EDIT_SetText(hItem, "4");
EDIT_SetFont(hItem, &GUI_FontYahei);
WM_SetFocus(hItem);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_11);
EDIT_SetText(hItem, "6");
EDIT_SetFont(hItem, &GUI_FontYahei);
WM_SetFocus(hItem);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_12);
EDIT_SetText(hItem, "8");
EDIT_SetFont(hItem, &GUI_FontYahei);
WM_SetFocus(hItem);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_13);
EDIT_SetText(hItem, "10");
EDIT_SetFont(hItem, &GUI_FontYahei);
WM_SetFocus(hItem);
//
// Initialization of 'xiangmu1'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_9);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetTextColor(hItem, 0x00000000);
//
// Initialization of 'shedingzhi1'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_10);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetTextColor(hItem, 0x00000000);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_14);
EDIT_SetText(hItem, "11");
EDIT_SetFont(hItem, &GUI_FontYahei);
WM_SetFocus(hItem);
//
// Initialization of 'Edit'
//
// hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_15);
// EDIT_SetText(hItem, "12");
//
// Initialization of 'nianxiang'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_12);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetTextColor(hItem, 0x00000000);
//
// Initialization of 'juanraojiao'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT2_13);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetTextColor(hItem, 0x00000000);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_16);
EDIT_SetText(hItem, "13");
EDIT_SetFont(hItem, &GUI_FontYahei);
WM_SetFocus(hItem);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON2_0);
BUTTON_SetFont(hItem, &GUI_FontYahei);
BUTTON_SetFocussable(hItem, 1);
// USER START (Optionally insert additional code for further widget initialization)
// USER END
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_EDIT2_0: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_1: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_2: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_3: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_4: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_5: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_6: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_7: // Notifications sent by 'Edit'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
CreateWindow10();
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_8: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_9: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_10: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_11: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_12: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_13: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_14: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_EDIT2_16: // Notifications sent by 'Edit'
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;
case WM_NOTIFICATION_VALUE_CHANGED:
// 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_BUTTON2_0: // Notifications sent by 'fanhui'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
_DeleteFrame();
CreateWindow1();
// hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT2_4);
// EDIT_SetFloatMode(hItem,10,0,1000,0,GUI_EDIT_SUPPRESS_LEADING_ZEROES);
// 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;
// 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;
}
}
WM_HWIN CreateWindow2(void) {
hWin = GUI_CreateDialogBox(_aDialogCreate2, GUI_COUNTOF(_aDialogCreate2), &_cbDialog2, WM_HBKWIN, 0, 0);
return hWin;
}
/*********************************************************************
*
* THE FIRST
*
**********************************************************************
*/
#define ID_WINDOW1_0 (GUI_ID_USER + 0x00)
#define ID_TEXT1_0 (GUI_ID_USER + 0x01)
#define ID_BUTTON1_0 (GUI_ID_USER + 0x02)
#define ID_BUTTON1_1 (GUI_ID_USER + 0x03)
#define ID_BUTTON1_2 (GUI_ID_USER + 0x04)
#define ID_EDIT1_0 (GUI_ID_USER + 0x05)
#define ID_EDIT1_1 (GUI_ID_USER + 0x06)
#define ID_EDIT1_2 (GUI_ID_USER + 0x07)
#define ID_EDIT1_3 (GUI_ID_USER + 0x08)
static const GUI_WIDGET_CREATE_INFO _aDialogCreate1[] = {
{ WINDOW_CreateIndirect, "Window", ID_WINDOW1_0, 0, 0, 800, 480, 0, 0, 0 },
{ TEXT_CreateIndirect, "TS20A倍捻机控制系统", ID_TEXT1_0, 0, 0, 800, 70, 0, 0, 0 },
{ BUTTON_CreateIndirect, "工艺显示", ID_BUTTON1_0, 73, 145, 120, 50, 0, 0, 0 },
{ BUTTON_CreateIndirect, "工艺设置", ID_BUTTON1_1, 341, 145, 120, 50, 0, 0, 0 },
{ BUTTON_CreateIndirect, "系统参数", ID_BUTTON1_2, 612, 145, 120, 50, 0, 0, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT1_0, 0, 450, 360, 30, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT1_1, 364, 450, 193, 30, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT1_2, 563, 450, 129, 30, 0, 100, 0 },
{ EDIT_CreateIndirect, "Edit", ID_EDIT1_3, 699, 450, 92, 30, 0, 100, 0 },
};
static void _cbDialog1(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int Id, NCode;
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
//
// Initialization of 'TS20A'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT1_0);
TEXT_SetFont(hItem, &GUI_FontYahei);
TEXT_SetBkColor(hItem,0x800080);
TEXT_SetTextAlign(hItem, GUI_TA_LEFT | GUI_TA_VCENTER);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT1_0);
EDIT_SetBkColor(hItem,1,GUI_GRAY);
EDIT_SetFont(hItem, &GUI_FontYahei);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT1_1);
EDIT_SetBkColor(hItem,1,GUI_GRAY);
EDIT_SetFont(hItem, &GUI_FontYahei);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT1_2);
EDIT_SetText(hItem, "软件版本");
EDIT_SetBkColor(hItem,1,GUI_GRAY);
EDIT_SetFont(hItem, &GUI_FontYahei);
//
// Initialization of 'Edit'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT1_3);
EDIT_SetText(hItem, "1.0");
EDIT_SetBkColor(hItem,1,GUI_GRAY);
EDIT_SetFont(hItem, &GUI_FontYahei);
//
// Initialization of 'Button'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON1_0);
BUTTON_SetFont(hItem,&GUI_FontYahei);
BUTTON_SetFocussable(hItem, 0);
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON1_1);
BUTTON_SetFont(hItem,&GUI_FontYahei);
BUTTON_SetFocussable(hItem, 0);
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON1_2);
BUTTON_SetFont(hItem,&GUI_FontYahei);
BUTTON_SetFocussable(hItem, 0);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON1_0: // Notifications sent by 'button0'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
_DeleteFrame();
CreateWindow2();
break;
}
break;
case ID_BUTTON1_1: // Notifications sent by 'button1'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
_DeleteFrame();
CreateWindow3();
break;
}
break;
case ID_BUTTON1_2: // Notifications sent by 'button2'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
_DeleteFrame();
CreateWindow6();
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
WM_HWIN CreateWindow1(void) {
hWin = GUI_CreateDialogBox(_aDialogCreate1, GUI_COUNTOF(_aDialogCreate1), &_cbDialog1, WM_HBKWIN, 0, 0);
return hWin;
}
void MainTask(void)
{
// GUI_Init();
int ii=0;
WM_SetDesktopColor(GUI_GRAY); /* Automacally update desktop window */
WM_SetCreateFlags(WM_CF_MEMDEV); /* Use memory devices on all windows to avoid flicker */
PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX);
PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
CHECKBOX_SetDefaultSkin(CHECKBOX_SKIN_FLEX);
DROPDOWN_SetDefaultSkin(DROPDOWN_SKIN_FLEX);
SCROLLBAR_SetDefaultSkin(SCROLLBAR_SKIN_FLEX);
SLIDER_SetDefaultSkin(SLIDER_SKIN_FLEX);
HEADER_SetDefaultSkin(HEADER_SKIN_FLEX);
RADIO_SetDefaultSkin(RADIO_SKIN_FLEX);
GUI_UC_SetEncodeUTF8();
while(1){
GUI_Delay(50);
} |
|