GOTFOCUS fires when column NOT in focus

This forum is for eXpress++ general support.
Post Reply
Message
Author
fursideup
Posts: 8
Joined: Tue Feb 02, 2010 2:26 pm
Location: Gates Canyon, California

GOTFOCUS fires when column NOT in focus

#1 Post by fursideup »

the GOTFOCUS clause in DCBROWSECOL fires in a continuous loop when you double click in a different column

DCBROWSECOL FIELD ROP->part_no PARENT oBrowseRoParts HEADER 'Part No' WIDTH 10 ;
GOTFOCUS {||(wtf 'part number gotfocus clause'), IIF( PARTS->(dbseek(rop->part_no+rop->vendor)),;
(TL_TableView( 'PARTS', ROP->part_no, 'PARTS', .t., .t. ),.t.),;
(dc_msgbox('No such part number on file'),.t. )) } ;
EDITPROTECT {||tl_IsSerial()};
EDITOR 'GET_ROP_PART_NO' PICTURE '@!'
Jon Steven

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: GOTFOCUS fires when column NOT in focus

#2 Post by rdonnay »

I think that may be due to the WTF.

This generates a call to the debug browse window which causes another GOTFOCUS.
The eXpress train is coming - and it has more cars.

fursideup
Posts: 8
Joined: Tue Feb 02, 2010 2:26 pm
Location: Gates Canyon, California

Re: GOTFOCUS fires when column NOT in focus

#3 Post by fursideup »

it fires without the WTF, I think it might be because it is the first col in the browse and it get focus by default whenever a refresh occours
Jon Steven

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: GOTFOCUS fires when column NOT in focus

#4 Post by rdonnay »

I'm having a difficult time reproducing this in a test program.

Can you modify the below test program in such a way that it will cause that problem?

Code: Select all

#include "dcdialog.ch"

function main()

local GetList[0], GetOptions, oBrowse, aDir

aDir := Directory()

@ 0,0 dcbrowse oBrowse data aDir Size 10,10 fit

dcbrowsecol element 1 header '1' width 10 parent oBrowse ;
  GOTFOCUS {|a|Something(oBrowse)}
dcbrowsecol element 2 header '2' width 10 parent oBrowse
dcbrowsecol element 3 header '3' width 10 parent oBrowse
dcbrowsecol element 4 header '4' width 10 parent oBrowse

dcread gui fit

return nil

proc appsys ; return

static function something( oBrowse )

dcmsgbox 'something'

return nil
The eXpress train is coming - and it has more cars.

Post Reply