Find objects/functions and linking some faces
[1/4] from: lp::legoff::free::fr at: 22-May-2004 23:35
Hi list,
two questions :
1/ how is it possible to get a brief listing of objects and functions including
in a script ? Parsing, testing word? or another "not documented" method ?
2/ I have a layout with a box 1 and a box 2 (same drag'n dropable style).
I want to draw a line (length = offset box1 - offset box2) beetwen my faces.
And after I would drag and drop any box, and see the other follow the first one
(like with hard link).
Any ideas or scripts references in library to begin ?
Thanks for help.
==Philippe.
[2/4] from: greggirwin:mindspring at: 23-May-2004 12:14
Hi Philippe,
llff> 1/ how is it possible to get a brief listing of objects and functions including
llff> in a script ? Parsing, testing word? or another "not documented" method ?
Something like this?
mark-my-words: context [
init: does [query/clear system/words]
dump: does [
print ['Word tab 'Type tab 'Value]
foreach word query system/words [
print [word tab type? get word tab mold get word]
]
]
]
mark-my-words/init
o: make object! [a: b: c: none]
my-int: 23
I-have-issues: #this-is-my-biggest-issue
fn: does [print "some fun now!"]
mark-my-words/dump
llff> 2/ I have a layout with a box 1 and a box 2 (same drag'n dropable style).
llff> I want to draw a line (length = offset box1 - offset box2) beetwen my faces.
llff> And after I would drag and drop any box, and see the other follow the first one
llff> (like with hard link).
I don't know of any examples for this, but I did something similar for
a project some time back. Here are a few things that might be useful,
but I can't say for sure:
distance: func [a [pair!] b [pair!] /local tmp] [
tmp: a - b
square-root add (power first tmp 2) (power second tmp 2)
]
all-corners: func [
"Returns all corners of the rectangle given the upper-left and lower-right corners."
ul [pair!] "The upper-left corner of the rectangle"
lr [pair!] "The bottom-right corner of the rectangle"
/local result
] [
result: make block! 4
repend result [
ul
to-pair compose [(first ul) (second lr)] ;ur
to-pair compose [(first lr) (second ul)] ;ll
lr
]
return result
]
nearest-point: func [
"Returns the point nearest the specified point."
pt [pair!] "The reference point"
points [any-block!] "The points you want to check"
/local result [pair!] ref-dist [decimal!]
] [
result: first points
ref-dist: distance pt first points
foreach p next points [
if (distance pt p) < ref-dist [
ref-dist: distance pt p
result: p
]
]
return result
]
nearest-corner: func [
"Returns the corner of the retangle nearest the specified point."
pt[pair!] "The reference point"
ul[pair!] "The upper-left corner of the rectangle"
lr[pair!] "The bottom-right corner of the rectangle"
] [
nearest-point pt all-corners ul lr
]
To move things, you basically need to see if the action in feel/engage
is 'over or 'away, then just adjust things accordingly. In your case
that will mean keeping lists of linked faces of course.
-- Gregg
[3/4] from: cyphre:seznam:cz at: 25-May-2004 8:21
Hi Philippe
> 2/ I have a layout with a box 1 and a box 2 (same drag'n dropable style).
> I want to draw a line (length = offset box1 - offset box2) beetwen my
faces.
> And after I would drag and drop any box, and see the other follow the
first one
> (like with hard link).
>
not sure it this is what you want but you may look into this script:
http://www.sweb.cz/fractalus/prototype.r
Regards,
Cyphre
[4/4] from: lp:legoff:free at: 26-May-2004 6:10
Hi Cyphre,
Nice ! This is exactly something like that !
Thanks !
Regards,
==Philippe.
From Cyphre <[cyphre--seznam--cz]>: