There may be a bug in either the TGet class or the GET class object within the TGet class (TGet:oGet). If you are using the @k picture (which erases the rest of a field when a new character is entered in the first position) and if you call oDlg:update() just prior to entering the field, the picture fails to work. In the sample code below, the first field calls oDlg:update() from it's VALID clause. Then next field's picture clause does not work as expected. If you then move to the third field (which doesn't call oDlg:update()), then back to the second field, the picture clause works as expected.
I cannot figure out why this is happening. It doesn't seem logical that calling oDlg:update() (which calls the control's refresh() method) would cause a problem with the picture clause. I can't find any reference to this particular picture clause in TGet so I am guessing the problem lies within the GET class in Harbour, but I am not sure.
I have also confirmed that if you just call oGet2:refresh() instead of oDlg:update() the same problem occurs.
I am using the FWH May 2006 release with Harbour. The problem also existed with the May 2005 version so it is not a new problem.
James
- Code: Select all Expand view
#include "fivewin.ch"
function main()
local oDlg, oGet2, cVar1:="AAAAAA", cVar2:="BBBBBB", cVar3:="CCCCCC"
define dialog oDlg title "Test Get"
@ 1,1 get cVar1 picture "@!@k" of oDlg update valid (oDlg:update(), .t.)
@ 2,1 get oGet2 var cVar2 picture "@!@k" of oDlg update
oGet2:bGotFocus:={|| oGet2:setPos(1) }
@ 3,1 get cVar3 picture "@!@k" of oDlg update
activate dialog oDlg centered
return nil