a few questions about browse
Posted: Tue Dec 20, 2016 9:37 pm
Hello Antonio,
I have two question about browse:
1.
Is it possible to get the column number where I click in. I want to have a browse for an array, where in the first column there is a value and in the second column i have a bmp to delete that row.
If I click on a row I can change the name, but if I click on the Delete button on column 2 I want to delete it. Is this possible?
2.
When I click in the same browse on an empty row I still get value 1 as nRowPos. Should this not be 0 (zero) or NILL
I have two question about browse:
1.
Is it possible to get the column number where I click in. I want to have a browse for an array, where in the first column there is a value and in the second column i have a bmp to delete that row.
Code: Select all
AADD(aName, { 'first name', 'delete.bmp'})
AADD(aName, { 'second name', 'delete.bmp'})
AADD(aName, { 'third name', 'delete.bmp'})
AADD(aName, { 'fourth name', 'delete.bmp'})
@ 270, 120 LISTBOX oBrwNed FIELDS "", "" ;
HEADERS "Value", "Delete" ;
OF oFld:aDialogs[ 1 ] SIZE 450, 150
oBrwNed:SetArray( aName )
oBrwNed:bLine = { | nRow | IF( nRow <= Len( aName ), aName[ nRow ], { "", "" } ) }
oBrwNed:SetColWidth( 1, 400 )
oBrwNed:SetColWidth( 2, 30 )
oBrwNed:SetColBmp( 2 )
oBrwNed:SetColEditable( 1, .F. )
oBrwNed:SetColEditable( 2, .F. )
oBrwNed:SetColor( OwnClrGreen, OwnClrYellow )
oBrwNed:Select( 1 )
oBrwNed:bChange := { | obj , nindex| Msginfo( obj:nRowPos() )}
oBrwNed:bAction := { | obj , nindex| RK_Wijzig(oBrwNed:nArrayAt, 'Name', aName) }
2.
When I click in the same browse on an empty row I still get value 1 as nRowPos. Should this not be 0 (zero) or NILL