-
Notifications
You must be signed in to change notification settings - Fork 0
Component
Igor Usenko edited this page May 9, 2022
·
28 revisions
The part of the UI screen.
An array of the components represents the UI screen.
Maintain the state.
The state can be changed from some FreeRTOS tasks or from other components.
There are two standard components: Text and Button.
All the components use predefined palette colors only:
-
black- just black color -
information- color for information components -
interaction- color for interactive components -
attention- color for components which are required user attention
-
bounding box (x, y, w, h)- x, y initially it is the relative to the parent coordinates. seemount state
-
mount(component, x, y)- mounts component to the screen by converting its relative coordinates to the real screen coordinates -
contains(component, x, y)- returns true if (x, y) is inside component bounding box
-
newState(component)- compares the new state with previous. returns true if render needed -
render(component, forced, tftApi)- renders the component's state. theforcedflag means that the component should perform a full redraw.
-
onTouch(component, x, y, tickCount)- called when user touched screen -
onMove(component, x, y, tickCount)- called when user moving touch point -
onRelease(component, x, y, tickCount)- called when user released touch screen -
onGesture(component, gesture)- called when user made a gesture