论坛元老
- 积分
- 11471
- 金钱
- 11471
- 注册时间
- 2013-3-8
- 在线时间
- 1226 小时
|
发表于 2017-5-10 17:30:01
|
显示全部楼层
#define ID_WINDOW_0 (GUI_ID_USER + 0x00) #define ID_ICONVIEW_0 (GUI_ID_USER + 0x01) #define ID_BUTTON_0 (GUI_ID_USER + 0x02) #define ID_TEXT_0 (GUI_ID_USER + 0x03) static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = { { WINDOW_CreateIndirect, "Window", ID_WINDOW_0, 0, 0, 480, 320, 0, 0x0, 0 }, { BUTTON_CreateIndirect, "", ID_BUTTON_0, 5, 5, 40, 40, 0, 0x0, 0 }, { TEXT_CreateIndirect, "Text", ID_TEXT_0, 48, 13, 136, 20, 0, 0x64, 0 }, // { ICONVIEW_CreateIndirect, "Iconview", ID_ICONVIEW_0, 34, 99, 420, 140, 0, 0x0, 0 }, }; GUI_HMEM hMem; char *acbuf=NULL; GUI_HMEM hMem1; char *acbuf1=NULL; GUI_HMEM hMem2; char *acbuf2=NULL; static void _cbButton0(WM_MESSAGE * pMsg) { WM_HWIN hWin; hWin = pMsg->hWin; switch (pMsg->MsgId) { case WM_PAINT: if (BUTTON_IsPressed(hWin)) { // GUI_SetBkColor(GUI_WHITE); // GUI_Clear(); GUI_SetAlpha(0xb0); GUI_DrawBitmap(&bmbluetooth_bmp, 0,0); GUI_SetAlpha(0); } else { GUI_DrawBitmap(&bmbluetooth_bmp, 0, 0); } break; default: BUTTON_Callback(pMsg); } } /********************************************************************* * * _cbDialog */ static void _cbDialog(WM_MESSAGE * pMsg) { int NCode; int Id; static int Iconview0_Sel; WM_HWIN hItem; switch (pMsg->MsgId) { case WM_INIT_DIALOG: hItem = ICONVIEW_CreateEx(34, 79,412,130, pMsg->hWin, WM_CF_SHOW | WM_CF_HASTRANS, ICONVIEW_CF_AUTOSCROLLBAR_V, ID_ICONVIEW_0, 100, 120); // hItem = WM_GetDialogItem(pMsg->hWin, ID_ICONVIEW_0); ICONVIEW_SetFont(hItem,&GUI_Font16_ASCII); ICONVIEW_SetBkColor(hItem, ICONVIEW_CI_SEL, GUI_BLUE | 0xff000000); ICONVIEW_SetSpace(hItem,GUI_COORD_X,56); ICONVIEW_SetSpace(hItem,GUI_COORD_Y,20); ICONVIEW_SetIconAlign(hItem,ICONVIEW_IA_HCENTER|ICONVIEW_IA_VCENTER); ICONVIEW_SetTextColor(hItem,ICONVIEW_CI_UNSEL,GUI_RED); ICONVIEW_SetTextAlign(hItem,GUI_TA_HCENTER|GUI_TA_BOTTOM); home_HM(hItem); WM_SetFocus(hItem); hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0); WM_SetHasTrans(hItem); WM_SetCallback(hItem, _cbButton0); |
|