passing events between faces
[1/2] from: james::mustard::co::nz at: 3-Nov-2001 21:03
Not sure how easy this is to do but I'm trying to pass events from one face
to another face below it in such a way that the face below believes it is
the only face.
- ie objects upon that face receive the focus etc as per normal.
Example:
REBOL []
work-form: layout/offset [origin 0x0 space 0x0 button "A" button "B" button
C
button "D"] 0x0
pass-plane: layout/size/offset [] work-form/size 0x0
base-form: layout/size [] work-form/size
pass-plane/color: none
pass-plane/effect: [colorize 255.0.0]
append base-form/pane work-form
append base-form/pane pass-plane
view base-form
What I am trying to get is if I click on the pass-plane over a button then
that button will receive its normal events. The intention here is to extend
this to any object on the underlying face - not just buttons.
I tried setting an engage event for the pass-plane face and using:
work-form/pane/feel/engage work-form action event
but this merely sent the event only to the face below - not to its objects.
James
[2/2] from: james:mustard at: 4-Nov-2001 1:14
> What I am trying to get is if I click on the pass-plane over a button then
> that button will receive its normal events. The intention here is to
extend
> this to any object on the underlying face - not just buttons.
>
heh.. self reply.. well only partially..
the following will pass the events to controls on another face - but does
not do their default responses - eg button presses, text focus etc.
REBOL []
work-form: layout/offset [
style abutton button with [feel: make feel [engage: func [f a e][either
within? e/offset f/offset f/size [insert f/texts e/offset show f][none]]]]
origin 0x0 space 0x0 abutton "A" abutton "B" abutton "C" abutton "D"
] 0x0
pass-plane: layout/size/offset [] work-form/size 0x0
base-form: layout/size [] work-form/size
pass-plane/color: none
pass-plane/effect: [colorize 255.0.0]
pass-plane/feel: make pass-plane/feel [engage: func [f a e][foreach o
work-form/pane [o/feel/engage o a e]]]
append base-form/pane work-form
append base-form/pane pass-plane
view base-form
Is there a more efficient way to transfer events from a face to sub controls
on another face?
James