Background and "click at -----drag from"

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
undelouest
Posts: 9
Joined: Sun Oct 05, 2008 2:22 pm

Background and "click at -----drag from"

Post by undelouest » Fri Sep 04, 2009 7:30 pm

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 ?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Mon Sep 07, 2009 12:50 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

undelouest
Posts: 9
Joined: Sun Oct 05, 2008 2:22 pm

background and "click at -----drag from"

Post by undelouest » Tue Sep 08, 2009 8:47 pm

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)

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Sep 08, 2009 9:14 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply