FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Just a Question
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM

Just a Question

Posted: Tue Dec 06, 2011 08:35 AM
Is it possible to distinguish if I enter in a GET (bgotfocus) VK_TAB from mouse click?
A lot of programs I use have this behavior:

If I enter in a GET using VK_TAB all get content is selected
If I enter in a GET using Mouse:
- If I click before the last character cursor is positioned where I click
- If I click after the last character cursor is positioned ast last character +1 even if I click at the end of the get

King regards

Marco
Marco Boschi
info@marcoboschi.it
Posts: 55
Joined: Fri Jul 08, 2011 06:43 AM

Re: Just a Question

Posted: Tue Dec 06, 2011 06:43 PM

Marco ,

You could try with :

@ 3, 6 GET oGet OF oDlg WHEN (Tracelog(oDlg:nLastKey , GetKeyState( VK_SHIFT )),.T.)
// OR oGet:bGotFocus := {||Tracelog(oDlg:nLastKey , GetKeyState( VK_SHIFT ))}

To see the diferences with TAB , Shift TAB , Enter , Mouse activity , ......

Frank

Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM

Re: Just a Question

Posted: Tue Dec 06, 2011 07:15 PM

I modified tget.prg so that it would do a selectall() under the conditions you described.
If get has a "K" in the picture like "@K" and you pressed tab, arrow, or enter in order to get into control, then it will do selectall(). Mouse into get and it acts normally.

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: Just a Question

Posted: Tue Dec 06, 2011 10:28 PM
MarcoBoschi wrote:Is it possible to distinguish if I enter in a GET (bgotfocus) VK_TAB from mouse click?


Yes, you can check GetKeyState( VK_LBUTTON ).

EMG
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM

Re: Just a Question

Posted: Fri Dec 09, 2011 10:07 AM

Frank and Enrico,
many thanks

marco

Marco Boschi
info@marcoboschi.it

Continue the discussion