xbrowse edit columns

User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

xbrowse edit columns

Post by Silvio.Falconi »

Can not edit a column of a one row of xbrowse ?

I explain you

I have this xbrowse

Image

I wish edit only for the first row only the columns I draw on green box

it's possible ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xbrowse edit columns

Post by nageswaragunupudi »

See oCol:nEditType := any value > 0 like EDIT_GET, EDIT_BUTTON, etc for the columns you want to edit.
Retain oCol:nEditType := 0 for other columns.

What else am I missing?
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Post by Silvio.Falconi »

Sorry perhaps I not explain good

Look the picture please

for the first record I wish edit only the columns 8 and 9 ( dates) and this record must not deleted

from second record to all records I wish edit only the column 4 and 5 , 8 and 9 ( and can be deleted)

thanks
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xbrowse edit columns

Post by nageswaragunupudi »

For columns 4,5,8 and 9, set nEditType := EDIT_GET or EDIT_BUTTON or etc.
For columns 8 and 9 also add

Code: Select all

oCol:bEditWhen := { || oBrw:BookMark == 1 }
 
Deletion has to be handled in the program code.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Post by Silvio.Falconi »

WITH OBJECT oBrw:aCols[ 5]
:AddBmpFile(".\bitmaps\sh_plus.bmp")
:nBtnBmp := 1
:nwidth := 60
:nDataStrAlign := AL_CENTER
:nHeadStrAlign := AL_CENTER
:nEditType := EDIT_BUTTON
:bEditBlock := { ||RES->QUANTITY++ }
:lBtnTransparent := .t.
:bEditWhen := { || oBrw:BookMark == 1 }
END

not run it add the quantity also the record number 1

I think ed something of
:bEditWhen := { ||oBrw:aArrayData:nat<>1 }

where 1 is the first record

If you see the picture I wish the final user can edit only date for the first line of xbrowse
I wish also the final user cannot delete the first line
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Post by Silvio.Falconi »

I tried also with

:nEditType := EDIT_BUTTON
:bEditBlock := { |o|Msginfo("") }
:bEditWhen := { || oBrw:nArrayAt<>1 }

I wish when on first line of the browse thefinal user cannot edit the cell

the user can edit only from second line
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xbrowse edit columns

Post by nageswaragunupudi »

Please try
:bEditWhen := { || oBrw:KeyNo == 1 }
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xbrowse edit columns

Post by nageswaragunupudi »

This is possible in 18.04:
Image

For Gets also.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Post by Silvio.Falconi »

nageswaragunupudi wrote:This is possible in 18.04:
Image

For Gets also.
GOOD

RAO YOU'RE FANTASTIC

tha value must be on center!
Last edited by Silvio.Falconi on Mon May 14, 2018 10:26 am, edited 2 times in total.
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Post by Silvio.Falconi »

Rao

:bEditWhen := { || oBrw:KeyNo == 1 }

I tried also with

:bEditWhen := { || oBrw:KeyNo <>1 }

it continue to process the editblock on first line
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Post by Silvio.Falconi »

Rao if you try this test

Code: Select all

#include "fivewin.ch"

function Main()

   local oDlg, oBrw

   USE c:\work\FWH\SAMPLES\CUSTOMER   

   DEFINE DIALOG oDlg SIZE 700,400 PIXEL TRUEPIXEL
   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg DATASOURCE Alias() ;
      AUTOCOLS CELL LINES NOBORDER

   WITH OBJECT oBrw:aCols[ 2 ]
      :nEditType     := EDIT_BUTTON
      :AddResource( "OPEN" )
      :nBtnBmp       := 1
      :bEditBlock    := { || test()}
      :beditwhen    := { || oBrw:keyno <> 1 }
   END
   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED

return nil

Function test()
return "modified"
it modified the record inserting "modified"

I wish no modify the first record How I can resolve ?

beditwhen must make as this function

Function test(oBrw)
IF oBrw:keyno =1
Msginfo(" I cannot mofified")
else
return "modified"
endif

return nil

but it not run ok


Now I correct with

:bEditBlock := { ||IF(oBrw:KeyNo=1,,RES->QUANTITY++) }

but I cannot use bwhenedit codeblock
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Post by Silvio.Falconi »

Now with these lines seem run ok

Code: Select all

 WITH OBJECT oBrw:aCols[ 4]
            :AddBmpFile(".\bitmaps\sh_minus.bmp")
            :nBtnBmp := 1
            :nwidth    := 40
            :nEditType := EDIT_BUTTON
            :bEditBlock := { ||IF(oBrw:KeyNo=1,,IIF(RES->QUANTITY>1, RES->QUANTITY--,RES->QUANTITY:= 1))  }
            :lBtnTransparent := .t.
            :lBmpStretch := .t.
            :nDataStrAlign := AL_CENTER
            :nHeadStrAlign := AL_CENTER
         END


          WITH OBJECT oBrw:aCols[ 5]
            :AddBmpFile(".\bitmaps\sh_plus.bmp")
            :nBtnBmp := 1
            :nwidth    := 60
            :nDataStrAlign := AL_CENTER
            :nHeadStrAlign := AL_CENTER
            :nEditType := EDIT_BUTTON
            :bEditBlock := { ||IF(oBrw:KeyNo=1,,RES->QUANTITY++)  }
            :lBtnTransparent := .t.
           END

is there a bug on bwhenedit codeblock ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xbrowse edit columns

Post by nageswaragunupudi »

is there a bug on bwhenedit codeblock ?
You are right.
bEditWhen is not preventing button action of EDIT_BUTTON.
This is now fixed in 18.04.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Post by Silvio.Falconi »

thanks
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
CARLOS ATUNCAR
Posts: 41
Joined: Thu Sep 17, 2015 11:40 pm

Re: xbrowse edit columns

Post by CARLOS ATUNCAR »

Saludos estoy necesitando poner un button en el xbrowse que me lleve a una consulta de movimientos del documento seleccionado todo funciona bien le he puesto una imagen al button pero cuando abandono la aplicación se me cuelga comento ese configuracion de la columna y termina normal.


/*
WITH OBJECT aBrw:aCols[ 1 ]
:addbmpfile( op:bmp16+"eye.bmp" )
:nBtnBmp := 1
:nEditType := EDIT_BUTTON
:bEditBlock := {|| VerItems( cCodigo,cQry:tipo,cQry:ord_comp )}
:lBtnTransparent := .t.
:lBmpStretch := .t.
END
*/
he tenido que solucionarlo usando

:aCols[01]:bLDClickData := { || VerItems( cCodigo,cQry:tipo,cQry:ord_comp ) }

version de FWH 1801 hay alguna razon ??
Post Reply