/********************************************************************* * * GUI_ARRAY_InsertBlankItem * * Purpose: * Inserts a blank element in a GUI_ARRAY. * * Parameters: * Index Index of the element to insert before * 0 means: Insert before first element * 1 means: Insert before second element * * Return value: * 1 if successful * 0 if failed * * Notes: * (1) Index changes * The index of all items after the one inserted will change * (Increment by 1) */ char GUI_ARRAY_InsertBlankItem(GUI_ARRAY* pThis, unsigned int Index) { GUI_ARRAY_CHECK(pThis); /* Sanity checks at higher debug levels only */ if (Index >= (unsigned)pThis->NumItems) { GUI_DEBUG_ERROROUT("GUI_ARRAY_InsertBlankItem: Illegal index"); } else { WM_HMEM hNewBuffer; hNewBuffer = GUI_ALLOC_AllocZero(sizeof(WM_HMEM) * (pThis->NumItems + 1)); if (hNewBuffer == 0) { GUI_DEBUG_ERROROUT("GUI_ARRAY_InsertBlankItem: Failed to alloc buffer"); } else { WM_HMEM *pOldBuffer; WM_HMEM *pNewBuffer; pNewBuffer = (WM_HMEM*) GUI_ALLOC_h2p(hNewBuffer); pOldBuffer = (WM_HMEM*) GUI_ALLOC_h2p(pThis->haHandle); memcpy(pNewBuffer, pOldBuffer, Index * sizeof(WM_HMEM)); memcpy(pNewBuffer + (Index + 1), pOldBuffer + Index, (pThis->NumItems - Index) * sizeof(WM_HMEM)); GUI_ALLOC_Free(pThis->haHandle); pThis->haHandle = hNewBuffer; pThis->NumItems++; return 1; /* Successfull */ } } return 0; /* Failed */ }
static void _CreateLanguageResources(void) { HANDLE hFile; char acFileName[_MAX_FNAME]; char acDrive[_MAX_DRIVE]; char acPath[_MAX_PATH]; char acDir[_MAX_DIR]; char acExt[_MAX_EXT]; U32 NumBytesWritten; U8 FileCnt; GetModuleFileName(NULL, acPath, FILENAME_MAX); _splitpath(acPath, acDrive, acDir, acFileName, acExt); for (FileCnt = 0; FileCnt < NUM_FILES; FileCnt++) { sprintf(acFileName, _ResFileName[FileCnt].pFileName); sprintf(acExt, _ResFileName[FileCnt].pExt); _makepath(acPath, acDrive, acDir, acFileName, acExt); hFile = CreateFile(acPath, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (hFile == INVALID_HANDLE_VALUE) { GUI_DEBUG_ERROROUT("File could not be created."); } WriteFile(hFile, _ResFileData[FileCnt].pData, _ResFileData[FileCnt].NumBytes, &NumBytesWritten, NULL); CloseHandle(hFile); if (_ResFileData[FileCnt].NumBytes != NumBytesWritten) { GUI_DEBUG_ERROROUT("File was not written properly."); } } }
/********************************************************************* * * GUI_ALLOC_h2p */ void* GUI_ALLOC_h2p(GUI_HMEM hMem) { GUI_ASSERT_LOCK(); #if GUI_DEBUG_LEVEL > 0 if (!hMem) { GUI_DEBUG_ERROROUT("\n"__FILE__ " GUI_ALLOC_h2p: illegal argument (0 handle)"); return 0; } if (aBlock[hMem].Size == 0) { GUI_DEBUG_ERROROUT("Dereferencing free block"); } #endif return HMEM2PTR(hMem); }
/********************************************************************* * * GUITASK_AssertNoLock * */ void GUITASK_AssertNoLock(void) { GUI_Lock(); if (GUITASK__EntranceCnt > 1) { GUI_DEBUG_ERROROUT("GUITASK.c: GUITASK_AssertNoLock failed!"); } GUI_Unlock(); }
/********************************************************************* * * GUI_AddDecShift */ void GUI_AddDecShift(I32 v, U8 Len, U8 Shift, char**ps) { char c; long d; #ifndef _CM16C Len -= _Check_NegLong(&v, ps); /* TASKING: Tool internal error S003: asertion failed - please report */ #else if (v < 0) { *(*ps)++ = '-'; v = -v; } #endif if (Shift) { Len--; } #if GUI_DEBUG_LEVEL >1 if (Len > 9) { Len = 9; GUI_DEBUG_ERROROUT("Can not display more than 9 dec. digits"); } #endif if ((U32)v >= GUI_Pow10[Len]) v = GUI_Pow10[Len] - 1; while (Len) { if (Len-- == Shift) *(*ps)++ = GUI_DecChar; d = GUI_Pow10[Len]; c = (char) (v / d); v -= c * d; *(*ps)++ = c + '0'; } **ps = 0; }
/********************************************************************* * * _Free */ static void _Free(GUI_HMEM hMem) { GUI_ALLOC_DATATYPE Size; GUI_DEBUG_LOG1("\nGUI_ALLOC_Free(%d)", hMem); /* Do some error checking ... */ #if GUI_DEBUG_LEVEL>0 /* Block not allocated ? */ if (aBlock[hMem].Size == 0) { GUI_DEBUG_ERROROUT("GUI_ALLOC_Free(): Invalid hMem"); return; } #endif Size = aBlock[hMem].Size; #ifdef WIN32 GUI_MEMSET(&GUI_Heap.abHeap[aBlock[hMem].Off], 0xcc, Size); #endif GUI_ALLOC.NumFreeBytes += Size; GUI_ALLOC.NumUsedBytes -= Size; aBlock[hMem].Size = 0; if (_FirstFreeHandle > hMem) { _FirstFreeHandle = hMem; } { int Next = aBlock[hMem].Next; int Prev = aBlock[hMem].Prev; aBlock[Prev].Next = Next; if (Next) { aBlock[Next].Prev = Prev; } } GUI_ALLOC.NumFreeBlocks++; GUI_ALLOC.NumUsedBlocks--; }
/********************************************************************* * * GUI_SIF_CreateFont */ void GUI_SIF_CreateFont(void * pFontData, GUI_FONT * pFont, const GUI_SIF_TYPE * pFontType) { const U8 * pSrc = (const U8 *)pFontData; U32 ID; /* Set pFontData of GUI_FONT structure to the first byte */ pFont->p.pFontData = pFontData; /* Check ID */ ID = GUI__Read32(&pSrc); if (ID != 0x50495547) { /* 'GUIP' */ GUI_DEBUG_ERROROUT("ID of downloaded font wrong!"); return; } /* Read properties of the font */ pFont->YSize = GUI__Read16(&pSrc); pFont->YDist = GUI__Read16(&pSrc); pFont->Baseline = GUI__Read16(&pSrc); pFont->LHeight = GUI__Read16(&pSrc); pFont->CHeight = GUI__Read16(&pSrc); /* Magnification is always 1 */ pFont->XMag = 1; pFont->YMag = 1; /* Set function pointers */ pFont->pfDispChar = pFontType->pDispChar; pFont->pfGetCharDistX = pFontType->pGetCharDistX; pFont->pfGetFontInfo = pFontType->pGetFontInfo; pFont->pfIsInFont = pFontType->pIsInFont; pFont->pafEncode = 0; /* Use the new font */ GUI_SetFont(pFont); }
EDIT_Handle EDIT_CreateAsChild (int x0, int y0, int xsize, int ysize, WM_HWIN hParent, int Id, int Flags, int MaxLen) { EDIT_Handle hObj; if (MaxLen == 0) { MaxLen = 8; } /* Alloc memory for obj */ WM_LOCK(); hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hParent, WM_CF_SHOW | Flags, EDIT__Callback, sizeof(EDIT_Obj)-sizeof(WM_Obj)); if (hObj) { EDIT_Obj* pObj = (EDIT_Obj*)WM_HMEM2Ptr(hObj); /* init widget specific variables */ WIDGET__Init(&pObj->Widget, WIDGET_STATE_FOCUSSABLE | WIDGET_STATE_ENABLED); pObj->Widget.Id = Id; /* init member variables */ INIT_ID(pObj); pObj->pFont = _pDefaultFont; pObj->aBkColor[0] = EDIT_BKCOLOR0_DEFAULT; pObj->aBkColor[1] = EDIT_BKCOLOR1_DEFAULT; pObj->aTextColor[0] = EDIT_TEXTCOLOR0_DEFAULT; pObj->aTextColor[1] = EDIT_TEXTCOLOR1_DEFAULT; pObj->Align = _DefaultAlign; pObj->Border = _DefaultBorder; pObj->XSizeCursor = 1; pObj->MaxLen = MaxLen; if ((pObj->hpText = WM_ALLOC(MaxLen+1)) ==0) { GUI_DEBUG_ERROROUT("EDIT_Create failed to alloc buffer"); EDIT_Delete(hObj); hObj =0; } } WM_UNLOCK(); return hObj; }
void GUI_ALLOC_Free(GUI_HMEM hMem) { int Size; if (hMem == GUI_HMEM_NULL) /* Note: This is not an error, it is permitted */ return; GUI_LOCK(); GUI_DEBUG_LOG1("\nGUI_ALLOC_Free(%d)", hMem); /* Do some error checking ... */ #if GUI_DEBUG_LEVEL>0 /* Block not allocated ? */ if (aBlock[hMem].Size==0) { GUI_DEBUG_ERROROUT("GUI_ALLOC_Free(): Invalid hMem"); return; } #endif Size = aBlock[hMem].Size; #ifdef WIN32 memset(&GUI_Heap.abHeap[aBlock[hMem].Off], 0xcc, Size); #endif GUI_ALLOC.NumFreeBytes += Size; GUI_ALLOC.NumUsedBytes -= Size; aBlock[hMem].Size = 0; { int Next = aBlock[hMem].Next; int Prev = aBlock[hMem].Prev; aBlock[Prev].Next = Next; if (Next) aBlock[Next].Prev = Prev; } GUI_ALLOC.NumFreeBlocks++; GUI_ALLOC.NumUsedBlocks--; GUI_UNLOCK(); }
/********************************************************************* * * EDIT_CreateEx */ EDIT_Handle EDIT_CreateEx(int x0, int y0, int xsize, int ysize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int MaxLen) { EDIT_Handle hObj; GUI_USE_PARA(ExFlags); WM_LOCK(); /* Alloc memory for obj */ WinFlags |= WM_CF_LATE_CLIP; /* Always use late clipping since widget is optimized for it. */ hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hParent, WM_CF_SHOW | WinFlags, EDIT_Callback, sizeof(EDIT_Obj) - sizeof(WM_Obj)); if (hObj) { EDIT_Obj* pObj; pObj = (EDIT_Obj *)GUI_ALLOC_h2p(hObj); /* Don't use use WIDGET_H2P because WIDGET_INIT_ID() has not be called at this point */ /* init widget specific variables */ WIDGET__Init(&pObj->Widget, Id, WIDGET_STATE_FOCUSSABLE); /* init member variables */ EDIT_INIT_ID(pObj); pObj->Props = EDIT__DefaultProps; pObj->XSizeCursor = 1; pObj->MaxLen = (MaxLen == 0) ? 8 : MaxLen; pObj->BufferSize = 0; pObj->hpText = 0; if (_IncrementBuffer(pObj, pObj->MaxLen + 1) == 0) { GUI_DEBUG_ERROROUT("EDIT_Create failed to alloc buffer"); EDIT_Delete(hObj); hObj = 0; } } WM_UNLOCK(); return hObj; }
void* GUI_ALLOC_h2p (GUI_HMEM hMem) { #if GUI_DEBUG_LEVEL>0 if (!hMem) { GUI_DEBUG_ERROROUT("\n"__FILE__ " GUI_ALLOC_h2p: illegal argument (0 handle)"); return 0; } #endif return HMEM2PTR(hMem); }
SLIDER_Obj * SLIDER_h2p(SLIDER_Handle h) { SLIDER_Obj * p = (SLIDER_Obj *)GUI_ALLOC_h2p(h); if (p) { if (p->DebugId != SLIDER_ID) { GUI_DEBUG_ERROROUT("SLIDER.c: Wrong handle type or Object not init'ed"); return 0; } } return p; }
LISTVIEW_Obj * LISTVIEW_h2p(LISTVIEW_Handle h) { LISTVIEW_Obj * p = (LISTVIEW_Obj *)GUI_ALLOC_h2p(h); if (p) { if (p->DebugId != LISTVIEW_ID) { GUI_DEBUG_ERROROUT("LISTVIEW.c: Wrong handle type or Object not init'ed"); return 0; } } return p; }
CHECKBOX_Obj * CHECKBOX_h2p(CHECKBOX_Handle h) { CHECKBOX_Obj * p = (CHECKBOX_Obj *)GUI_ALLOC_h2p(h); if (p) { if (p->DebugId != CHECKBOX_ID) { GUI_DEBUG_ERROROUT("CHECKBOX.c: Wrong handle type or Object not init'ed"); return 0; } } return p; }
PROGBAR_Obj* PROGBAR_h2p(PROGBAR_Handle h) { PROGBAR_Obj* p = (PROGBAR_Obj*)GUI_ALLOC_h2p(h); if (p) { if (p->DebugId != OBJECT_ID) { GUI_DEBUG_ERROROUT("PROGBAR.C: Wrong handle type or Object not init'ed"); return 0; } } return p; }
/********************************************************************* * * GUI_ALLOC_GetSize */ GUI_ALLOC_DATATYPE GUI_ALLOC_GetSize(GUI_HMEM hMem) { /* Do the error checking first */ #if GUI_DEBUG_LEVEL>0 if (!hMem) { GUI_DEBUG_ERROROUT("\n"__FILE__ " GUI_ALLOC_h2p: illegal argument (0 handle)"); return 0; } #endif return _GetSize(hMem); }
EDIT_Obj* EDIT_h2p(EDIT_Handle h) { EDIT_Obj* p = (EDIT_Obj*)WM_HMEM2Ptr(h); if (p) { if (p->DebugId != OBJECT_ID) { GUI_DEBUG_ERROROUT("EDIT.C: Wrong handle type or Object not init'ed"); return 0; } } return p; }
BUTTON_Obj * BUTTON_h2p(BUTTON_Handle h) { BUTTON_Obj * p = (BUTTON_Obj *)GUI_ALLOC_h2p(h); if (p) { if (p->DebugId != BUTTON_ID) { GUI_DEBUG_ERROROUT("BUTTON.c: Wrong handle type or Object not init'ed"); return 0; } } return p; }
TEXT_Obj * TEXT_h2p(TEXT_Handle h) { TEXT_Obj * p = (TEXT_Obj *)GUI_ALLOC_h2p(h); if (p) { if (p->DebugId != TEXT_ID) { GUI_DEBUG_ERROROUT("TEXT.c: Wrong handle type or Object not init'ed"); return 0; } } return p; }
static int _GetTaskNo(void) { int i; for (i=0; i< GUI_MAXTASK; i++) { U32 TaskId = GUI_X_GetTaskId(); if (_Save[i].TaskID == TaskId) return i; if (_Save[i].TaskID == 0) { _Save[i].TaskID = TaskId; return i; } } GUI_DEBUG_ERROROUT("No Context available for task ... (increase GUI_MAXTASK)"); return 0; }
void EDIT_SetMaxLen(EDIT_Handle hObj, int MaxLen) { EDIT_Obj* pObj; WM_HMEM hpText; if (hObj) { WM_LOCK(); pObj = EDIT_H2P(hObj); if ((hpText = WM_ALLOC(MaxLen+1)) ==0) { GUI_DEBUG_ERROROUT("EDIT_SetMaxLen failed to alloc buffer"); } else { WM_FREEPTR(&pObj->hpText); pObj->hpText = hpText; pObj->MaxLen = MaxLen; } EDIT_Invalidate(hObj); WM_UNLOCK(); } }
TERMINAL_Handle TERMINAL_CreateAsChild( int x0, int y0, int xsize, int ysize, WM_HWIN hWinParent, int MaxLen, int Flags) { TERMINAL_Handle hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hWinParent, Flags, _TERMINAL_Callback, sizeof(TERMINAL_Obj)-sizeof(WM_Obj)); if (hObj) { TERMINAL_Obj* pObj = TERMINAL_H2P(hObj); pObj->hpText = WM_ALLOC(MaxLen+1); /* init member variables */ if (pObj->hpText ==0) { GUI_DEBUG_ERROROUT("TERMINAL_Create failed to alloc buffer"); TERMINAL_Delete(hObj); hObj =0; } pObj->MaxLen = MaxLen; } else { GUI_DEBUG_ERROROUT_IF(hObj==0, "TERMINAL_Create failed") } return hObj; }
/********************************************************************* * * WM__SendMessage */ void WM__SendMessage(WM_HWIN hWin, WM_MESSAGE* pMsg) { static int _EntranceCnt; WM_Obj* pWin; if (_EntranceCnt < GUI_MAX_MESSAGE_NESTING) { pWin = WM_HANDLE2PTR(hWin); pMsg->hWin = hWin; if (pWin->cb != NULL) { _EntranceCnt++; (*pWin->cb)(pMsg); _EntranceCnt--; } else { WM_DefaultProc(pMsg); } } #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_PARA else { GUI_DEBUG_ERROROUT("Max. message nesting exceeded, Message skipped."); } #endif }
WM_HWIN WM_CreateWindowAsChild( int x0, int y0, int width, int height ,WM_HWIN hWinParent ,U16 Style ,WM_CALLBACK* cb ,int NumExtraBytes) { WM_Obj* pWin; WM_HWIN hWin; WM_LOCK(); Style |= WM__CreateFlags; /* Get Parent info */ if (!hWinParent) { if (WM__NumWindows) { hWinParent = WM_HBKWIN; } } if (hWinParent) { GUI_RECT Rect; WM_MESSAGE Msg; Msg.MsgId = WM_GETCLIENTRECT_ABS; Msg.Data.p = &Rect; WM_SendMessage(hWinParent, &Msg); x0 += Rect.x0; y0 += Rect.y0; if (width==0) width = Rect.x1-Rect.x0+1; if (height==0) height = Rect.y1-Rect.y0+1; } if ((hWin = (WM_HWIN) WM_ALLOC(NumExtraBytes+sizeof(WM_Obj))) == 0) { GUI_DEBUG_ERROROUT("WM_CreateWindow: No memory to create window"); } else { WM__NumWindows++; pWin = WM_H2P(hWin); memset (pWin, 0, sizeof(WM_Obj)); /* erase this data structure The explicit zero-init is no longer needed since the entire data structure is already zeroed. The advantage is that it reduces program size. */ pWin->Rect.x0 = x0; pWin->Rect.y0 = y0; pWin->Rect.x1 = x0+width-1; pWin->Rect.y1 = y0+height-1; pWin->Status = WM_SF_INUSE; /* Mark window as in use */ pWin->cb = cb; /* Add to linked lists */ pWin->hParent = hWinParent; _AddChild(hWinParent, hWin, Style & WM_CF_STAYONTOP); _AddToLinList(hWin); /* Put Window on top (or bottom) of windows stack */ if (Style & WM_CF_ACTIVATE /*| (cb==NULL)*/) { WM_SelectWindow(hWin); /* This is not needed if callbacks are being used, but it does not cost a lot and makes life easier ... */ } /* Mark client area as invalid */ WM__SendMsgNoData(hWin, WM_CREATE); /* Handle the Style flags, one at a time */ if (Style & WM_CF_SHOW) { WM_ShowWindow(hWin); } /* Hide if parent is not visible */ if (hWinParent) { WM_Obj* pWinParent = WM_H2P(hWinParent); if (!(pWinParent->Status & WM_SF_ISVIS)) { WM_HideWindow(hWin); } } /* Copy the flags which can simply be accepted */ pWin->Status |= (Style & (WM_SF_MEMDEV|WM_SF_STAYONTOP|WM_SF_HASTRANS)); } WM_UNLOCK(); return hWin; }
/********************************************************************* * * MainTask */ void MainTask(void) { const char * pText; GUI_RECT Rect; U16 xSizeScreen; U16 ySizeScreen; U16 xSizeItem; U16 ySizeItem; U16 xSize; U16 ySize; U16 xOff; U16 yOff; U8 NumLanguagesCSV; U8 ItemCnt; U8 LangCnt; GUI_Init(); GUI_UC_SetEncodeUTF8(); xSizeScreen = LCD_GetXSize(); ySizeScreen = LCD_GetYSize(); if ((xSizeScreen < XSIZE_MIN) || (ySizeScreen < YSIZE_MIN)) { GUI_DEBUG_ERROROUT("Inaccurate display size."); } // // Stretch the sample up to a size of #define XSIZE_MAX * YSIZE_MAX. // Above that display size the sample is centered on the according axis. // if (xSizeScreen > XSIZE_MAX) { xOff = (xSizeScreen - XSIZE_MAX) / 2; xSize = XSIZE_MAX; } else { xOff = 0; xSize = xSizeScreen; } if (ySizeScreen > YSIZE_MAX) { yOff = (ySizeScreen - YSIZE_MAX) / 2; ySize = YSIZE_MAX; } else { yOff = 0; ySize = ySizeScreen; } #ifdef WIN32 _CreateLanguageResources(); #endif // // Draw background // xSizeItem = xSize / NUM_LANGUAGES; ySizeItem = (ySize - HEIGHT_TOP) / NUM_ITEMS; GUI_SetBkColor(GUI_DARKBLUE); GUI_Clear(); GUI_DrawGradientV(0, HEIGHT_TOP, xSizeScreen - 1, ySizeScreen - 1, GUI_DARKBLUE, GUI_DARKGRAY); // // Draw frames // Rect.x0 = xOff + BORDER_SIZE; Rect.x1 = xOff + xSizeItem * 2 - BORDER_SIZE; Rect.y0 = yOff + HEIGHT_TOP + BORDER_SIZE; Rect.y1 = ySizeScreen - yOff - BORDER_SIZE - 1; GUI_DrawRectEx(&Rect); GUI_DrawHLine(Rect.y0 + ySizeItem, Rect.x0, Rect.x1); Rect.x0 = xOff + xSizeItem * 2 + BORDER_SIZE; Rect.x1 = xSizeScreen - xOff - BORDER_SIZE; GUI_DrawRectEx(&Rect); GUI_DrawHLine(Rect.y0 + ySizeItem, Rect.x0, Rect.x1); // // Display headlines // GUI_SetFont(&GUI_Font20B_ASCII); GUI_SetTextMode(GUI_TM_TRANS); Rect.x0 = xOff; Rect.x1 = xOff + xSize - 1; Rect.y0 = yOff; Rect.y1 = yOff + HEIGHT_HEADLINE_1 - 1; GUI_DispStringInRect("emWin - Language Resources", &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER); GUI_SetFont(&GUI_Font13B_ASCII); Rect.x1 = xOff + xSizeItem * 2 - 1; Rect.y0 = yOff + HEIGHT_HEADLINE_1; Rect.y1 = yOff + HEIGHT_TOP - 1; GUI_DispStringInRect("CSV file", &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER); Rect.x0 = Rect.x1; Rect.x1 = xSizeScreen - xOff - 1; GUI_DispStringInRect("Text file", &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER); // // Load resource files // GUI_LANG_SetMaxNumLang(NUM_LANGUAGES); #ifdef WIN32 NumLanguagesCSV = GUI_LANG_LoadCSVEx(_GetData, &_ResFileName[0]); GUI_LANG_LoadTextEx(_GetData, &_ResFileName[1], NumLanguagesCSV); #else NumLanguagesCSV = GUI_LANG_LoadCSV(_acGUI_LANG_CSV_Ger_Eng, sizeof(_acGUI_LANG_CSV_Ger_Eng)); GUI_LANG_LoadText(_acGUI_LANG_TXT_Jap, sizeof(_acGUI_LANG_TXT_Jap), NumLanguagesCSV); #endif // // Display the resource text in the calculated rectangle // using the according font for headline and body. // for (LangCnt = 0; LangCnt < NUM_LANGUAGES; LangCnt++) { Rect.x0 = xOff + LangCnt * xSizeItem; Rect.x1 = Rect.x0 + xSizeItem; for (ItemCnt = 0; ItemCnt < NUM_ITEMS; ItemCnt++) { pText = GUI_LANG_GetTextEx(ItemCnt, LangCnt); Rect.y0 = yOff + HEIGHT_TOP + (ItemCnt * ySizeItem); Rect.y1 = Rect.y0 + ySizeItem; if (ItemCnt == 0) { GUI_SetFont(_Languages[LangCnt].pFontHeadline); } else { GUI_SetFont(_Languages[LangCnt].pFontBody); } GUI_DispStringInRect(pText, &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER); } } while (1) { GUI_Delay(100); } }
/********************************************************************* * * GUITASK_AssertLock * */ void GUITASK_AssertLock(void) { if (!GUITASK__EntranceCnt) { GUI_DEBUG_ERROROUT("GUITASK.c: GUITASK_AssertLock failed!"); } }