| Did you know ... | Search Documentation: |
| Instance variables |
|{foreground,background}*->background:
background).<-status
of a figure is a name indicating which graphicals of the figure should
be visible: if figure<-status
equals all_active, all
device<-graphicals
are visible, otherwise only graphicals with the same name as figure<-status
are made visible.
This mechanism may be used to define graphical
objects that should be switched between different states. Consider the
example where we want to have a diagram which can be displayed opened
and as an icon. The code below outlines a possible
approach:
create_closable_diagram(F) :-
new(F, figure),
send(F, status, opened),
send(F, display, new(BM, bitmap('my_icon'))),
send(BM, name, closed),
send(BM, recogniser,
click_gesture(left, '', double,
message(F, status, opened),
send(F, display, new(F2, figure)),
send(F2, name, opened),
...
<create the real diagram on F2>
<-pen
to draw a visible frame at a distance from the contents.<-pen/figure<-elevation.
0 yields a square outline.elevation object describing a 3-D appearance (raised,
sunken, shadow, ...) of the figure's box. @nil
disables the effect. The legacy figure<->shadow
shortcut creates a shadow elevation.transform applied to the figure's
contents.
@nil means no
transform. The transform is applied to the children while drawing,
hit-testing and computing the bounding box, so a rotated/scaled figure
is still selectable by the mouse and reports a tight bounding box in its
parent's coordinates. The convenience methods figure->translate, figure->scale, figure->rotate
and figure->shear
compose operations into this transform without the caller having to
manage the transform
object explicitly.->compute.
Damage handling and child event dispatch use this to keep paint and hit
tests correct under rotation/scale.