Rather than do all the calculations, we’re going to first
manually place the controls on the
Interface just as we did with the
other controls — but not
permanently. Then, we’re going to let
the Object Editor figure out all the
pertinent control dimensions and
coordinates for us.
Using the methods we showed
you in Parts 8 and 9, in the
rectangular area below the second
meter we’ve placed a Label titled
“Pot Value” and an LED bar graph
Image Holder (Figure 4). These two
controls were sized and oriented to
fit exactly where we want them to go
using the Object Editor.
Figure 4. Manually placing controls.
Next, we brought up the Macro
Builder (Figure 5) to see where these
Objects are placed on the Interface.
Clicking on the “Update from current
settings” button, we can see that
these objects appear as the last two
in the Objects listing. This is what
they look like:
location of the top-left of each control using the Object
Background X, Y coordinates as shown. Then, we can
calculate the sizes of each control and enter them into the
instruction code for our micro.
While this is all doable, there’s an easier way.
‘ lbl_83 — OLABEL *****
‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘ lbar_84 — OIMAGE *****
Notice that the Macro Builder has
done all the work for us. It’s included
the MakerPlot !POBJ (Plot Object)
instruction in front of the object types
( oLabel.lbl_ 83 and oImage.lbar_84),
and then followed this with the X and Y
coordinates and size dimensions — plus
everything else that the object needs,
like the label (Pot Value) and the type
of LED bar graph (bars\bar_hor_red_
0.gif). All of this is pretty cryptic, and
while it can be done by hand without
using the Object Editor and Macro
Builder to configure the instructions, it’s
certainly more involved and risky
compared to this method.
Figure 5. Copy the control instructions to the clipboard.
(The sidebar has an example
of a handmade Interface to
50 July 2014