/********************************************************************* * * PROGBAR_SetText */ void PROGBAR_SetText(PROGBAR_Handle hObj, const char* s) { if (hObj) { PROGBAR_Obj* pObj; const GUI_FONT GUI_UNI_PTR * pOldFont; GUI_RECT r1; char acBuffer[5]; WM_LOCK(); pObj = PROGBAR_H2P(hObj); pOldFont = GUI_SetFont(pObj->Props.pFont); PROGBAR__GetTextRect(pObj, &r1, PROGBAR__GetText(pObj, acBuffer)); if (!s) { PROGBAR__FreeText(hObj); WM_InvalidateRect(hObj, &r1); } else { if (GUI__SetText(&pObj->hpText, s)) { GUI_RECT r2; PROGBAR__GetTextRect(pObj, &r2, PROGBAR__GetText(pObj, acBuffer)); GUI_MergeRect(&r1, &r1, &r2); WM_InvalidateRect(hObj, &r1); } } GUI_SetFont(pOldFont); WM_UNLOCK(); } }
/********************************************************************* * * 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(); } }
/********************************************************************* * * CHECKBOX_SetText */ void CHECKBOX_SetText(CHECKBOX_Handle hObj, const char * s) { CHECKBOX_Obj * pObj; if (hObj && s) { WM_LOCK(); pObj = CHECKBOX_H2P(hObj); if (GUI__SetText(&pObj->hpText, s)) { WM_Invalidate(hObj); } WM_UNLOCK(); } }