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 » Tue Nov 03, 2015 1:28 pm

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 215 times

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » Tue Nov 03, 2015 1:47 pm

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 » Tue Nov 03, 2015 1:59 pm

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: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » Tue Nov 03, 2015 2:23 pm

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 » Wed Nov 04, 2015 6:12 am

Hi,

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


Thanks
Samjith

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » Wed Nov 04, 2015 2:19 pm

Even dwarfs started small! :D

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10100
Joined: Fri Feb 19, 2010 10:17 am

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

Post by richmond62 » Wed Nov 04, 2015 4:02 pm

Try this:
modifiedScript.png
Line 9

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10100
Joined: Fri Feb 19, 2010 10:17 am

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

Post by richmond62 » Wed Nov 04, 2015 5:34 pm

Here's something to play with:
clickClack.png
Attachments
Click Clack.zip
Here's the stack.
(2.69 KiB) Downloaded 226 times

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » Wed Nov 04, 2015 5:51 pm

Nice, Richmond, very nice, but we already solved his problem yesterday! :D

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10100
Joined: Fri Feb 19, 2010 10:17 am

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

Post by richmond62 » Wed Nov 04, 2015 7:48 pm

Yer: yesterday was my day off.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » Wed Nov 04, 2015 7:56 pm

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 » Fri Nov 06, 2015 7:17 am

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