Text Field - Right Mouse Click?

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
cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Text Field - Right Mouse Click?

Post by cmhjon » Fri Apr 09, 2021 4:03 pm

Hi all,

In my compiled app for Windows, right-clicking within a text field does not display the usual Windows context menu that includes copy/paste functions. Is there a way to get the contextual menu to display?

Thank you,
Jon :)

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Text Field - Right Mouse Click?

Post by Klaus » Fri Apr 09, 2021 4:20 pm

Hi Jon,

yes, "do it yourself"! :D
Means that you need to create an appropriate "popup" menu button and let it pop up:

Code: Select all

on mousedown tMouse
  if tMouse = 3 then
    popup btn "you text menu here..."
 end if
end mousedown
Best

Klaus

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: Text Field - Right Mouse Click?

Post by cmhjon » Mon Apr 12, 2021 2:04 pm

Awwww man!

But ok. So, does this mean that I must also code what happens when someone right clicks a text field and chooses, "Paste"?

Thank you,
Jon

AxWald
Posts: 578
Joined: Thu Mar 06, 2014 2:57 pm

Re: Text Field - Right Mouse Click?

Post by AxWald » Mon Apr 12, 2021 2:38 pm

Hi,
cmhjon wrote:
Mon Apr 12, 2021 2:04 pm
does this mean that I must also code what happens when someone right clicks a text field and chooses, "Paste"?
Yes.
Right-Click menus have not been regarded important enough to be implemented using the OS' system calls. So you have to code them yourself - have fun doing it in a way that doesn't look "self made" & clumsy ;-)

You may try to embed a browser window as field, so you can use JavaScript & HTML whenever LC script or LCs formatting capabilities are lacking - does the browser engine support standard OS context menus?
(And no, I cannot tell you why the mothership has taken this way instead of improving their very own product ...)

Have fun!
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”