Text paste event

Text paste event

Postby Natter » Tue May 30, 2023 12:44 pm

Hi,

How can I handle the text paste event in TGET/TEDIT from the clipboard ? In this case, oGet:change does not work
Natter
 
Posts: 1120
Joined: Mon May 14, 2007 9:49 am


Re: Text paste event

Postby Natter » Tue May 30, 2023 1:30 pm

I didn't understand what this example has to do with it. :(
I need to catch the moment when the TGET/TEDIT control changes when data is entered into it from the clipboard or programmatically
Natter
 
Posts: 1120
Joined: Mon May 14, 2007 9:49 am

Re: Text paste event

Postby karinha » Tue May 30, 2023 1:46 pm

Sorry, I don't remember having any examples of this. Do you have some code to post, it makes it easier.

Thanks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Text paste event

Postby nageswaragunupudi » Tue May 30, 2023 1:48 pm

For me oGet:bChange is working in TGet class when any text is pasted into the Get.
(But for me the problem is bChange is evaluated twice in case of Get)

Can you please check again?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Text paste event

Postby Natter » Tue May 30, 2023 2:14 pm

Rao, you're right! If I use TGet, then everything is fine. But there is a problem under TEdit :cry:
Natter
 
Posts: 1120
Joined: Mon May 14, 2007 9:49 am

Re: Text paste event

Postby nageswaragunupudi » Tue May 30, 2023 2:24 pm

With edit control, try pasting by pressing Ctrl-V.
In my test here, bChange is executed, immediately after pressing the key and before actually pasting.

Note: In case of EDIT control, bChange is executed when the user presses any key
Code: Select all  Expand view

Eval( ::bChange, nKey, nFlags, Self )
 

If the return value is logical and false, then the key is rejected.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Text paste event

Postby Natter » Tue May 30, 2023 2:38 pm

Thanks, I'll try.
Natter
 
Posts: 1120
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 83 guests