Problem scrolling a group of objects that may be moved
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Problem scrolling a group of objects that may be moved
The lesson : http://lessons.livecode.com/m/4071/l/11 ... the-window describes how a group may be made to scroll to display contents that are located outside the location of the group. I have used the principles described in the lesson to create a stack to display a number of thumbnail images.
My stack will process a folder of images and display a thumbnail of each image inside a group on the card. The group of images is resized when the card is resized and images may be dragged and dropped within the group. When the card is enlarged to fill the height of the screen it is possible to drag an image to the bottom of the group and even partly off the group. If the card is reduced in size I expected that the vertical scroll bar would appear as soon as an image is partially obscured but it does not appear at that point. It does get shown at some point as the size of the group is reduce which is not related to the locations of the images.
It is difficult to confirm what triggers the display of the scroll bar but it could be the size of the group when the stack was last saved and loaded ( a save in the IDE does not modify the reveal point).
Is the above expected or is it a bug?
I have attached my stack if you care to have a look. To use first put five jpegs in a folder then run the stack and press the button "action". The images will be displayed all over the card and not just within the group. Next resize the card making it larger and drag the images so that all are in view. Drag at least one down to the bottom of the card and then reduce the size of the card. On my computer the scroll bar does not appear as the image is hidden.
My stack will process a folder of images and display a thumbnail of each image inside a group on the card. The group of images is resized when the card is resized and images may be dragged and dropped within the group. When the card is enlarged to fill the height of the screen it is possible to drag an image to the bottom of the group and even partly off the group. If the card is reduced in size I expected that the vertical scroll bar would appear as soon as an image is partially obscured but it does not appear at that point. It does get shown at some point as the size of the group is reduce which is not related to the locations of the images.
It is difficult to confirm what triggers the display of the scroll bar but it could be the size of the group when the stack was last saved and loaded ( a save in the IDE does not modify the reveal point).
Is the above expected or is it a bug?
I have attached my stack if you care to have a look. To use first put five jpegs in a folder then run the stack and press the button "action". The images will be displayed all over the card and not just within the group. Next resize the card making it larger and drag the images so that all are in view. Drag at least one down to the bottom of the card and then reduce the size of the card. On my computer the scroll bar does not appear as the image is hidden.
- Attachments
-
- CustomControlBasedImageSorterv01.livecode.zip
- (5.84 KiB) Downloaded 162 times
best wishes
Skids
Skids
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Problem scrolling a group of objects that may be moved
On further review it seems that the scroll bar appears at the lowest bottom point of the images when they were added and this value is not being updated when an image is dragged and dropped.
best wishes
Skids
Skids
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Problem scrolling a group of objects that may be moved
At the risk of being accused over oversimplifying things . . .
It is fairly straightforward to trigger visibility of scrollbars:
-
-
It is fairly straightforward to trigger visibility of scrollbars:
Code: Select all
on mouseUp
set the hScrollbar of group "APES" to true
end mouseUp
Re: Problem scrolling a group of objects that may be moved
Hi Simon,
looks like there is something wrong with group scrollbars in general! :-/
I modified your RESIZESTACK handler, but when resizing the window the scrollbars appear correctly but the SCROLL does not change correctly.
Looks like the "threshold for scrolling" (?) is somewhere in the MIDDLE of the groups inside of the "PhotoViewer" "mother"group!? Know what I mean?
Best
Klaus
looks like there is something wrong with group scrollbars in general! :-/
I modified your RESIZESTACK handler, but when resizing the window the scrollbars appear correctly but the SCROLL does not change correctly.
Code: Select all
on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
## Use the RECT to reduce typing :-)
put the rect of this cd into tRect
subtract 50 from item 4 of tRect
set the rect of grp "PhotoViewer" to tRect
set the right of button "Action" of me to (the right of me -20)
set the bottom of button "Action" of me to (the bottom of me -20)
## Trick to show scrollbars only when neccessary!
set the vScrollbar of grp "PhotoViewer" to (the height of grp "PhotoViewer" <= the formattedheight of grp "PhotoViewer" )
set the hScrollbar of grp "PhotoViewer" to (the width of grp "PhotoViewer" <= the formattedwidth of grp "PhotoViewer" )
end resizeStack
Best
Klaus
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Problem scrolling a group of objects that may be moved
I would "update" my scrollbars by turning them off and then on again.
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Problem scrolling a group of objects that may be moved
Hi,
Thanks for your replies and the graphic. Its a bug - see https://quality.livecode.com/show_bug.cgi?id=21359
and also 13806 and 13807. Simply - moving an object within a group does not update the trigger point for displaying the scroll bars (scoll bars auto hide on a mac and perhaps other platforms). The work around is to use the line to update the groups knowledge of where its children are. It seems its been a bug since version 6 so is probably a feature and should be documented.
Thanks for your replies and the graphic. Its a bug - see https://quality.livecode.com/show_bug.cgi?id=21359
and also 13806 and 13807. Simply - moving an object within a group does not update the trigger point for displaying the scroll bars (scoll bars auto hide on a mac and perhaps other platforms). The work around is to use the line
Code: Select all
set the clipsToRect of group "Photoviewer" to true
best wishes
Skids
Skids