I am trying to change the behavior of a GET using bGotFocus. I want the cursor to be in the 1 postion when the GET is entered and to clear the contents of the GET if the user starts typing in the first postion. The code below works when you tab or shift-tab into the GET but
not if you click into the GET. Strangely, you do hear the tone() when clicking into the GET so the codeblock is getting eval'd, but there must be other code that is getting called after the codeblock which then moves the cursor back to the click position. I have been working on this for hours with no luck.
Using May 2006 FWH.
Any ideas on a solution?
James
-------------------------
Code: Select all
#include "fivewin.ch"
function main()
local oDlg, oGet, cName:= "Microsoft ", oGet2, cAddress:=space(22), oBtn
define dialog oDlg
@ 1,1 get oGet var cName of oDlg
oGet:bGotFocus:= {|| oGet:gohome(), oGet:oGet:clear:=.t., tone(300,1) }
@ 2,1 get oGet2 var cAddress of oDlg update
activate dialog oDlg
return nil