Will place the stack tonight.. Help is appreciated.Klaus wrote:Hi Paul
what exactly did you try?
This is a nifty trick and surely works, if applied correctly
Best
Klaus
Graphic in scrolling list field disappears
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 720
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: Graphic in scrolling list field disappears
-
- Posts: 720
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: Graphic in scrolling list field disappears
Hi Klaus I tried to follow the lesson How to scrol a card that is taller or wider than the window.Klaus wrote:Hi Paul
what exactly did you try?
This is a nifty trick and surely works, if applied correctly
Best
Klaus
http://lessons.runrev.com/m/4071/l/1178 ... the-window
See the attached Stack..
Regards,
Paul
- Attachments
-
- TestImageInList2 - group.zip
- (10.58 KiB) Downloaded 189 times
Re: Graphic in scrolling list field disappears
The reason the img dissapears is because the character that it is linked to leaves the viewport, so the engine stops rendering it.
The same happens with groups, for the same reason.
If you want to get around this problem, you can us a cheater method.
Use a separate scroll bar, mask off your viewing area with other controls. (already done in the case of your stack)
set the height of your field to the formattedheight of your field so that all contents are rendered and visible.
set the endvalue of scrollbar "myscrollbar" to the height of field "showchat" - (however tall the viewport is)
then, since you have the field positioned at the top of the card, its easy, just set the top of the field to -(the thumbposition of scrollbar "myscrollbar")
You want a negative value because you're actually moving the top of the field off screen.
I just did a very quick proof of concept. There are still issues to be worked around. I have 1 button set (the one that inserts the graphic) so that it will resize the field. Haven't done that with the other.
You'll want to always size the field when changing the contents.
If the formattedheight of the field is less than or = to the height of your viewport you'll want to leave the field sized at viewport height and disable the scrollbar (otherwise weird things happen)
You'll want to make sure you update the scrollbarend every time the contents change also.
Here is a link to your stack, adjusted, but with the other minor issues ignored. If you need help getting it to function better let me know.
https://dl.dropboxusercontent.com/u/119 ... 1.livecode
The code isn't clean, but it works. It'll still show the "quirks" I mentioned above, and if you don't fill the field enough and move the scrollbar, you can lose the thumb. As long as you keep it updated based on field updates, and only show it when theres enough text in the field, it works dandy.
The next concern i'd worry about (if it were me) would be limiting the length of the field. You'll probably want a way to drop the oldest messages off the end with a "load more messages.." option of some type.
The same happens with groups, for the same reason.
If you want to get around this problem, you can us a cheater method.
Use a separate scroll bar, mask off your viewing area with other controls. (already done in the case of your stack)
set the height of your field to the formattedheight of your field so that all contents are rendered and visible.
set the endvalue of scrollbar "myscrollbar" to the height of field "showchat" - (however tall the viewport is)
then, since you have the field positioned at the top of the card, its easy, just set the top of the field to -(the thumbposition of scrollbar "myscrollbar")
You want a negative value because you're actually moving the top of the field off screen.
I just did a very quick proof of concept. There are still issues to be worked around. I have 1 button set (the one that inserts the graphic) so that it will resize the field. Haven't done that with the other.
You'll want to always size the field when changing the contents.
If the formattedheight of the field is less than or = to the height of your viewport you'll want to leave the field sized at viewport height and disable the scrollbar (otherwise weird things happen)
You'll want to make sure you update the scrollbarend every time the contents change also.
Here is a link to your stack, adjusted, but with the other minor issues ignored. If you need help getting it to function better let me know.
https://dl.dropboxusercontent.com/u/119 ... 1.livecode
The code isn't clean, but it works. It'll still show the "quirks" I mentioned above, and if you don't fill the field enough and move the scrollbar, you can lose the thumb. As long as you keep it updated based on field updates, and only show it when theres enough text in the field, it works dandy.
The next concern i'd worry about (if it were me) would be limiting the length of the field. You'll probably want a way to drop the oldest messages off the end with a "load more messages.." option of some type.
-
- Posts: 720
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: Graphic in scrolling list field disappears
Thank you Sturgis. I will experiment with this.sturgis wrote:The reason the img dissapears is because the character that it is linked to leaves the viewport, so the engine stops rendering it.
The same happens with groups, for the same reason.
If you want to get around this problem, you can us a cheater method.
Use a separate scroll bar, mask off your viewing area with other controls. (already done in the case of your stack)
set the height of your field to the formattedheight of your field so that all contents are rendered and visible.
set the endvalue of scrollbar "myscrollbar" to the height of field "showchat" - (however tall the viewport is)
then, since you have the field positioned at the top of the card, its easy, just set the top of the field to -(the thumbposition of scrollbar "myscrollbar")
You want a negative value because you're actually moving the top of the field off screen.
I just did a very quick proof of concept. There are still issues to be worked around. I have 1 button set (the one that inserts the graphic) so that it will resize the field. Haven't done that with the other.
You'll want to always size the field when changing the contents.
If the formattedheight of the field is less than or = to the height of your viewport you'll want to leave the field sized at viewport height and disable the scrollbar (otherwise weird things happen)
You'll want to make sure you update the scrollbarend every time the contents change also.
Here is a link to your stack, adjusted, but with the other minor issues ignored. If you need help getting it to function better let me know.
https://dl.dropboxusercontent.com/u/119 ... 1.livecode
The code isn't clean, but it works. It'll still show the "quirks" I mentioned above, and if you don't fill the field enough and move the scrollbar, you can lose the thumb. As long as you keep it updated based on field updates, and only show it when theres enough text in the field, it works dandy.
The next concern i'd worry about (if it were me) would be limiting the length of the field. You'll probably want a way to drop the oldest messages off the end with a "load more messages.." option of some type.
-
- Posts: 720
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: Graphic in scrolling list field disappears
For redrawing the correct image while scrolling I need to know the first visible line number in the scrolling List field. I have been searching for an answer but no luck yet. Any suggestions?mrcoollion wrote:Thank you Sturgis. I will experiment with this.sturgis wrote:The reason the img dissapears is because the character that it is linked to leaves the viewport, so the engine stops rendering it.
The same happens with groups, for the same reason.
If you want to get around this problem, you can us a cheater method.
Use a separate scroll bar, mask off your viewing area with other controls. (already done in the case of your stack)
set the height of your field to the formattedheight of your field so that all contents are rendered and visible.
set the endvalue of scrollbar "myscrollbar" to the height of field "showchat" - (however tall the viewport is)
then, since you have the field positioned at the top of the card, its easy, just set the top of the field to -(the thumbposition of scrollbar "myscrollbar")
You want a negative value because you're actually moving the top of the field off screen.
I just did a very quick proof of concept. There are still issues to be worked around. I have 1 button set (the one that inserts the graphic) so that it will resize the field. Haven't done that with the other.
You'll want to always size the field when changing the contents.
If the formattedheight of the field is less than or = to the height of your viewport you'll want to leave the field sized at viewport height and disable the scrollbar (otherwise weird things happen)
You'll want to make sure you update the scrollbarend every time the contents change also.
Here is a link to your stack, adjusted, but with the other minor issues ignored. If you need help getting it to function better let me know.
https://dl.dropboxusercontent.com/u/119 ... 1.livecode
The code isn't clean, but it works. It'll still show the "quirks" I mentioned above, and if you don't fill the field enough and move the scrollbar, you can lose the thumb. As long as you keep it updated based on field updates, and only show it when theres enough text in the field, it works dandy.
The next concern i'd worry about (if it were me) would be limiting the length of the field. You'll probably want a way to drop the oldest messages off the end with a "load more messages.." option of some type.
-
- Posts: 720
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: Graphic in scrolling list field disappears
I could not find a reliable way to find out the top and bottom line number in view while scrolling for redrawing the images to save memory. I now create a new image for each chat and that works fine with scrolling.
It would have been nice if it were possible to have a field property in which I can set , if a character with an imageSource is out of view it takes in account the images size and starts showing the image parts that are in view. This would also be nice if the imagesource is a picture/photo. Maybe a possible feature request?
I want to thank Klaus and Sturgis and for their support and time spend as well as all other who took the time to think about this.
Kind regards,
Paul (MrCoolLion)
It would have been nice if it were possible to have a field property in which I can set , if a character with an imageSource is out of view it takes in account the images size and starts showing the image parts that are in view. This would also be nice if the imagesource is a picture/photo. Maybe a possible feature request?
I want to thank Klaus and Sturgis and for their support and time spend as well as all other who took the time to think about this.
Kind regards,
Paul (MrCoolLion)
Re: Graphic in scrolling list field disappears
Hi Pauk,
please do not quote the complete thread in your next postings, thanks!
Best
Klaus
please do not quote the complete thread in your next postings, thanks!
Best
Klaus
-
- Posts: 720
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: Graphic in scrolling list field disappears
Ok .. sorry did not mean to ...Klaus wrote:Hi Pauk,
please do not quote the complete thread in your next postings, thanks!
Best
Klaus