Graphic in scrolling list field disappears

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

Graphic in scrolling list field disappears

Post 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)
Attachments
Demo_GraphInTextLine.jpg
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: Graphic in scrolling list field disappears

Post by dunbarx »

Hi.

Are you using the "imageSource" as a substtiute for the character in the line in question.

Craig Newman
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Graphic in scrolling list field disappears

Post 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
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

Re: Graphic in scrolling list field disappears

Post by mrcoollion »

So here is my test stack.

Kind regards,

Paul
Attachments
TestImageInList1.zip
(10.5 KiB) Downloaded 298 times
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

Re: Graphic in scrolling list field disappears

Post 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
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Graphic in scrolling list field disappears

Post 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
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Graphic in scrolling list field disappears

Post 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! :D

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
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

Re: Graphic in scrolling list field disappears

Post 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.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Graphic in scrolling list field disappears

Post 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
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

Re: Graphic in scrolling list field disappears

Post 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
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Graphic in scrolling list field disappears

Post by Klaus »

It's all in a day's work of a Livecode forum guru! :D
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Graphic in scrolling list field disappears

Post by jacque »

I didn't look at your stack, but it might work if you group the field and scroll the group.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

Re: Graphic in scrolling list field disappears

Post 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 :)
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

Re: Graphic in scrolling list field disappears

Post 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 ... :mrgreen:
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Graphic in scrolling list field disappears

Post by Klaus »

Hi Paul

what exactly did you try?
This is a nifty trick and surely works, if applied correctly :D


Best

Klaus
Post Reply