oGet:SetPos() and date

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

oGet:SetPos() and date

Post 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
User avatar
tnhoe
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia
Contact:

Post by tnhoe »

this might help :-

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

Hoe, email: easywin3@yahoo.com
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

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

Post 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
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Post by Detlef Hoefner »

Enrico,

I already put a sample at

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

thanks for jumping in.

Regards,
Detlef
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

Try this:

Code: Select all

oSearch:bGotFocus := { || oSearch:PostMsg( WM_KEYDOWN, VK_HOME ) }
EMG
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Post 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
Post Reply