- Code: Select all Expand view
#include "Fivewin.ch"
REQUEST DBFCDX
FUNCTION MAIN()
LOCAL oDlg, oBrw
RDDSETDEFAULT( "DBFCDX" )
USE TEST
INDEX ON FIELD -> last + FIELD -> first TO "TEMP__" FOR FIELD -> last = "A"
DEFINE DIALOG oDlg;
SIZE 400, 400
@ 1, 1 LISTBOX oBrw FIELDS TEST -> last,;
TEST -> first;
SIZE 200, 200 PIXEL
oBrw:bLogicLen = { || ( oBrw:cAlias ) -> ( OrdKeyCount() ) }
ACTIVATE DIALOG oDlg;
CENTER
CLOSE
FERASE( "TEMP__.CDX" )
RETURN NIL
It is not a very important issue but anyway this is a possible fix:
- Code: Select all Expand view
METHOD LButtonDown( nRow, nCol, nKeyFlags ) CLASS TWBrowse
local nClickRow, nSkipped
local nColPos := 0, nColInit := ::nColPos - 1
local nAtCol
if ::lDrag
return Super:LButtonDown( nRow, nCol, nKeyFlags )
endif
nClickRow = nWRow( ::hWnd, ::hDC, nRow,;
If( ::oFont != nil, ::oFont:hFont, 0 ) )
if ::nLen < 1 .and. nClickRow != 0
return nil
endif
if ::lMChange .and. AScan( ::GetColSizes(),;
{ | nColumn | nColPos += nColumn,;
nColInit++,;
nCol >= nColPos - 1 .and. ;
nCol <= nColPos + 1 }, ::nColPos ) != 0
if ! ::lCaptured
::lCaptured = .t.
::Capture()
::VertLine( nColPos, nColInit )
endif
return nil
endif
::SetFocus()
if nClickRow == 0 .and. Valtype(nKeyFlags) == "N"
if ::aActions != nil .and. ;
( nAtCol := ::nAtCol( nCol ) ) <= Len( ::aActions )
if ::aActions[ nAtCol ] != nil
wBrwLine( ::hWnd, ::GetDC(), 0, ::aHeaders, ::GetColSizes(),;
::nColPos, ::nClrForeHead, ::nClrBackHead,;
If( ::oFont != nil, ::oFont:hFont, 0 ),.f.,;
::aJustify, nAtCol, ::nLineStyle,,, ::oVScroll, ::bLogicLen )
::ReleaseDC()
Eval( ::aActions[ nAtCol ], Self, nRow, nCol )
wBrwLine( ::hWnd, ::GetDC(), 0, ::aHeaders, ::GetColSizes(),;
::nColPos, ::nClrForeHead, ::nClrBackHead,;
If( ::oFont != nil, ::oFont:hFont, 0 ),.f.,;
::aJustify,, ::nLineStyle,,, ::oVScroll, ::bLogicLen )
::ReleaseDC()
else
MsgBeep()
endif
else
MsgBeep()
endif
endif
if nClickRow > ::nLen //EMG
return 0 //EMG
endif //EMG
if nClickRow > 0 .and. nClickRow != ::nRowPos .and. ;
nClickRow < ::nRowCount() + 1
::DrawLine()
nSkipped = ::Skip( nClickRow - ::nRowPos )
::nRowPos += nSkipped
if ::oVScroll != nil
::VSetPos( ::VGetPos() + nSkipped )
endif
if ::lCellStyle
::nColAct := ::nAtCol( nCol )
if ::oHScroll != nil
::oHScroll:SetPos(::nColAct)
endif
endif
::DrawSelect()
::lHitTop = .f.
::lHitBottom = .f.
if ::bChange != nil
Eval( ::bChange, Self )
endif
else
if ::lCellStyle
::nColAct := ::nAtCol( nCol )
if ::oHScroll != nil
::oHScroll:SetPos(::nColAct)
endif
::Refresh(.f.)
endif
endif
Super:LButtonDown( nRow, nCol, nKeyFlags )
return 0
EMG