/**************************************************************//*! * * Function sets the screen pointer on object and its children * ******************************************************************/ void D4D_SetObjectScreenPointer(D4D_OBJECT* pObject, D4D_SCREEN* pScreen) { pObject->pData->pScreen = pScreen; if(pObject->pRelations) { D4D_OBJECT** pChild = (D4D_OBJECT**)&(pObject->pRelations[D4D_OBJECT_USR_DATA_CHILD_IX]); while(*pChild) { D4D_SetObjectScreenPointer(*pChild, pScreen); pChild++; } } }
/**************************************************************************/ /*! * @brief The function inits the screen and its objects for first time case * @param pScreen - the pointer to screen * @return None * @note Initialize the the screen. This is keep as a public API to allow user application * initialize the screen before it native first use. *******************************************************************************/ void D4D_InitScreen(D4D_SCREEN* pScreen) { D4D_SCREEN_DATA* pData = pScreen->pData; D4D_OBJECT** pObj; D4D_MESSAGE localMsg; if(!pScreen) return; // prepare message localMsg.pScreen = pScreen; localMsg.nMsgId = D4D_MSG_ONINIT; pObj = (D4D_OBJECT**) pScreen->pObjects; // init objects while(*pObj != NULL) { localMsg.pObject = *pObj; // initialize the pointers on this screen in all screen objects D4D_SetObjectScreenPointer(*pObj, pScreen); // send the ON INIT message D4D_SendMessageMask(&localMsg, 0, D4D_OBJECT_F_NOTINIT); pObj++; } if(!(pData->flags & D4D_SCR_FINT_INITDONE)) { pData->flags |= D4D_SCR_FINT_INITDONE; D4D_FocusNextObject(pScreen, D4D_TRUE); // user's screen initialization if(pScreen->OnInit) pScreen->OnInit(); // Enable natively touch scren for screens if exit button is enabled if(pScreen->flags & D4D_SCR_F_EXIT) pData->flags |= D4D_SCR_FINT_TOUCHENABLE; } }