Just a Question

Just a Question

Postby MarcoBoschi » Tue Dec 06, 2011 8: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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Just a Question

Postby Demont Brecht » Tue Dec 06, 2011 6: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
Demont Brecht
 
Posts: 55
Joined: Fri Jul 08, 2011 6:43 am

Re: Just a Question

Postby Gale FORd » Tue Dec 06, 2011 7: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.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: Just a Question

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Just a Question

Postby MarcoBoschi » Fri Dec 09, 2011 10:07 am

Frank and Enrico,
many thanks

marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 95 guests