oGet:SetPos() and date

oGet:SetPos() and date

Postby Detlef Hoefner » Wed Jun 14, 2006 12:35 pm

Hi all,

i have aproblem to set the cursor of a get to the very first position.
I tried the following
Code: Select all  Expand view
oSearch:bGotFocus := { || oSearch:PostMsg( WM_KEYDOWN, VK_HOME, 0 ), SysRefresh() }
oSearch:bGotFocus := { || oSearch:nPos := 1, SysRefresh() }
oSearch:bGotFocus := { || oSearch:SetPos( 1 ) }


All three methods work ok if the get variable is of type character.
But neither of these methods work if the get variable contains a date.

I put a small selfcontainted sample here
http://www.d-hoefner.de/files/test.zip

May be someone knows a workaround for this?

Thanks and regards,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby tnhoe » Wed Jun 14, 2006 1:53 pm

this might help :-

oSearch:bGotFocus := { || oSearch:selectall(), oSearch:nPos:= 1 }
Regards

Hoe, email: easywin3@yahoo.com
User avatar
tnhoe
 
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia

Postby Detlef Hoefner » Wed Jun 14, 2006 2:01 pm

tnhoe wrote:this might help :-

oSearch:bGotFocus := { || oSearch:selectall(), oSearch:nPos:= 1 }


Hoe,

many thanks for your hint.
Unfortunatelly it doesn' t work.

If i click into the middle of a get with a date variable, the cursor remains at the position where i clicked.
With character gets its working ok.

Thanks for your time, Hoe.
Regards,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby Enrico Maria Giordano » Wed Jun 14, 2006 2:04 pm

If you will build a reduced and self-contained sample of the problem then I promise to experiment with it a little. :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8600
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Detlef Hoefner » Wed Jun 14, 2006 2:14 pm

Enrico,

I already put a sample at

http://www.d-hoefner.de/files/test.zip

thanks for jumping in.

Regards,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby Enrico Maria Giordano » Wed Jun 14, 2006 2:48 pm

Try this:

Code: Select all  Expand view
oSearch:bGotFocus := { || oSearch:PostMsg( WM_KEYDOWN, VK_HOME ) }


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8600
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Detlef Hoefner » Wed Jun 14, 2006 3:41 pm

EnricoMaria wrote:Try this:

Code: Select all  Expand view
oSearch:bGotFocus := { || oSearch:PostMsg( WM_KEYDOWN, VK_HOME ) }


EMG

Enrico,

as usual, your advice is a good one.
It' s working as expected now :D .

Thanks a lot for your time.
Regards,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

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