Another error when i Input TAB on the open listbox:
Error BASE/1005 Class: 'NIL' has no property: NLASTKEY
Args:
[ 1] = U
[ 2] = N 13
Error BASE/1005 Class: 'NIL' has no property: NLASTKEY
Args:
[ 1] = U
[ 2] = N 13
@ 0, 0 LISTBOX ::oEditLbx VAR nAt OF ::oBrw SIZE 0,0 ITEMS ::aEditListTxt ;
COLOR aColors[ 1 ], aColors[ 2 ] FONT oFont
::oEditLbx:bLostFocus := { | oLbx, hWndFocus | ::PostEdit( aBound[ Max( 1, nAt ) ] ) }
::oEditLbx:bLButtonUp := {|| ::oEditLbx:Change(),;
If( ::oEditLbx != nil, ::oEditLbx:nLastKey := VK_RETURN,),;
::PostEdit( aBound[ nAt ], .t. ) }
::oEditLbx:bChange = {|| If( ::oEditLbx != nil, ::oEditLbx:nLastKey := VK_RETURN,) }
IF ::oBrw:oWnd:IsKindOf( "TDIALOG" )
::oEditLbx:nDlgCode = DLGC_WANTALLKEYS
::oEditLbx:bKeyDown := {|k| If( ::oEditLbx != nil, ::oEditLbx:nLastKey := k,), nil }
...
case ::nEditType == EDIT_LISTBOX
if xValue != nil
if ::bEditWhen == nil .or. Eval( ::bEditWhen, Self ) .and. ::oEditLbx:nLastKey == VK_RETURN
Eval( ::bOnPostEdit, Self, xValue, If( ::oEditLbx != nil, ::oEditLbx:nLastKey, 0 ) )
endif
#include "FiveWin.ch"
function Main()
local oDlg, oBrw, aValues := { Array( 2 ) }
DEFINE DIALOG oDlg SIZE 500, 300
@ 0, 0 XBROWSE oBrw OF oDlg ;
FIELDS aValues[ oBrw:nArrayAt ][ 1 ], aValues[ oBrw:nArrayAt ][ 2 ] ;
COLSIZES 220, 220 ;
HEADERS "One", "Two"
oBrw:SetArray( aValues )
oBrw:aCols[ 1 ]:nEditType = EDIT_GET_LISTBOX
oBrw:aCols[ 1 ]:aEditListTxt = { "111111", "22222" }
oBrw:aCols[ 1 ]:bOnPostEdit = { | o, v | MsgInfo( v ) }
oBrw:CreateFromCode()
oDlg:oClient = oBrw
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT oDlg:ReSize()
return nil
@ 0, 0 LISTBOX ::oEditLbx VAR nAt OF ::oBrw SIZE 0,0 ITEMS ::aEditListTxt ;
COLOR aColors[ 1 ], aColors[ 2 ] FONT oFont
::oEditLbx:bLostFocus := { | oLbx, hWndFocus | ::PostEdit( aBound[ Max( 1, nAt ) ] ) }
::oEditLbx:bLButtonUp := {|| ::oEditLbx:Change(),;
::PostEdit( aBound[ nAt ], .t. ) }
::oEditLbx:bChange = {|| If( ::oEditLbx != nil, ::oEditLbx:nLastKey := VK_RETURN,) }
IF ::oBrw:oWnd:IsKindOf( "TDIALOG" )
::oEditLbx:nDlgCode = DLGC_WANTALLKEYS
::oEditLbx:bKeyDown := { | nKey | If( nKey == VK_RETURN,;
( ::oEditLbx:Change(),;
::PostEdit( aBound[ nAt ], .t. ) ),) }
ELSE
Error BASE/1005 Class: 'NIL' has no exported method: CHANGE
Args:
[ 1] = U
::oEditLbx:bKeyDown := { | nKey | If( nKey == VK_RETURN,;
( If( ::oEditLbx != nil, ::oEditLbx:Change(),),;
::PostEdit( aBound[ nAt ], .t. ) ),) }
Please go to line 11135 in xbrowse.prg and change this:
::oEditLbx:Move( nRow, nCol, nWidth, nHeight, .t. )
to
nRow = If( nRow + nHeight > ::nHeight, ::nHeight - nHeight, nRow )
::oEditLbx:Move( nRow, nCol, nWidth, nHeight, .t. )
If nRow + nHeight > ::oBrw:BrwHeight()
If (::oBrw:BrwHeight() - nRow) < ::oBrw:nRowHeight
do while ( nRow - nHeight - ::oBrw:nRowHeight + 1 ) < 0
nHeight -= FontHeight( ::oBrw, ::oBrw:oFont )
enddo
nRow := nRow - nHeight - ::oBrw:nRowHeight + 1
else
nHeight := ::oBrw:BrwHeight() - nRow
Endif
Endif
#include "FiveWin.ch"
function Main()
local oDlg, oBrw, aValues := { Array( 2 ) }, n
for n = 1 to 50
AAdd( aValues, ATail( aValues ) )
next
DEFINE DIALOG oDlg SIZE 500, 300
@ 0, 0 XBROWSE oBrw OF oDlg ;
FIELDS aValues[ oBrw:nArrayAt ][ 1 ], aValues[ oBrw:nArrayAt ][ 2 ] ;
COLSIZES 220, 220 ;
HEADERS "One", "Two"
oBrw:SetArray( aValues )
oBrw:aCols[ 1 ]:nEditType = EDIT_GET_LISTBOX
oBrw:aCols[ 1 ]:aEditListTxt = { "111111", "22222" }
oBrw:aCols[ 1 ]:bOnPostEdit = { | o, v | MsgInfo( v ) }
oBrw:CreateFromCode()
oDlg:oClient = oBrw
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT oDlg:ReSize()
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 23 guests