11
3. Creating a Display
3.1 Screens
Raptor™ has special blocks for defining graphical output in displays. The main block that organizes the
sequence of drawing UI elements is the Screen Definition block.
Screen Outputs
Figure 3.1.a – Screen Definition
As a rule of thumb,
Create_Background()
and
UpdateForeground()
should only be used for
drawing and display logic. While it’s valid to poll I/O, communications, or work with other pieces of
application logic in these subsystems, it is cleaner to do so in either the
Init()
or
IsCurrentScreen
subsystems, using ports as necessary to pipe relevant data back and forth.
Init()
Actions that are executed when a screen is initialized go into the
Init()
function. This
subsystem is called each time the screen is brought up as the current screen.
That is, for two hypothetical screens,
MyScreen1
and
MyScreen2
, if the application begins on
MyScreen1
, switches to
MyScreen2
, and then switches back to
MyScreen1
, the
Init()
function will be
called twice; once when the application starts up, and once when switching back from
MyScreen2
.
Create_Background()
Actions that are executed only when a complete redraw of a screen is required go into the
Create_Background()
function. These because these actions do not happen frequently, only items that