Modal behaviour for a face (or modal face)
[1/6] from: etienne::alaurent::free::fr at: 12-Mar-2002 19:12
Hi, rebollers
In a block of faces, I want to make a face modal.
Rebol team suggests 'inform, but this function creates a new window.
What I want is : a modal behaviour for a face; all events in this face
are grabbed by itself and dispatched toward its sub-faces. All events
outside this face are ignored.
suggestions ?
--
regards.
---
Etienne
[2/6] from: rotenca:telvia:it at: 12-Mar-2002 22:51
Hi Etienne,
> What I want is : a modal behaviour for a face; all events in this face
> are grabbed by itself and dispatched toward its sub-faces. All events
> outside this face are ignored.
>
> suggestions ?
1) Detect function in a parent face.
2) Event handler function at window/screen level.
---
Ciao
Romano
[3/6] from: g:santilli:tiscalinet:it at: 13-Mar-2002 11:27
Hi Etienne,
On Tuesday, March 12, 2002, 7:12:15 PM, you wrote:
EA> What I want is : a modal behaviour for a face; all events in this face
EA> are grabbed by itself and dispatched toward its sub-faces. All events
EA> outside this face are ignored.
It should be sufficient to modify:
>> print mold get in system/view 'wake-event
func [port /local event no-btn][
event: pick port 1
if none? event [
if debug [print "Event port awoke, but no event was present."]
return false
]
either not pop-face [
do event
empty? screen-face/pane
] [
either any [pop-face = event/face within? event/offset win-offset? pop-face pop-face/size]
[
no-btn: false
if block? get in pop-face 'pane [
no-btn: foreach item pop-face/pane [if get in item 'action [break/return false] true]
]
if any [all [event/type = 'up no-btn] event/type = 'close] [hide-popup]
do event
] [
if pop-face/action [
if not find [move time] event/type [hide-popup]
do event
]
]
none? find pop-list pop-face
]
]
(Notice that if you create a new one instead of patching it, you
should install it in system/ports/wait-list/1/awake.)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[4/6] from: rotenca:telvia:it at: 13-Mar-2002 14:02
Hi Etienne,
I forgot in the previous answer this refinement of show-popup:
show-popup/window an-existing-window
you could look at the source of
system/words/choose
to see how it is used by RT.
---
Ciao
Romano
[5/6] from: etienne:alaurent:free at: 13-Mar-2002 14:56
En réponse à Gabriele Santilli <[g--santilli--tiscalinet--it]>:
Hi, Gabriele,
Thank you. I will study this.
Regards
---
Etienne
[6/6] from: etienne:alaurent:free at: 14-Mar-2002 14:26
Hi, Romano,
Thank you for this info. I will study it.
Regards
---
Etienne
En réponse à Romano Paolo Tenca <[rotenca--telvia--it]>: