Page 1 of 1

Editing individual lines

Posted: Wed Mar 17, 2021 11:02 am
by Natter
The xBrowse column is assigned the edit type EDIT_BUTTON. Accordingly, a button will appear in each row of the column. Is it possible for individual xBrowse rows not to show this button ?

Re: Editing individual lines

Posted: Wed Mar 17, 2021 11:40 am
by MGA
trying to help

#include "FiveWin.ch"
#include "XBrowse.ch"

function Main()

local oDlg, oFld, oBrw1, oBrw2
local aDat1, aDat2

aDat1:={{"Row1-Col1","Row1-Col2","Row1-Col3"},;
{"Row2-Col1","Row2-Col2","Row2-Col3"},;
{"Row3-Col1","Row3-Col2","Row3-Col3"},;
{"Row4-Col1","Row4-Col2","Row4-Col3"}}

aDat2:={{"ROW1-COL1","ROW1-COL2","ROW1-COL3"},;
{"ROW2-COL1","ROW2-COL2","ROW2-COL3"},;
{"ROW3-COL1","ROW3-COL2","ROW3-COL3"},;
{"ROW4-COL1","ROW4-COL2","ROW4-COL3"}}

DEFINE DIALOG oDlg RESOURCE "Test"

REDEFINE FOLDER oFld ;
PROMPTS "One", "Two" ;
DIALOGS "One", "Two" ;
ID 100 OF oDlg

REDEFINE XBROWSE oBrw1 ID 10 OF oFld:aDialogs[ 1 ] ARRAY aDat1 AUTOCOLS

REDEFINE XBROWSE oBrw2 ID 10 OF oFld:aDialogs[ 2 ] ARRAY aDat2 AUTOCOLS

OBRW1:BCHANGE := {|| oBrw1:aCols[ 2 ]:nEdittype := IIf(obrw1:narrayat==1,EDIT_GET,EDIT_BUTTON), OBRW1:REFRESH() }
oBRW1:lColChangeNotify := .T.

oBrw1:aCols[ 2 ]:nEdittype := IIf(obrw1:narrayat==1,EDIT_GET,EDIT_BUTTON)
oBrw1:aCols[ 2 ]:bEditBlock := { || MsgYesNo( "Please select" ) }

oBrw2:aCols[ 2 ]:nEdittype := EDIT_GET

ACTIVATE DIALOG oDlg CENTERED

return nil

Re: Editing individual lines

Posted: Wed Mar 17, 2021 11:59 am
by Natter
Thank you, I'll try. But it seems to me to rewrite the PaintCell method for myself