Here's the sample. The browse is build, column 3 is deleted before the dialog is shown. If you now right-click on a column from #3 on, the cursor will jump to the next column.
Code: Select all
FUNCTION MAIN()
LOCAL GetList := {}, GetOptions := {}, oBrowse, aColumns := {}, aDir := Directory()
DCGET OPTIONS HIDE
aColumns := Array(Len(aDir[1]))
@ 1,1 DCBROWSE oBrowse DATA aDir SIZE 100,25 RBSELECT
FOR nCtr := 1 to Len(aDir[1])
DCBROWSECOL ELEMENT nCtr HEADER Str(nCtr,2,0) WIDTH 10 PARENT oBrowse OBJECT aColumns[nCtr]
NEXT
DCREAD GUI ADDBUTTONS OPTIONS GetOptions TITLE 'Browse Test' FIT ;
EVAL {|o|oBrowse:DelColumn(3),o:Show()}
RETURN NIL
Edit: This worked perfect with Xbase++ 1.9 SL1. The behaviour came with 2.0 and the change in _DCXBROW.PRG you added here:
Code: Select all
METHOD DC_XbpBrowse:itemRbDown( aPos, aValues )
LOCAL nRow := aValues[2]
LOCAL nCol
IF ::rightButtonSelect
#if XPPVER > 02000000
nCol := aValues[1]:columnPos // <<<<<<<
#else
nCol := ::ColNum ( aValues[1] )
#endif
::xbpBrowse:gotoItem( nRow, nCol )
::colPos := nCol
ENDIF
::XbpBrowse:itemRbDown( aPos, aValues )
RETURN self