How to get the value of mouseclick over image in field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

How to get the value of mouseclick over image in field

Post by samjith »

Hi,

I want to know the mouseclicked is over the image (close icon) or not?, is there any command for this?

I am attaching the stack. My wish is to, when i click over the image in field then the line will delete.
Please find the attached zip, so you can easly understand, what i really want to do


Thanks
Samjith
Attachments
dropdown.zip
(6.93 KiB) Downloaded 274 times
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to get the value of mouseclick over image in field

Post by Klaus »

Hi samjith,

hmmm, it IS a bit difficult to do this (...when i CLICK over the image in field then the line will delete..."
in a field that has this script:

Code: Select all

on mousedown
   ...  
   hide me
   ...
end mousedown
Remember "click" means MOUSEUP" :D
So this is actually IMPOSSIBLE!

And your "turbulent" design makes me nervous actually 8)

But basically you want this:
User clicks the little icon in a line to delete that line, correct?

Then you should check if the character under the mouse has an "imagesource" property or not.
Add something like this:

Code: Select all

...
## We clicked an icon in the text
  if the imagesource of the clickcharchunk <> EMPTY then
      delete ...
   end if
...
Best

Klaus
samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

Re: How to get the value of mouseclick over image in field

Post by samjith »

Hi Klaus,

Ya worked fine,

Actually, I am stucked from morning at this point, really great.
How you know all these things? :)
Did you ate anything special to increase your mental strength? :D

Thanks
Samjith
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to get the value of mouseclick over image in field

Post by Klaus »

Namaste samjith,
samjith wrote:How you know all these things? :)
I am working with LC and its ancestors Runtime Revolution and Metacard since 1999
and I have a very very good memory.
samjith wrote:Did you ate anything special to increase your mental strength? :D
No, I was just born clever! :D


Best

Klaus
samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

Re: How to get the value of mouseclick over image in field

Post by samjith »

Hi,

hmmm. At that time, i was only age 9 :D


Thanks
Samjith
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to get the value of mouseclick over image in field

Post by Klaus »

Even dwarfs started small! :D
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: How to get the value of mouseclick over image in field

Post by richmond62 »

Try this:
modifiedScript.png
Line 9
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: How to get the value of mouseclick over image in field

Post by richmond62 »

Here's something to play with:
clickClack.png
Attachments
Click Clack.zip
Here's the stack.
(2.69 KiB) Downloaded 286 times
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to get the value of mouseclick over image in field

Post by Klaus »

Nice, Richmond, very nice, but we already solved his problem yesterday! :D
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: How to get the value of mouseclick over image in field

Post by richmond62 »

Yer: yesterday was my day off.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to get the value of mouseclick over image in field

Post by Klaus »

richmond62 wrote:Yer: yesterday was my day off.
OK, but it has been documented right here also! :D
samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

Re: How to get the value of mouseclick over image in field

Post by samjith »

Hi,

Thank you both of you, sucessfully completed the task, but have problem.

Please have a look
http://forums.livecode.com/viewtopic.php?f=7&t=25796

Thanks
Samjith
Post Reply