Ejemplo n.º 1
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();
    }
}
Ejemplo n.º 2
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();
}
Ejemplo n.º 3
0
/*********************************************************************
*
*       _Delete
*
* Delete attached objects (if any)
*/
static void _Delete(BUTTON_Obj* pObj) {
  WM_FREEPTR(&pObj->hpText);
}
Ejemplo n.º 4
0
/*********************************************************************
*
*       _Delete
*/
static void _Delete(EDIT_Obj* pObj) {
    WM_FREEPTR(&pObj->hpText);
}
Ejemplo n.º 5
0
/*********************************************************************
*
*       _FreeText
*/
static void _FreeText(PROGBAR_Handle hObj) {
  PROGBAR_Obj* pObj = PROGBAR_H2P(hObj);
  WM_FREEPTR(&pObj->hpText);
}