textChanged is not invoked after cutting text

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

textChanged is not invoked after cutting text

Post by kaveh1000 »

Working on Mac with latest Community version of LC. Cutting text via menu or keyboard shortcut does not invoke textChanged handler. (But pasting does.) Please see attached minimal example.
Attachments
textChanged.zip
(928 Bytes) Downloaded 620 times
Kaveh
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: textChanged is not invoked after cutting text

Post by jmburnod »

Hi,
Same result fro me (lC indy 9.0.1)
It works with a simple "cut" message sent by a btn

Code: Select all

on mouseup
   cut
end mouseup
I wonder if that is an IDE behavior
What happens in standalone ?
https://alternatic.ch
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: textChanged is not invoked after cutting text

Post by bogs »

Tested using ctrl + x on Win7 with Lc 9.0.2, and it doesn't count as a text changed event there, either. It *does* however on 'nix using Lc 6.x, so I'm guessing it is a bug?
One...
One...
twooo...
twooo...
threeeeee! (Count the smilies)
threeeeee! (Count the smilies)
Image
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: textChanged is not invoked after cutting text

Post by richmond62 »

Hmm . . .
-
TextCH.png
Attachments
Text Change.livecode.zip
Here's the stack.
(1020 Bytes) Downloaded 612 times
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: textChanged is not invoked after cutting text

Post by richmond62 »

I wonder why this does NOT seem to work:

Code: Select all

if the clipBoardData is not empty then
      put "CRAP"
   end if
when I've CUT some text?
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: textChanged is not invoked after cutting text

Post by richmond62 »

Cut

does not behave in the same way as delete
because delete involves an insertion point in a field
while cut involves selectedText.
kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

Re: textChanged is not invoked after cutting text

Post by kaveh1000 »

Hi folks

Just an update that I have reported this and it has been confirmed as a regression bug:

https://quality.livecode.com/show_bug.cgi?id=21802

Thanks for your comments on this.

Kaveh
Kaveh
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: textChanged is not invoked after cutting text

Post by bogs »

Good job on that Kaveh, we got to keep Panos hammer swinging on those bugs Image
Image
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: textChanged is not invoked after cutting text

Post by jmburnod »

Hi All,
It seems that only concern IDE.
I played with an edit menu created with menu builder and it send a textchanged message on idE or standalone and shortcuts work as expected in standalone (LC 9.0.1 OSX 10.139
textChange001.zip
(1.93 KiB) Downloaded 615 times
Best
Jean-Marc
https://alternatic.ch
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: textChanged is not invoked after cutting text

Post by bogs »

That is good to know Jean-Marc, of course, from our perspective (devs) it is important to work everywhere eh :)
Image
kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

Re: textChanged is not invoked after cutting text

Post by kaveh1000 »

Hi Folks

So cutting text will invoked in Standalone but not in IDE due to a bug. Is there any handler I can use in the meantime to detect when text has been cut?

Regards
Kaveh
Kaveh
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: textChanged is not invoked after cutting text

Post by bogs »

I would suspect you could use the clipboard, since we are talking about cutting/copying operations. One way might be to throw the clipboard contents into a variable, then check if the text in the variable changes.
Image
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: textChanged is not invoked after cutting text

Post by jmburnod »

Hi All
Textchanged also doesn’t work when I put a letter by script into/after/before a field
Jean-Marc
https://alternatic.ch
Post Reply