/** * Create the screen */ void ScreenCalibrationTest_Create(void) { Create_PageObj(s_pThisScreen); GL_PageControls_TypeDef* displayWidget = NewCustomWidget(1, showTouches_GetWidth, showTouches_GetHeight, showTouches_Click, showTouches_Draw, 0); AddPageControlObj(0, 0, displayWidget, s_pThisScreen); }
/** * Create a new widget * @param strText: Text for display. * @param textColor: Color of text on screen. * @param backColor: Color of background on screen. * @param font: Font to use (must be a GL_FontOption) * @param pUpdateHandler: Callback function executed each time the label is able to redraw. * Its forceRedisplay parameter is true (1) when entire screen is being redrawn. * Function should return true if the label has been changed and must be redrawn. */ GL_PageControls_TypeDef* Widget_NewLabel( const char* strText, uint16_t textColor, uint16_t backColor, _Bool isTransparent, GL_FontOption font, _Bool (*pUpdateHandler)(GL_PageControls_TypeDef* pThis, _Bool forceRedisplay) ) { // Instance data for *this* button being created. LabelData *pInstanceData = (LabelData*) malloc(sizeof(LabelData)); assert (pInstanceData != 0); // Create object to return GL_PageControls_TypeDef *pControl = NewCustomWidget( 0, getWidth, getHeight, eventHandler, drawHandler, pInstanceData ); // Store parameters Widget_ChangeLabelText(pControl, strText); pInstanceData->textColor = textColor; pInstanceData->backColor = backColor; pInstanceData->isTransparent = isTransparent; pInstanceData->font = font; pInstanceData->pUpdateHandler = pUpdateHandler; pInstanceData->isRedrawRequired = 0; return pControl; }
/** * Create the screen */ void ScreenCalibrate_Create(void) { Create_PageObj(s_pThisScreen); GL_PageControls_TypeDef* calibrationWidget = NewCustomWidget(1, calibration_GetWidth, calibration_GetHeight, calibration_Click, calibration_Draw, 0); AddPageControlObj(0, 0, calibrationWidget, s_pThisScreen); }
/* * Create a new widget and add it to the passed in page * Note: May create multiple controls (labels, buttons, ...) and add them to the page. */ void Widget_AddToPage_NewFFTDisplay(uint16_t x, uint16_t y, GL_Page_TypeDef *pPage) { GL_PageControls_TypeDef* newFFT = NewCustomWidget( 0, WidgetFFT_GetWidth, WidgetFFT_GetHeight, WidgetFFT_EventHandler, WidgetFFT_DrawHandler, 0); AddPageControlObj(x, y, newFFT, pPage); }
/* * Public Interface */ GL_PageControls_TypeDef* Widget_NewPSKTextDisplay(void) { GL_PageControls_TypeDef* newControl = NewCustomWidget( 0, getWidth, getHeight, eventHandler, drawHandler, 0); return newControl; }