Page 1 of 1
Background and "click at -----drag from"
Posted: Fri Sep 04, 2009 7:30 pm
by undelouest
I am trying to make a card with a background larger than the screen (with a long array of fields) and draw links between some fields. The commands "click at" and "drag from the clickloc" don't works well at the edges of the background.
Something else to do ?
Posted: Mon Sep 07, 2009 12:50 pm
by Mark
Dear undelouest,
Create an object, larger than your card, that can serve as background, e.g. a locked field with backgroundpatters or an image object. Group the image object and give it scrollbars. Set the margins of the group to 0. Create a new field inside the group.
Code: Select all
create fld "New Field" in grp "Big Background"
Now use a repeat loop inside a mouseDown handler. Change the hscroll and vscroll of the group as necessary while looping. For example:
Code: Select all
if the right of the target > the width of grp "Big Background" then set the hscroll of grp "Big Background" to (the hscroll of grp "Big Background" + 2)
Give it a try and come back with your first script.
Best,
Mark
background and "click at -----drag from"
Posted: Tue Sep 08, 2009 8:47 pm
by undelouest
Thanks for your reply
My purpose is to make a genealogical tree (descendant) ; I made one using several cards when the row of descendants is to long ; it works but is a little tricky. so I wanted to use a single card with a moving background. But my problem is that the drag script don't works well when the width of the bg exceed 4000 pixels - on my iMac with a 24 f screen.
If you want I can mail a little stack test (12 ko)
Posted: Tue Sep 08, 2009 9:14 pm
by Mark
Dear undelouest,
You will have to find a different way to do this. E.g. draw the tree objects directly on the card instead of the group and use scrollbar objects to change their positions.
Best,
Mark