FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Text paste event
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Text paste event
Posted: 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

Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Text paste event
Posted: Tue May 30, 2023 01: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
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Text paste event
Posted: Tue May 30, 2023 01: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Text paste event
Posted: Tue May 30, 2023 01: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
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Text paste event
Posted: Tue May 30, 2023 02:14 PM
Rao, you're right! If I use TGet, then everything is fine. But there is a problem under TEdit :cry:
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Text paste event
Posted: Tue May 30, 2023 02: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 (fw): Select all Collapse
Eval( ::bChange, nKey, nFlags, Self )
If the return value is logical and false, then the key is rejected.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Text paste event
Posted: Tue May 30, 2023 02:38 PM

Thanks, I'll try.

Continue the discussion