[REBOL] Building a GUI Forms Designer
From: james::mustard::co::nz at: 28-Oct-2001 2:49
Hi there, currently I am in the process of building a GUI Forms Designer
and all is progressing nicely with the exception of a few objects that
either don't create properly with make-face, or once created refuse to
respond to feel/engage events. Below is a portion of the code which
activates depending on the object the user wishes to create:
make-this: func ['obj] [
append work-form/pane v: make-face obj
v/offset: 200x200 ;current generic spawn point
if none? v/color [v/color: white]
v/feel: make v/feel [
engage: func [face action event][
if action = 'down [
start: event/offset
remove find face/parent-face/pane face
append face/parent-face/pane face
]
if find [over away] action [
face/offset: face/offset + event/offset - start
show face
]]]
show v
show work-form
]
Calling format is: make-this <object type>
This creates an object with origin 200x200 in the current work-form (a
subface of the main window pane) and enables drag and z-order events for the
object.
Objects that create properly and are fully interactive: Field, Area, Button,
Image, Choice, Toggle, Check, Radio, Box, Progress, Slider, Arrow, LED
Creates, but no engage events: Text-List.
Doesn't create with make-face: Label, Text, Anim, Icon, List, Rotary, List,
Panel
Not tested: all other objects.
Any suggections for working with the text-list events and suggestions on
more detailed help on make-face would be appreciated :)