right-click option

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
herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

right-click option

Post by herbwords » Fri Sep 30, 2011 2:38 pm

Hi to All,

Could someone tell me how you include right-clicking in a program?

Thanks,

Patrick

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: right-click option

Post by dunbarx » Fri Sep 30, 2011 2:52 pm

The mouseClick function does not discriminate. Perhaps try to use the "click" command? Check the dictionary and try a few experiments.

Craig Newman

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

Re: right-click option

Post by Klaus » Fri Sep 30, 2011 2:53 pm

Hi Patrick,

you need:
1. prepare a POPUP menu button
2. Add a "mosuedown" script to the objects where you want to popup the contextmenu:

Code: Select all

on mousedown tMouseButton
  if tMouseButton = 3 then ## right click!
    popup btn "you prepared button here" at the mouseloc
  else
   ## optional...
 end if
end mousedown
That's the mechanism, basically :)

Best

Klaus

herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

Re: right-click option

Post by herbwords » Fri Sep 30, 2011 8:16 pm

Hi Klaus,

Thanks. I got the general idea, but I'm not sure how to word what I want. Is there anything written already that would work on the text in a field (copy, delete, etc) like a typical windows right click?

Thanks,

Patrick

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: right-click option

Post by dunbarx » Fri Sep 30, 2011 10:43 pm

I see what you mean now. Maybe start more simply...

Make a button. Put this in its script:

Code: Select all

on mouseUp tButtonNumber
   if tButtonNumber = 1 then answer "You used the left button"
   else answer "You used the right button"
   
   -- or more elegantly:
   
   answer "You must have used button" && tButtonNumber
end mouseUp
Craig Newman

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: right-click option

Post by marksmithhfx » Sat Oct 01, 2011 3:07 am

herbwords wrote:Hi Klaus,

Thanks. I got the general idea, but I'm not sure how to word what I want. Is there anything written already that would work on the text in a field (copy, delete, etc) like a typical windows right click?

Thanks,

Patrick
Hi Patrick, I'll post a complete working example this weekend (I've been working on one that lets you add, edit, delete items from a list in a scrolling list field and then drag/drop to re-arrange the list). However, there is one problem. Currently, because of a bug (#7766) on the PC version it will only work on the Mac. That being said, the only impact of the bug is that after a "popup" function the drag/drop won't work until you move the mouse out of the field and then back in again (this has to do with the fact that LC stops sending mousemove messages to the field after a pop-up). So, in short what I am trying to say is most of the functionality you want will be in the program, you'll probably just have to remove or disable the drag/drop stuff until RR can fix the bug. Look for a repost of the Enhanced Scrolling List field later this weekend.

-- Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

Re: right-click option

Post by herbwords » Sat Oct 01, 2011 7:08 am

I've contacted a developer to see what it will cost to get it written. If anyone here wants to take a crack at it give me a price.
send to: herbwords@yahoo.com

Thanks All

Post Reply