Page 1 of 2
Graphic in scrolling list field disappears
Posted: Sun Aug 23, 2015 5:16 pm
by mrcoollion
Hope someone can help me with this.
I have the problem that if I put a graphic in place of a character in a scrolling list field as soon as the first part of that line scrolls out of the field window the graphic disappears. This happens because i scroll from top to bottom and that the graphic placeholder is the bottom left corner. As soon as the line that holds the graphic scrolls out of field window the graphic disappears (which is logical to me).
I would like the placeholder to be the top left corner of the graphic so when I scroll down the graphic stays in view as long as possible.
Is this possible?
I would also like to know how to find out if a character has an imagesource set.
I do have a demo stack but cannot upload it (message I get is: The extension livecode is not allowed.)
Instead see the screenshot of the stack attached.
Any help would be appreciated.
Kind regards,
Paul (MrCoolLion)
Re: Graphic in scrolling list field disappears
Posted: Sun Aug 23, 2015 8:55 pm
by dunbarx
Hi.
Are you using the "imageSource" as a substtiute for the character in the line in question.
Craig Newman
Re: Graphic in scrolling list field disappears
Posted: Sun Aug 23, 2015 9:45 pm
by Klaus
Hi Paul,
mrcoollion wrote:...I do have a demo stack but cannot upload it (message I get is: The extension livecode is not allowed.)
you need to ZIP the stack first, then you can upload it here.
Best
Klaus
Re: Graphic in scrolling list field disappears
Posted: Sun Aug 23, 2015 10:33 pm
by mrcoollion
So here is my test stack.
Kind regards,
Paul
Re: Graphic in scrolling list field disappears
Posted: Mon Aug 24, 2015 4:39 pm
by mrcoollion
dunbarx wrote:Hi.
Are you using the "imageSource" as a substtiute for the character in the line in question.
Craig Newman
Yes I am ... see test stack
Re: Graphic in scrolling list field disappears
Posted: Mon Aug 24, 2015 4:47 pm
by Klaus
Hi Paul,
"imagesource" actually REPLACES one character in a field, but behaves
as a "simple" character furthermore, means it goes with the text like
any other character in the field would do. Know what I mean?
To check if a character has an imagesource, you do:
Code: Select all
...
put the imagesource of char 1 of fld "text with images" into tIS
if tIS = EMPTY then
## NO imagesource, do what you need to do here...
end if
...
Best
Klaus
Re: Graphic in scrolling list field disappears
Posted: Mon Aug 24, 2015 5:08 pm
by Klaus
Hi Paul,
just tested your stack and I think this is (more or less) correct behavior!
You "forced" a textheigtht of 13 px for the field and this way, images in imagesources
that are higher than 13 px will actually get "overlayed" by the other text in the field.
Very clever in fact!
Unfortunately these images will disappear when scrolling to a certain amout in the field
as we can experience in your stack. Not sure why, sorry.
I don't think you can do this with a field and imagesource satisfyingly at all.
I would probably do this with a DATAGRID of type FORM, but that is definitively
not beginners stuf.
Best
Klaus
Re: Graphic in scrolling list field disappears
Posted: Mon Aug 24, 2015 5:54 pm
by mrcoollion
Klaus wrote:Hi Paul,
"imagesource" actually REPLACES one character in a field, but behaves
as a "simple" character furthermore, means it goes with the text like
any other character in the field would do. Know what I mean?
To check if a character has an imagesource, you do:
Code: Select all
...
put the imagesource of char 1 of fld "text with images" into tIS
if tIS = EMPTY then
## NO imagesource, do what you need to do here...
end if
...
Best
Klaus
I found out the reason why my statement
Code: Select all
put the imageSource of char 1 of line LineSelectNBR of field "ShowChat" into tempvar01
did not work. Reason: I used selectedline instead of hilitedLine of field "ShowChat"
Code: Select all
put the hilitedLine of field "ShowChat" into LineSelectNBR // This works as expected :-)
//put the selectedline of field "ShowChat" into LineSelectNBR // Gives the line and field 1 as result (strange.... :-0 )
Now I still need to fix the scrolling and disappearing of the graphic issue.
Re: Graphic in scrolling list field disappears
Posted: Mon Aug 24, 2015 6:14 pm
by Klaus
Hi Paul,
do yourself a favour and look up everything in the dictionary!
"the selectedline" is NOT a property of a specific field, but a "global" one,
that's why it returns also the FIELD description!
Now I still need to fix the scrolling and disappearing of the graphic issue.
As I already wrote, this is not possible with a field, check the dictionary entry for "imagesource".
Best
Klaus
Re: Graphic in scrolling list field disappears
Posted: Mon Aug 24, 2015 6:19 pm
by mrcoollion
Klaus wrote:Hi Paul,
do yourself a favour and look up everything in the dictionary!
"the selectedline" is NOT a property of a specific field, but a "global" one,
that's why it returns also the FIELD description!
Now I still need to fix the scrolling and disappearing of the graphic issue.
As I already wrote, this is not possible with a field, check the dictionary entry for "imagesource".
Best
Klaus
Thank you very much for your support Klaus..
Regards,
Paul
Re: Graphic in scrolling list field disappears
Posted: Mon Aug 24, 2015 6:21 pm
by Klaus
It's all in a day's work of a Livecode forum guru!

Re: Graphic in scrolling list field disappears
Posted: Mon Aug 24, 2015 7:50 pm
by jacque
I didn't look at your stack, but it might work if you group the field and scroll the group.
Re: Graphic in scrolling list field disappears
Posted: Mon Aug 24, 2015 7:54 pm
by mrcoollion
jacque wrote:I didn't look at your stack, but it might work if you group the field and scroll the group.
I will give it a try.
Thx

Re: Graphic in scrolling list field disappears
Posted: Mon Aug 24, 2015 9:19 pm
by mrcoollion
mrcoollion wrote:jacque wrote:I didn't look at your stack, but it might work if you group the field and scroll the group.
I will give it a try.
Thx

Gave it a try.. no luck.. same behavior. Was worth the try though ... thx ...

Re: Graphic in scrolling list field disappears
Posted: Tue Aug 25, 2015 8:41 pm
by Klaus
Hi Paul
what exactly did you try?
This is a nifty trick and surely works, if applied correctly
Best
Klaus