RdiaTranslateMsg Function

Microchip Graphics Library

Microchip Graphics Library
RdiaTranslateMsg Function
C
WORD RdiaTranslateMsg(
    void * pObj, 
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs. 

 

Translated Message 
Input Source 
Events 
Description 
RD_MSG_CLOCKWISE 
Touch Screen 
EVENT_MOVE 
If events occurs and the x,y position falls in the face of the Dial and moving in the clockwise rotation. 
RD_MSG_CTR_CLOCKWISE 
Touch Screen 
EVENT_MOVE 
If events occurs and the x,y position falls in the face of the Dial and moving in the counter clockwise rotation. 
OBJ_MSG_INVALID 
Any 
Any 
If the message did not affect the object. 
Input Parameters
Input Parameters 
Description 
GOL_MSG * pMsg 
Pointer to the message struct containing the message from the user interface. 
pDia 
The pointer to the object where the message will be evaluated to check if the message will affect the object. 
Returns

Returns the translated message depending on the received GOL message:

  • RD_MSG_CLOCKWISE – Dial is moved in a clockwise direction.
  • RD_MSG_CTR_CLOCKWISE – Dial is moved in a counter clockwise direction.
  • OBJ_MSG_INVALID – Dial is not affected

Preconditions

none

Side Effects

none

Example
void MyGOLMsg(GOL_MSG *pMsg){

    OBJ_HEADER *pCurrentObj;
    WORD objMsg;
        
    if(pMsg->event == EVENT_INVALID)
        return;
    pCurrentObj = GOLGetList();
    
    while(pCurrentObj != NULL){
        // Process only ROUNDDIAL
        if(!IsObjUpdated(pCurrentObj)){
            switch(pCurrentObj->type){
                case OBJ_ROUNDIAL:
                    objMsg = RdiaTranslateMsg((ROUNDDIAL*)pCurrentObj, pMsg);
                    if(objMsg == OBJ_MSG_INVALID)
                        break;
                    if(GOLMsgCallback(objMsg,pCurrentObj,pMsg))
                        RdiaMsgDefault(objMsg,(ROUNDDIAL*)pCurrentObj);
                    break;
                default: break; 
            }
        }
    }
    pCurrentObj = pCurrentObj->pNxtObj;
}
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved