METHOD RButtonDown( nRow, nCol, nKeyFlags ) CLASS TXBrowse
local oCol
local nColPos, nRowPos
local bPopUp
::CancelEdit()
::Seek()
nRowPos := ::MouseRowPos( nRow )
nColPos := ::MouseColPos( nCol )
if nColPos <= 0
if nRow >= ::FirstRow()
Super:RButtonDown( nRow, nCol, nKeyFlags )
return nil
else
if ::lAllowColHiding
::SetColumns( nRow, nCol, nKeyFlags )
endif
return nil
endif
endif
oCol := ::ColAtPos( nColPos )
bPopUp := ifnil( oCol:bPopUp, ::bPopUp )
if ::MouseAtHeader( nRow, nCol )
if oCol:bRClickHeader != nil
return Eval( oCol:bRClickHeader, nRow, nCol, nKeyFlags, oCol )
elseif ::lAllowColHiding
return ::SetColumns( nRow, nCol, nKeyFlags )
endif
elseif ::MouseAtFooter( nRow, nCol )
if oCol:bRClickFooter != nil
return Eval( oCol:bRClickFooter, nRow, nCol, nKeyFlags, oCol )
endif
elseif nRowPos > 0
if nRowPos != ::nRowSel
if ! ::FullPaint()
::DrawLine()
endif
::Skip( nRowPos - ::nRowSel )
::nRowSel := nRowPos
if nColPos > 0
::nColSel := nColPos
endif
::Change( .t. )
elseif nColPos > 0 .and. ::nColSel != nColPos
::nColSel := nColPos
::Change( .f. )
endif
if Len( ::aSelected ) > 0 .and. AScan( ::aSelected, ::BookMark ) == 0
::Select( 0 )
::Select( 1 )
endif
if ::FullPaint()
::Super:Refresh( .t. )
else
::DrawLine( .t. )
endif
if ::oVScroll != nil
::VSetPos( ::KeyNo() )
endif
if ::oHScroll != nil
::oHScroll:SetPos( ::nColSel )
endif
if bPopUp != nil
Eval( bPopUp, oCol ):Activate( (::nRowSel * ::nRowHeight) + ::nHeaderHeight, oCol:nDisplayCol, Self )
return 0
elseif oCol:bRClickData != nil
return Eval( oCol:bRClickData, nRow, nCol, nKeyFlags, oCol )
endif
else
if bPopUp != nil
Eval( bPopUp, oCol ):Activate( (::nRowSel * ::nRowHeight) + ::nHeaderHeight, oCol:nDisplayCol, Self )
return 0
elseif oCol:bRClickData != nil
return Eval( oCol:bRClickData, nRow, nCol, nKeyFlags, oCol )
endif
endif
If nColPos != 0 .and. nRowPos != 0
return Super:RButtonDown( nRow, nCol, nKeyFlags )
endif
return 0