Image no longer scrolls

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Image no longer scrolls

Post by magice » Fri Mar 20, 2015 2:55 am

I have a stack that I built several years ago in RunRev 3.0. I have been updating the app on LiveCode 7.1. I have just noticed a problem that began with the transition. I have an image. the image is grouped so that when it's filename is set to a larger image than the group it will scroll with the groups scrollbars. Since reworking the stack in 7.1 setting the filename clips the image instead of creating the larger scrolling image I am used to. Is there a property that needs to be changed from the older version?

EDIT: After some experimentation I have concluded that for some reason, when setting the fileName of an image in this situation, it no longer inherits the dimensions of the source file (or at least the scrollbars don't), and instead maintains it's original size. Is this a bug or a change in the way LC works?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7229
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Image no longer scrolls

Post by jacque » Fri Mar 20, 2015 5:35 pm

This is the expected behavior if the lockLoc of the image is true. Is it locked?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Image no longer scrolls

Post by magice » Fri Mar 20, 2015 6:12 pm

jacque wrote:This is the expected behavior if the lockLoc of the image is true. Is it locked?
The group is locked, but that is necessary otherwise when you set the filename the image takes over the whole stack rather than just activate the scrollbars. Here is what I have just done to test the problem. I have an old laptop that still has RunRev 3.0 on it. On it, i created a new mainstack. I dragged an image from the toolbox. I grouped the image. I set the vScrollbar and hScrollbar of the group to true. I clicked "lock size and position" for the group in the property manager. Then I set the filename of the image to a large file. The group stays the same size and the scrollbarrs allow me to move around within the full extent of the image. (That is the behavior I want) Next I repeated the procedure in LiveCode 7.0.1 and 7.0.3. In both cases the scrollbars become active, but only allow for scrolling a very short amount. Most of the image is not available.

EDIT: I have since tried the LC versions with the group loc unlocked. It does not fix the problem, and causes another. Once the stack is saved and reloaded, the group is the same size as the image (bigger than the stack)

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Image no longer scrolls

Post by magice » Fri Mar 20, 2015 7:40 pm

I have found a workaround, but it is probably the ugliest workaround I have ever done.

Code: Select all

 answer file "Choose an image"
   put it into tFile
   lock screen
   import paint from file tFile
   set the name of the last img to "temp"
   set the height of img "iOrig" to the height of img "temp"
   set the width of img "iOrig" to the width of img "temp"
   delete img "temp"
   set the filename of img "iOrig" to tFile
   unlock screen
I feel dirty just thinking about it.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7229
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Image no longer scrolls

Post by jacque » Sat Mar 21, 2015 2:04 am

How about:

Set the filename of the image to the new file path
set the width and height of the image to the formattedwidth/height of the image

In other words, just force the size after it's been imported.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”