moof of the day,
Attatched to this file is a tiny stack that represents the problem I'm
having dragging multiple objects. The project requires that if 1 or
more buttons happen to intersect a grc then not only does the selected
button have to move but also the other buttons which were found to
intersect the grc. The idea behind this is to simulate a film reel in
which the operator can drag and drop film strips (the buttons) onto a
film reel (the grc), but since a reel is a single entity (in real life)
then all the film strips (the buttons) within the reel (the grc) must
move in succession.
Kudos to anyone that can solve this.
Thanks,
Simon
-- [---------------------------------] Simon Lord [No matter how idiot proof you try] Database Engineer, CAE Electronics [to make any product, there will ] tel: (514) 341-2000 x3861 [always be two people somewhere in] fax: (514) 340-5496 [the world working hard at making ] [a bigger and better idiot. ] [---------------------------------] email: simonl@cae.ca---------------------------------------------------------------------- Arthur C. Clarke was quoted as saying he would prefer HAL, a super- computer named after the famous rogue intelligence in 2001 being constructed at the University of Illinois, to speak these as its first words:
"Good morning doctors. I have taken the liberty of removing Windows 95 from my hard drive". ----------------------------------------------------------------------
--------------9C5BB1D7BC20838E24193F8B Content-Type: text/plain; charset=iso-8859-1; name="drag_sample.mc" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="drag_sample.mc"
#!/bin/sh # MetaCard 2.1 stack # The following is not ASCII text, # so now would be a good time to q out of more=0C exec mc $0 "$@" =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00= =00=02 =A5Home,/usr/simon/MetaCard_211/mchome.mc MetaCard Menu Bar,/usr/simon/MetaCard_211/mctools.mc Help Directory,/usr/simon/MetaCard_211/mchelp.mc Dialog Box Help,mchelp.mc MetaCard Tutorials,mchelp.mc MetaTalk Reference,mchelp.mc MetaTalk Examples,mchelp.mc Concepts & Techniques,mchelp.mc Help Index,mchelp.mc MetaCard FAQ,mchelp.mc Support,mchelp.mc MetaCard Version,mchelp.mc Licensing MetaCard,mchelp.mc Helper Application Check,/usr/simon/MetaCard_211/hacheck.mc javacup,/usr/simon/MetaCard_211/javacup.mc Demo,mcdemo.mc SIF->mc,/usr/simon/MetaCard/siftostk.mc Builders_Glue,Builders_Glue.mc Builders answer to Synergy,/usr/simon/MetaCard/buildertools.mc Txt->MC,C:\Program Files\MetaCard\PROGRAM\Txt_to_Mc\txt-_mc.mc myproj,/home/raney/sc/textbug.mc Txt->Mc,C:/mc/zip/Txt-_mc.mc my proj,/home/raney/sc/my_proj.mc MetaConverter,C:\Program Files\Betas\MetaCard\PROGRAM\MetaConverter.mc Stack 839045824,C:\WINDOWS\DESKTOP\MetaCard f\storescript.mc ObjectMaker,C:\WINDOWS\DESKTOP\MetaCard f\ObjectMaker.mc testcreating,C:\WINDOWS\DESKTOP\MetaCard stacks f\testcreating.mc project,C:\WINDOWS\DESKTOP\MetaCard f\project.mc SctoText,SctoText.mc makegroups,C:\WINDOWS\DESKTOP\MetaCard f\makegroups.mc texttomc.mc,C:\WINDOWS\DESKTOP\MetaCard f\textmcNw.mc menu bar,C:\WINDOWS\DESKTOP\MetaCard f\menubar.mc Menu Maker,C:\WINDOWS\DESKTOP\MetaCard f\Menu Maker.mc andrew,C:\WINDOWS\DESKTOP\MetaCard f\andrew.mc Testmodes,C:\WINDOWS\DESKTOP\MetaCard f\testmodes.mc Icon Chooser,C:\WINDOWS\DESKTOP\MetaCard f\icon_chooser.mc StoreScript!,C:\WINDOWS\DESKTOP\MetaCard f\storescript!_old.mc AppriseLite,C:\WINDOWS\DESKTOP\MetaCard f\appraiselite.mc SampleDraw 1.0,C:\Program Files\Betas\MetaCard\SampleDrw\smpldrw imgs\Sam= pleDraw 1.0.mc FoxBible.sc,FoxBible.sc.mc Patterns,C:\Program Files\Betas\MetaCard\b3\scpattens.mc FullGrprTest copy,FullGrprTest copy.mc NuGrouper.sc,NuGrouper.sc.mc Fields Sample,Fields Sample.mc Graphics Sample,Graphics Sample.mc Windows Sample,Windows Sample.mc Power Tips,Power Tips.mc SuperTalk Reference,SuperTalk Reference.mc Buttons Smple,Buttons Sample.mc SuperTalk Ref,SuperTalk Ref.mc Txt->MC_Copy,C:\Program Files\Betas\MetaCard\PROGRAM\mc f\Txt_to_Mc\origi= naltxtmc\Copy of txt-_mc.mc SIF->Mc,C:/Program Files/Betas/MetaCard/mc f/Txt_to_Mc/SIF-_MC.mc Menus Smple stk,Menus_Smple.mc Sound Smple stk,Sound_Smple.mc Fields Smple,Fields_Smple.mc Graphics Smple stk,Graphics_Smple.mc Windows Smple,Windows_Smple.mc HC>SC>MC 1.0,C:/Program Files/Betas/MetaCard/THEGUIDE/HC_SC_MC_1.0.mc Unique Tokens,C:/Program Files/Betas/MetaCard/THEGUIDE/Unique.mc HC>SC>MC Guide,/usr/simon/MetaCard/HCSCMC.mc Menus SmAple,Menus_Smple.mc Graphics Smaple,Graphics_Smple.mc SampleDrawDraw,SampleDrawDraw.mc XT Help Demo,/usr/simon/MetaCard/mcXThelp.mc Directory Browser,/usr/simon/MetaCard/directory-browser.mc Copy of MC File Menu,/usr/simon/MetaCard/build_file_menu.mc CAE Visual Sanity,/usr/simon/MetaCard/Sanity.mc Build Tools Cascade,/usr/simon/MetaCard/build_tools_cascade.mc BuildIcons,/usr/simon/MetaCard/copy_of_icons.mc mctools.mc,/usr/simon/MetaCard/buildertools.mc Icons,/usr/simon/MetaCard/copy_of_icons.mc MetaCard Survey, sanity_colors,/usr/simon/MetaCard/sanity_colors.mc Rotate,Rotate.mc Rotating Polygons,/usr/simon/MetaCard/rotatepoly.mc find test,Find_Bug.mc sanity_sign,/usr/simon/MetaCard/sanity_sign.mc Flint_demo,/usr/simon/MetaCard_211/DISCREET_Demo/flint_demo.mc Stack 872515076,/usr/simon/MetaCard_211/hi_res_test.mc drag_sample,/usr/simon/MetaCard_211/drag_sample.mc =00=03=00=00=03=F8=00=0Cdrag_sample=00=01=00 `=00w=00=06=00=00=00=00=00=00= =00=06Black=00=C0=C0=C0=C0=C0=C0=00=00ffffff=00=00=FF=00=FF=00=FF=00=00=06= white=00??????=00=00=A9=00=A9=00=A9=00=00 darkgray=00=00=00=00=CA=01=13=03= =AE=013=00 SFGCQOPTH=00=00=00=00=00=00=00=00 =00 =05=00=04=00=00=00=00=00=04=00=00=03= =EA=00=00=00=00 P=05 # declare variables that keep track of where the ini= tial click was # across mouseMove messages. local movedObject, moveX, moveY
on mouseDown # check to see if one of the buttons was clicked on # If so, start dragging it if char 1 of the short name of the target is "B" then put the short name of the target into movedObject # compute the x offset between the center of the button and the mouse= location put item 1 of the mouseLoc - item 1 of the loc of the target\ into moveX # compute the y offset between the center of the button and the mouse= location put item 2 of the mouseLoc - item 2 of the loc of the target\ into moveY end if end mouseDown
on mouseUp x,y put empty into movedObject #clear buffer send mouseUp to grc "groove1" end mouseUp
on mouseMove x, y if movedObject is not empty then subtract moveX from x # subtract the x offset subtract moveY from y # subtract the y offset =
if intersect(grc "groove1",button movedObject) then if within(grc "groove1",the mouseLoc) then set the loc of button movedObject to x,item 2 of the loc of grc "= groove1" else set the loc of button movedObject to x,y end if else set the loc of button movedObject to x,y end if =
end if end mouseMove =00=00=00=00=00=00=00=00=00=00=00=03=AE=013=07=00=00=03=F8=07=00=00=03=F1= =07=00=00=03=ED=07=00=00=03=F5=07=00=00=03=F6=07=00=00=03=F7=08=00=00=03=ED= =00=03b0=00=E0C=0B`=00=00=00=00=00=00=01i=00=3D=000=008=00=00=02=12=00=00= =01=06=00=00=00=00=00=00 =00=00=00=00=00=12=00=00=03=F1=00=08groove1=00=00= =00KP=02$on mouseUp mouseWithin end mouseUp
on mouseWithin repeat with c =3D the number of btns down to 1 if char 1 of the short name of btn c is "B" then if intersect(btn c,grc "groove1") then put the short name of btn c &"," after bList end if end if end repeat delete last char of bList put bList end mouseWithin
on mouseEnter if within(grc "groove1", the mouseLoc) then mouseWithin end if end mouseEnter
on mouseLeave if within(grc "groove1", the mouseLoc) then mouseWithin end if end mouseLeave =00=00=02=00=01??????=00=00=00=00=FF8=00=3D=05=06=009=00=00=00=01=08=00=00= =03=F5=00=03b2=00=E0C=0B`=00=00=00=00=00=00=01=B5=00=3D=000=008=00=00=02=17= =00=00=01=06=00=00=00=00=00=00 =00=00=00=00=00=08=00=00=03=F6=00=03b3=00=E0= C=0B`=00=00=00=00=00=00=01=14=00=3D=000=008=00=00=02=18=00=00=01=06=00=00= =00=00=00=00 =00=00=00=00=00=08=00=00=03=F7=00=03b4=00=E0C=0B`=00=00=00=00= =00=00=00=C5=00=3D=000=008=00=00=02=1B=00=00=01=06=00=00=00=00=00=00 =00=00= =00=00=00 =00=00=03=F8=00=00=00=06 `=00=00=00=00=00=00=00f=00=AB=02?=00r=00=08=00=08= =00=08=00=08=00=00=0B=00=00=03=EA=0C=02LClicking and dragging any button = should not only drag the button selected button but also the other button= s that happen to lie in front or behind that button. In this example, I = happen to have four buttons, dragging 1 should also drag the other three = (or more/less buttons) along the grey strip. The buttons would maintain = whatever distance exists between them. Buttons can be dragged out of, or= into, the strip from other strips (not shown). The strip is supposed to= mimic a film reel where the user can simply drag and drop strips of file= to-and-from a predefined number of strips.=00 =00=00=00=00=00=00=00l =00=00=00=00=00l=00=05 =00=00=00=00=00q=00_ =00=00=00=00=00=D0=00C =00=00=00=00=01=13=00=06 =00=00=00=00=01=19=00 =
=00=00=00=00=01"=00=08 =00=00=00=00=01*=00=04 =00=00=00=00=01.=00=08 =00=00=00=00=016=00=06 =00=00=00=00=01<=00 =
=00=00=00=00=01E=00 =
=00=00=00=00=01N=00 =
=00=00=00=00=01W=00=07 =00=00=00=00=01^=00=08 =00=00=00=00=01f=003 =00=00=00=00=01?=00d =00=00=00=00=01=FD=00N=00 --------------9C5BB1D7BC20838E24193F8B--