Page 1 of 1

oGet:SetPos() and date

Posted: Wed Jun 14, 2006 12:35 pm
by Detlef Hoefner
Hi all,

i have aproblem to set the cursor of a get to the very first position.
I tried the following

Code: Select all

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

Posted: Wed Jun 14, 2006 1:53 pm
by tnhoe
this might help :-

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

Posted: Wed Jun 14, 2006 2:01 pm
by Detlef Hoefner
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

Posted: Wed Jun 14, 2006 2:04 pm
by Enrico Maria Giordano
If you will build a reduced and self-contained sample of the problem then I promise to experiment with it a little. :-)

EMG

Posted: Wed Jun 14, 2006 2:14 pm
by Detlef Hoefner
Enrico,

I already put a sample at

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

thanks for jumping in.

Regards,
Detlef

Posted: Wed Jun 14, 2006 2:48 pm
by Enrico Maria Giordano
Try this:

Code: Select all

oSearch:bGotFocus := { || oSearch:PostMsg( WM_KEYDOWN, VK_HOME ) }
EMG

Posted: Wed Jun 14, 2006 3:41 pm
by Detlef Hoefner
EnricoMaria wrote:Try this:

Code: Select all

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