/********************************************************************* * * SLIDER_CreateEx */ SLIDER_Handle SLIDER_CreateEx(int x0, int y0, int xsize, int ysize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id) { SLIDER_Handle hObj; /* Create the window */ WM_LOCK(); #if SLIDER_SUPPORT_TRANSPARENCY WinFlags |= WM_CF_HASTRANS; #endif hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hParent, WinFlags, SLIDER_Callback, sizeof(SLIDER_Obj) - sizeof(WM_Obj)); if (hObj) { SLIDER_Obj * pObj; U16 InitState; pObj = (SLIDER_Obj *)GUI_ALLOC_h2p(hObj); /* Don't use use WIDGET_H2P because WIDGET_INIT_ID() has not be called at this point */ /* Handle SpecialFlags */ InitState = WIDGET_STATE_FOCUSSABLE; if (ExFlags & SLIDER_CF_VERTICAL) { InitState |= WIDGET_CF_VERTICAL; } /* init widget specific variables */ WIDGET__Init(&pObj->Widget, Id, InitState); /* init member variables */ SLIDER_INIT_ID(pObj); pObj->Props = SLIDER__DefaultProps; pObj->Width = 8; pObj->Max = 100; pObj->Min = 0; pObj->NumTicks = -1; } else { GUI_DEBUG_ERROROUT_IF(hObj==0, "SLIDER_Create failed") } WM_UNLOCK(); return hObj; }
SLIDER_Handle SLIDER_Create (int x0, int y0, int xsize, int ysize, WM_HWIN hParent, int Id, int WinFlags, int SpecialFlags) { SLIDER_Handle hObj; /* Create the window */ WM_LOCK(); hObj = WM_CreateWindowAsChild(x0, y0, xsize, ysize, hParent, WinFlags, _SLIDER_Callback, sizeof(SLIDER_Obj)-sizeof(WM_Obj)); if (hObj) { SLIDER_Obj* pObj = SLIDER_H2P(hObj); U16 InitState; /* Handle SpecialFlags */ InitState = WIDGET_STATE_ENABLED; if (SpecialFlags & SLIDER_CF_VERTICAL) { InitState |= WIDGET_CF_VERTICAL; } /* init widget specific variables */ WIDGET__Init(&pObj->Widget, InitState); /* init member variables */ SLIDER_INIT_ID(pObj); pObj->Widget.Id = Id; pObj->aBkColor[0] = SLIDER_BKCOLOR0_DEFAULT; pObj->aBkColor[1] = SLIDER_BKCOLOR1_DEFAULT; pObj->aColor[0] = SLIDER_COLOR0_DEFAULT; pObj->aColor[1] = SLIDER_COLOR1_DEFAULT; pObj->Width = 8; pObj->Max =100; pObj->Min =0; pObj->NumSections = 10; } else { GUI_DEBUG_ERROROUT_IF(hObj==0, "SLIDER_Create failed") } WM_UNLOCK(); return hObj; }