/**************************************************************************/ /*! * @brief Function control visibility of object on screen. * @param pObject - pointer to the object. * @param bShow - <D4D_TRUE - visible, D4D_FALSE - hidden> * @return none. * @note This function control the visibility of object on screen. The hide action * force invalidate of whole screen. *******************************************************************************/ void D4D_ShowObject(D4D_OBJECT_PTR pObject, D4D_BOOL bShow) { if(bShow) { pObject->pData->flags |= D4D_OBJECT_F_VISIBLE; D4D_InvalidateObject(pObject, D4D_FALSE); } else { pObject->pData->flags &= ~D4D_OBJECT_F_VISIBLE; if(d4d_pKeysCapturer == pObject) D4D_CaptureKeys(NULL); if((D4D_OBJECT*)pObject == D4D_GetFocusedObject(pObject->pData->pScreen)) D4D_FocusNextObject(pObject->pData->pScreen, D4D_FALSE); if(pObject->pRelations) { D4D_OBJECT* pParent = D4D_GetParentObject((D4D_OBJECT*)pObject); if(pParent) D4D_InvalidateObject(pParent, D4D_TRUE); else D4D_InvalidateScreen(pObject->pData->pScreen, D4D_TRUE); } else D4D_InvalidateScreen(pObject->pData->pScreen, D4D_TRUE); } }
/**************************************************************************/ /*! * @brief Function invokes calibrate screen of touch screen * @return none * @note Clears the event buffer *******************************************************************************/ void D4D_CalibrateTouchScreen(void) { D4D_MouseShow(D4D_FALSE); D4D_TCH_Calibrate(D4D_COLOR_SYSTEM_FORE, D4D_COLOR_SYSTEM_BCKG); D4D_MouseShow(D4D_TRUE); D4D_InvalidateScreen(D4D_GetActiveScreen(), D4D_TRUE); }
void D4D_ComboBoxListFeedBack(D4D_OBJECT* pThis, D4D_EVENTID eventId) { D4D_OBJECT* pParent = D4D_GetParentObject(pThis); if(eventId == D4D_EVENT_ONCLICK) { D4D_OBJECT* pListBoxObject = D4D_GET_COMBO_BOX_LIST_BOX(pParent); D4D_OBJECT* pEditBoxObject = D4D_GET_COMBO_BOX_EDIT_BOX(pParent); D4D_GET_COMBO_BOX_DATA(pParent)->real_ix = D4D_ListBoxGetIndex(pListBoxObject); if(D4D_GET_COMBO_BOX(pParent)->OnEvent) D4D_GET_COMBO_BOX(pParent)->OnEvent(pParent, D4D_EVENT_ONCLICK); D4D_EditBoxClearAll(pEditBoxObject); D4D_EditBoxPutString(pEditBoxObject, D4D_ListBoxGetItemText(pListBoxObject)); D4D_ShowObject(pListBoxObject, D4D_FALSE); D4D_InvalidateScreen(pParent->pData->pScreen, D4D_TRUE); } if(eventId == D4D_EVENT_ONCHANGE) { //D4D_InvalidateObject(pParent, D4D_FALSE); if(D4D_GET_COMBO_BOX(pParent)->OnEvent) D4D_GET_COMBO_BOX(pParent)->OnEvent(pParent, D4D_EVENT_ONCHANGE); } }
/**************************************************************//*! * * Change the active screen * ******************************************************************/ static void D4D_ChangeScreen(D4D_SCREEN* pNewScreen, D4D_SCREEN* pOldScreen) { D4D_SCREEN_DATA* pData; D4D_MESSAGE tmp_msg; if(pNewScreen == NULL) return; if(pOldScreen == pNewScreen) return; tmp_msg.pScreen = pOldScreen; if(pOldScreen != NULL) { D4D_SetObjectFlags(pOldScreen->pData->focusedObject, D4D_OBJECT_F_REDRAWSTATE, D4D_FALSE); tmp_msg.nMsgId = D4D_MSG_KILLFOCUS; tmp_msg.pObject = pOldScreen->pData->focusedObject; D4D_SendMessage(&tmp_msg); // Draw NC screen area as an inactivate D4D_DrawScreenNC(pOldScreen, D4D_FALSE); // call de-activate event if(pOldScreen->OnDeactivate != NULL) pOldScreen->OnDeactivate(); } // invalidate the new screen (global complete redraw, not individual objects) D4D_InvalidateScreen(pNewScreen, D4D_TRUE); // if this is the first time activating pData = pNewScreen->pData; // Init the screen D4D_InitScreen(pNewScreen); D4D_SetObjectFlags(pData->focusedObject, D4D_OBJECT_F_REDRAWSTATE, D4D_FALSE); // Send to the object Focus message tmp_msg.pScreen = pNewScreen; tmp_msg.nMsgId = D4D_MSG_SETFOCUS; tmp_msg.pObject = pData->focusedObject; D4D_SendMessage(&tmp_msg); // inform the screen it has been activated if(pNewScreen->OnActivate) pNewScreen->OnActivate(); D4D_ClearKeysBuffer(); #ifdef D4D_LLD_TCH d4d_LastTouchedObj = NULL; #endif // finish all action for previous screen D4D_MouseChangedScreen(); }
/**************************************************************************/ /*! * @brief The function sets the screen font properties * @param pScreen - the pointer to screen * @param property - font property * @return None * @note Sets the font property for text used natively by screen (title) *******************************************************************************/ void D4D_SetScreenFontProperties(D4D_SCREEN* pScreen, D4D_FONT_PROPERTIES property) { if(pScreen->textBuff.str_properties->font_properties == property) return; // There is no change needed pScreen->textBuff.str_properties->font_properties = property; D4D_InvalidateScreen(pScreen, D4D_FALSE); }
static void D4D_ComboBoxStornoSelection(D4D_OBJECT * pThis) { D4D_OBJECT* pListBoxObject = D4D_GET_COMBO_BOX_LIST_BOX(pThis); if(D4D_IsVisible(pListBoxObject)) { D4D_ShowObject(pListBoxObject, D4D_FALSE); D4D_InvalidateScreen(pThis->pData->pScreen, D4D_TRUE); //TODO } D4D_ListBoxSetIndex(pListBoxObject, D4D_GET_COMBO_BOX_DATA(pThis)->real_ix); }
/**************************************************************************/ /*! * @brief Set screen orientation function. * @param orient - the requested new orientation * @return none * @note Function change the orientation of screen, invoke complete redraw *******************************************************************************/ void D4D_SetOrientation(D4D_ORIENTATION orient) { // get active screen D4D_SCREEN* pScreen = D4D_GetActiveScreen(); D4D_LCD_SetOrientation(orient); #ifdef D4D_LLD_MOUSE D4D_MouseCenterCursor(); #endif if(pScreen) D4D_InvalidateScreen(pScreen, D4D_TRUE); }
/**************************************************************************/ /*! * @brief The function changes the current language * @param stringId - the id of new string * @return none * @note The function change to new string table if it's available. *******************************************************************************/ void D4D_ChangeStringTable(LWord stringId) { LWord i = 0; while(d4d_StringTable[i].stringTable != NULL) { if(d4d_StringTable[i].stringId == stringId) { d4d_strTableIndex = i; D4D_InvalidateScreen(D4D_GetActiveScreen(), D4D_TRUE); return; } i++; } }