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?
Image no longer scrolls
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Image no longer scrolls
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
HyperActive Software | http://www.hyperactivesw.com
Re: Image no longer scrolls
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.jacque wrote:This is the expected behavior if the lockLoc of the image is true. Is it locked?
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)
Re: Image no longer scrolls
I have found a workaround, but it is probably the ugliest workaround I have ever done.
I feel dirty just thinking about it.
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
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Image no longer scrolls
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.
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
HyperActive Software | http://www.hyperactivesw.com