Example #1
0
static D4D_SIZE D4D_GetIconsMaxSize(D4D_MENU *pMenu)
{
  Byte tmpB;
  D4D_SIZE tmpSize =  {0, 0};
  D4D_MENU_INDEX itemsCnt = D4D_GetItemsCount(pMenu);


  // compute max width of used Icons
  for(tmpB = 0; tmpB < itemsCnt; tmpB++)
  {
    if(pMenu->pItems[tmpB].pIcon != NULL)
    {
      if(D4D_GetBmpWidth(pMenu->pItems[tmpB].pIcon) > tmpSize.cx)
        tmpSize.cx = D4D_GetBmpWidth(pMenu->pItems[tmpB].pIcon);

      if(D4D_GetBmpHeight(pMenu->pItems[tmpB].pIcon) > tmpSize.cy)
        tmpSize.cy = D4D_GetBmpHeight(pMenu->pItems[tmpB].pIcon);
    }
  }
  return tmpSize;
}
Example #2
0
/**************************************************************//*!
*
* Compute offset of screen header title
*
******************************************************************/
static D4D_COOR D4D_GetScrHeaderTitleOffset(D4D_SCREEN* pScreen)
{
  D4D_COOR tmp_off = D4D_SCR_TITLE_OFF_X;
  
  if(pScreen == NULL)
    return 0;
  
  if(pScreen->pIcon != NULL)    
    tmp_off = (D4D_COOR)(D4D_GetBmpWidth(pScreen->pIcon) + D4D_SCR_TITLE_OFF_X * 2);          
  
  #if D4D_ROUND_CORNER_ENABLE == D4D_TRUE
    tmp_off += (pScreen->radius * 2);
  #endif  
      
  return tmp_off;  
}