Image Library

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
dalkin
Posts: 183
Joined: Wed Jul 04, 2007 2:32 am
Contact:

Image Library

Post by dalkin » Mon Jul 09, 2007 9:28 am

Is there a way of making an image library of thumbnails available in a standalone app that can be dragged from one field with a horizontal scrollbar to another field and they then resize to their correct proportion?

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Mon Jul 09, 2007 12:33 pm

"Field" in RunRev normally means a text field, and if that's the case, you probably will have troubles doing what you want. You can however set a group to have a scrollbar, in which case it is only mildly annoying to do.

You should make a group of all your images. Then you allow it to be dragged by using the "grab me" command, in a "mousedown" handler (or a repeat loop which set's the position relative to the mouse).

Then you need to check if your group was dragged onto the right target, for example by checking if the location of the group you dragged "is within" your target.

To resize, you are best serviced by "set"ing the "rectangle", or by using "set" to change the "width", "height" and "location" one after another (you can also "put" each of these properties, to calculate settings relative to another control).

To speed stuff up, try to "lock screen" at the start of your handler, or just before the stuff you need to be faster.

To make objects part of a group, you need to do some fiddling, but most successful is normally to use "copy" with the additon of "to group". Alternatively, you could recreate a group completely from scratch.

(everything in quotes can and should be looked up in the dictionary, for greater details than I want to give here.)
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply