Ejemplo n.º 1
0
void BUTTON_SetFont(BUTTON_Handle hObj, const GUI_FONT* pfont) {
  if (hObj) {
    BUTTON_Obj* pObj = BUTTON_H2P(hObj);
    BUTTON_ASSERT_IS_VALID_PTR(pObj);
    pObj->pFont = pfont;
    BUTTON_Invalidate(hObj);
  } else {
    GUI_DEBUG_WARN("BUTTON_SetFont: Invalid handle");
  }
}
Ejemplo n.º 2
0
void BUTTON_SetTextColor(BUTTON_Handle hObj, int Index, GUI_COLOR color) {
  if (hObj) {
    BUTTON_Obj* pObj = BUTTON_H2P(hObj);
    BUTTON_ASSERT_IS_VALID_PTR(pObj);
    pObj->aTextColor[Index] = color;
    BUTTON_Invalidate(hObj);
  } else {
    GUI_DEBUG_WARN("BUTTON_SetTextColor: Invalid handle");
  }
}
Ejemplo n.º 3
0
/*********************************************************************
*
*       BUTTON_SetTextColor
*/
void BUTTON_SetTextColor(BUTTON_Handle hObj,unsigned int Index, GUI_COLOR Color) {
  if (hObj && (Index <= 2)) {
    BUTTON_Obj* pObj;
    WM_LOCK();
    pObj = BUTTON_H2P(hObj);
    pObj->Props.aTextColor[Index] = Color;
    BUTTON_Invalidate(hObj);
    WM_UNLOCK();
  }
}
Ejemplo n.º 4
0
/*********************************************************************
*
*       BUTTON_SetFont
*/
void BUTTON_SetFont(BUTTON_Handle hObj, const GUI_FONT GUI_UNI_PTR * pfont) {
  if (hObj) {
    BUTTON_Obj* pObj;
    WM_LOCK();
    pObj = BUTTON_H2P(hObj);
    pObj->Props.pFont = pfont;
    BUTTON_Invalidate(hObj);
    WM_UNLOCK();
  }
}
Ejemplo n.º 5
0
void BUTTON_SetStreamedBitmap(BUTTON_Handle hObj, int Index, const GUI_BITMAP_STREAM* pBitmap) {
  if (hObj) {
    BUTTON_Obj* pObj = BUTTON_H2P(hObj);
    BUTTON_ASSERT_IS_VALID_PTR(pObj);
    if ((unsigned int)Index > GUI_COUNTOF(pObj->apBitmap))
      return;
    pObj->apBitmap[Index] = (const GUI_BITMAP*)pBitmap;
    pObj->aBitmapIsStreamed[Index] = 1;
    BUTTON_Invalidate(hObj);
  }
}
Ejemplo n.º 6
0
/*********************************************************************
*
*       BUTTON_SetText
*/
void BUTTON_SetText(BUTTON_Handle hObj, const char* s) {
  if (hObj) {
    BUTTON_Obj* pObj;
    WM_LOCK();
    pObj = BUTTON_H2P(hObj);
    if (GUI__SetText(&pObj->hpText, s)) {
      BUTTON_Invalidate(hObj);
    }
    WM_UNLOCK();
  }
}
Ejemplo n.º 7
0
/*********************************************************************
*
*       BUTTON_SetBkColor
*/
void BUTTON_SetBkColor(BUTTON_Handle hObj,unsigned int Index, GUI_COLOR Color) {
  if (hObj && (Index <= 2)) {
    BUTTON_Obj* pObj;
    WM_LOCK();
    pObj = BUTTON_H2P(hObj);
    BUTTON_ASSERT_IS_VALID_PTR(pObj);
    pObj->Props.aBkColor[Index] = Color;
    BUTTON_Invalidate(hObj);
    WM_UNLOCK();
  }
}
Ejemplo n.º 8
0
/*********************************************************************
*
*       BUTTON_SetTextAlign
*/
void BUTTON_SetTextAlign(BUTTON_Handle hObj, int Align) {
  if (hObj) {
    BUTTON_Obj* pObj;
    WM_LOCK();
    pObj = BUTTON_H2P(hObj);
    BUTTON_ASSERT_IS_VALID_PTR(pObj);
    pObj->Props.Align = Align;
    BUTTON_Invalidate(hObj);
    WM_UNLOCK();
  }
}
Ejemplo n.º 9
0
void BUTTON_SetBitmapEx(BUTTON_Handle hObj, int Index, const GUI_BITMAP* pBitmap, int x, int y) {
  if (hObj) {
    BUTTON_Obj* pObj = BUTTON_H2P(hObj);
    BUTTON_ASSERT_IS_VALID_PTR(pObj);
    if ((unsigned int)Index > GUI_COUNTOF(pObj->apBitmap))
      return;
    pObj->apBitmap[Index] = pBitmap;
    pObj->xOffBitmap[Index] = x;
    pObj->yOffBitmap[Index] = y;
    BUTTON_Invalidate(hObj);
  }
}
Ejemplo n.º 10
0
void BUTTON_SetBitmap(BUTTON_Handle hObj, int Index, const GUI_BITMAP* pBitmap) {
  #if BUTTON_SUPPORT_BITMAP_OFFSET
    BUTTON_SetBitmapEx(hObj, Index, pBitmap, 0,0);
  #else
  if (hObj) {
    BUTTON_Obj* pObj = BUTTON_H2P(hObj);
    BUTTON_ASSERT_IS_VALID_PTR(pObj);
    if ((unsigned int)Index > GUI_COUNTOF(pObj->apBitmap))
      return;
    pObj->apBitmap[Index] = pBitmap;
    BUTTON_Invalidate(hObj);
  }
  #endif
}
Ejemplo n.º 11
0
/*********************************************************************
*
*       BUTTON_SetDrawObj
*/
void BUTTON__SetDrawObj(BUTTON_Handle hObj, int Index, GUI_DRAW_HANDLE hDrawObj) {
  if (hObj) {
    BUTTON_Obj* pObj;
    WM_LOCK();
    pObj = BUTTON_H2P(hObj);
    BUTTON_ASSERT_IS_VALID_PTR(pObj);
    if ((unsigned int)Index <= GUI_COUNTOF(pObj->ahDrawObj)) {
      GUI_ALLOC_FreePtr(&pObj->ahDrawObj[Index]);
      pObj->ahDrawObj[Index] = hDrawObj;
      BUTTON_Invalidate(hObj);
    }
    WM_UNLOCK();
  }
}
Ejemplo n.º 12
0
void BUTTON_SetText(BUTTON_Handle hObj, const char* s) {
  WM_LOCK();
  if (hObj) {
    BUTTON_Obj* pObj = BUTTON_H2P(hObj);
    BUTTON_ASSERT_IS_VALID_PTR(pObj);
    WM_FREEPTR(&pObj->hpText);
    {
      WM_HMEM hMem = WM_ALLOC(strlen(s)+1);
      if (hMem) {
        strcpy((char *) WM_HMEM2Ptr(hMem), s);
      }
      pObj->hpText = hMem;
    }
    BUTTON_Invalidate(hObj);
  } else {
    GUI_DEBUG_WARN("BUTTON_SetText: Invalid handle");
  }
  WM_UNLOCK();
}