新手上路
- 积分
- 34
- 金钱
- 34
- 注册时间
- 2019-11-22
- 在线时间
- 28 小时
|
楼主 |
发表于 2019-12-9 10:26:03
|
显示全部楼层
static void _cbDialog(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int NCode;
int Id;
static uint8_t i;
DROPDOWN_Handle hDropdown;
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
//
// Initialization of 'block'
//
hItem = pMsg->hWin;
FRAMEWIN_SetFont(hItem, GUI_FONT_24_ASCII);
FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_TOP);
FRAMEWIN_SetTitleHeight(hItem, 20);
//
// Initialization of 'Dropdown'
//
hDropdown = WM_GetDialogItem(pMsg->hWin, ID_DROPDOWN_0);
DROPDOWN_IncSelExp(hDropdown);
DROPDOWN_SetAutoScroll(hDropdown,1);
DROPDOWN_AddString(hDropdown, "hhhh");
DROPDOWN_AddString(hDropdown, "zzzz");
DROPDOWN_AddString(hDropdown, "zzzz");
DROPDOWN_AddString(hDropdown, "zzzz");
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_0: // Notifications sent by 'seleck'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
i = DROPDOWN_GetSel(hDropdown);
break;
case WM_NOTIFICATION_RELEASED:
break;
}
break;
case ID_BUTTON_1: // Notifications sent by 'back'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
break;
}
break;
case ID_DROPDOWN_0: // Notifications sent by 'Dropdown'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
break;
case WM_NOTIFICATION_SEL_CHANGED:
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
这是回调函数的代码 |
|