static void myButton (WM_MESSAGE *pMsg) { int index = 0; const WM_KEY_INFO* pInfo; switch(pMsg->MsgId) { case WM_SET_FOCUS: index = WM_GetId(pMsg->hWin) - GUI_ID_BUTTON0; if(pMsg->Data.v == 0) { BUTTON_SetBkColor(buttons[index], BUTTON_CI_UNPRESSED, pColors->btBkColor); //TEXT_SetBkColor(Texts[index], pSkin->MntSetWin_bkNOFOCUS); } else { BUTTON_SetBkColor(buttons[index], BUTTON_CI_UNPRESSED, pColors->btFocusBkColor); //TEXT_SetBkColor(Texts[index], GUI_DARKMAGENTA); } BUTTON_Callback(pMsg); break; case WM_KEY: pInfo = (WM_KEY_INFO*)pMsg->Data.p; switch(pInfo->Key) { case GUI_KEY_ENTER: case GUI_KEY_LEFT: case GUI_KEY_RIGHT: BUTTON_Callback(pMsg); break; default: break; } break; default: BUTTON_Callback(pMsg); break; } }
/** * @brief callback for full screen button * @param pMsg: pointer to a data structure of type WM_MESSAGE * @retval None */ static void _cbButton_fullscreen(WM_MESSAGE * pMsg) { switch (pMsg->MsgId) { case WM_PAINT: _OnPaint_fullscreen(pMsg->hWin); break; default: /* The original callback */ BUTTON_Callback(pMsg); break; } }
/** * @brief callback for repeat button * @param pMsg: pointer to data structure of type WM_MESSAGE * @retval None */ static void _cbButton_repeat(WM_MESSAGE * pMsg) { switch (pMsg->MsgId) { case WM_PAINT: _OnPaint_repeat(PlayerSettings.b.repeat); break; default: /* The original callback */ BUTTON_Callback(pMsg); break; } }
/** * @brief callback for cam5_1 button * @param pMsg: pointer to data structure of type WM_MESSAGE * @retval None */ static void _cbButton_cam5_1(WM_MESSAGE * pMsg) { switch (pMsg->MsgId) { case WM_PAINT: _OnPaint_cam5_1(pMsg->hWin, HomeSettings.b.alarm, HomeSettings.b.camera); break; default: /* The original callback */ BUTTON_Callback(pMsg); break; } }
/********************************************************************* * * Callback * * This is the overwritten callback routine for the button. * The primary reason for overwriting it is that we define the default * action of the Framewindow here. * It works as follows: * - User clicks and releases the button * -> BUTTON sends WM_NOTIFY_PARENT to FRAMEWIN * -> FRAMEWIN either a) reacts or b)sends WM_NOTIFY_PARENT_REFLECTION back * In case of a) This module reacts ! */ static void _cbMax(WM_MESSAGE* pMsg) { if (pMsg->MsgId == WM_NOTIFY_PARENT_REFLECTION) { WM_HWIN hWin = pMsg->hWinSrc; FRAMEWIN_Obj* pObj = FRAMEWIN_H2P(hWin); if (pObj->Flags & FRAMEWIN_SF_MAXIMIZED) { FRAMEWIN_Restore(hWin); } else { FRAMEWIN_Maximize(hWin); } return; /* We are done ! */ } BUTTON_Callback(pMsg); }
void _cbButton(WM_MESSAGE *pMsg) { switch (pMsg->MsgId) { case WM_PID_STATE_CHANGED:; WM_PID_STATE_CHANGED_INFO* info = pMsg->Data.p; printf("Button state change - (%d, %d) %d\r\n", info->x, info->y, (int)info->State); break; case WM_NOTIFICATION_CLICKED: printf("Clicked \r\n"); break; default: BUTTON_Callback(pMsg); break; } }
/********************************************************************* * * _cbButton * * Purpose: * 1. Calls the owner draw function if the WM_PAINT message has been send * 2. Calls the original callback for further messages * 3. After processing the messages the function evaluates the pressed-state * if the WM_TOUCH message has been send */ static void _cbButton(WM_MESSAGE * pMsg) { switch (pMsg->MsgId) { case WM_PAINT: _OnPaint(pMsg->hWin); break; default: BUTTON_Callback(pMsg); // The original callback break; } if (pMsg->MsgId == WM_TOUCH) { if (BUTTON_IsPressed(pMsg->hWin)) { if (!_Pressed) { _Pressed = 1; } } else { _Pressed = 0; } } }
// // Buttoncallback; // void mybutton (WM_MESSAGE *pMsg) { WM_HWIN hWin; WM_KEY_INFO *pInfo; int column,row,row_index,del_row; int i; hWin = pMsg->hWin; switch (pMsg->MsgId) { case USER_MSG_LANGUAGE: //更改语言 pLanguage = &Lgumainwin[Language]; if (Language == 0) { BUTTON_SetFont(hButton,&GUI_Font30); TEXT_SetFont(mainwinText[5],&GUI_Font30); HEADER_SetFont(hListhead,&GUI_Font24); } else { BUTTON_SetFont(hButton,&GUI_Font20_1); TEXT_SetFont(mainwinText[5],&GUI_Font24_1); HEADER_SetFont(hListhead,&GUI_Font16_1); LISTVIEW_SetHeaderHeight(hListview,29); } DisPage(); BUTTON_SetText(hButton,pLanguage->ButtonInfo[0]); for(i = 0; i<7; i++) HEADER_SetItemText(hListhead,i,pLanguage->ListHead[i]); break; case WM_SET_FOCUS: if (pMsg->Data.v) { BUTTON_SetBkColor(hButton,BUTTON_CI_UNPRESSED,GUI_GRAY); BUTTON_SetTextColor(hButton,BUTTON_CI_UNPRESSED,GUI_WHITE); BUTTON_SetFocusColor(hButton,GUI_GRAY); } else { BUTTON_SetBkColor(hButton,BUTTON_CI_UNPRESSED,GUI_WHITE);//BUTTON_SetTextColor (hButton,BUTTON_CI_UNPRESSED,GUI_BLACK); BUTTON_SetTextColor(hButton,BUTTON_CI_UNPRESSED,GUI_BLACK); BUTTON_SetFocusColor(hButton,GUI_WHITE); } BUTTON_Callback(pMsg); break; case WM_KEY: pInfo = (WM_KEY_INFO*)pMsg->Data.p; switch (pInfo->Key) { case GUI_KEY_ENTER: break; case GUI_KEY_PRINT: WM_BringToTop(PrintWin); WM_SetFocus(WM_GetDialogItem(PrintWin,ID_PrintMenu)); break; case GUI_KEY_MENU: WM_BringToTop(Menuwin); WM_SetFocus (WM_GetDialogItem(Menuwin,ID_MENU)); MENU_SetSel (WM_GetDialogItem(Menuwin,ID_MENU),0); MenuSel = 0; break; case GUI_KEY_LOC1: pCannel = " 490 横"; WM_InvalidateWindow(WM_GetDialogItem(mainwin,ID_TEXT_1)); break; case GUI_KEY_LOC2: pCannel = "4209.5横"; WM_InvalidateWindow(WM_GetDialogItem(mainwin,ID_TEXT_1)); break; case GUI_KEY_CHS: pCannel = " 486 横"; WM_InvalidateWindow(WM_GetDialogItem(mainwin,ID_TEXT_1)); break; case GUI_KEY_UP: break; case GUI_KEY_DOWN: if (LISTVIEW_GetNumRows(hListview)) { thispage = 1; WM_SetFocus(hListview); LISTVIEW_SetSel(hListview,0); DisPage(); //WM_InvalidateRect(mainwin,&PageRect); //刷新页数提示 } break; case GUI_KEY_LEFT: if(InfoType > 0) InfoType--; else InfoType = 3; switch (InfoType) { case 0: BUTTON_SetText(hWin,pLanguage->ButtonInfo[0]); LISTVIEW_DeleteAllRows(hListview); InfoSel(0,1); break; case 1: BUTTON_SetText(hWin,pLanguage->ButtonInfo[1]); LISTVIEW_DeleteAllRows(hListview); InfoSel(1,1); break; case 2: BUTTON_SetText(hWin,pLanguage->ButtonInfo[2]); LISTVIEW_DeleteAllRows(hListview); InfoSel(2,1); break; case 3: BUTTON_SetText(hWin,pLanguage->ButtonInfo[3]); LISTVIEW_DeleteAllRows(hListview); InfoSel(3,1); break; } if (rowindex<8) { pageNum = 1; } else if (rowindex%8 == 0) pageNum = rowindex/8; else pageNum = rowindex/8+1; thispage = 1; DisPage(); //WM_InvalidateRect(mainwin,&PageRect);//刷新页数提示 break; case GUI_KEY_RIGHT: InfoType++; if(InfoType == 4) InfoType = 0; switch (InfoType) { case 0: BUTTON_SetText(hWin,pLanguage->ButtonInfo[0]); LISTVIEW_DeleteAllRows(hListview); InfoSel(0,1); break; case 1: BUTTON_SetText(hWin,pLanguage->ButtonInfo[1]); LISTVIEW_DeleteAllRows(hListview); InfoSel(1,1); break; case 2: BUTTON_SetText(hWin,pLanguage->ButtonInfo[2]); LISTVIEW_DeleteAllRows(hListview); InfoSel(2,1); break; case 3: BUTTON_SetText(hWin,pLanguage->ButtonInfo[3]); LISTVIEW_DeleteAllRows(hListview); InfoSel(3,1); break; } if (rowindex<8) pageNum = 1; else if (rowindex%8 == 0) pageNum = rowindex/8; else pageNum = rowindex/8+1; thispage = 1; DisPage(); //WM_InvalidateRect(mainwin,&PageRect);//刷新页数提示 break; } break; default : BUTTON_Callback(pMsg); break; } }