xbrowse edit columns

xbrowse edit columns

Postby Silvio.Falconi » Sun May 13, 2018 9:21 am

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 ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Postby nageswaragunupudi » Sun May 13, 2018 12:34 pm

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
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xbrowse edit columns

Postby Silvio.Falconi » Sun May 13, 2018 7:21 pm

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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Postby nageswaragunupudi » Sun May 13, 2018 9:32 pm

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  Expand view  RUN

oCol:bEditWhen := { || oBrw:BookMark == 1 }
 


Deletion has to be handled in the program code.
Regards

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

Re: xbrowse edit columns

Postby Silvio.Falconi » Mon May 14, 2018 7:11 am

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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Postby Silvio.Falconi » Mon May 14, 2018 8:41 am

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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Postby nageswaragunupudi » Mon May 14, 2018 9:42 am

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

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

Re: xbrowse edit columns

Postby nageswaragunupudi » Mon May 14, 2018 9:59 am

This is possible in 18.04:
Image

For Gets also.
Regards

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

Re: xbrowse edit columns

Postby Silvio.Falconi » Mon May 14, 2018 10:12 am

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.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Postby Silvio.Falconi » Mon May 14, 2018 10:15 am

Rao

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

I tried also with

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

it continue to process the editblock on first line
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Postby Silvio.Falconi » Mon May 14, 2018 12:02 pm

Rao if you try this test
Code: Select all  Expand view  RUN
#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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Postby Silvio.Falconi » Mon May 14, 2018 12:12 pm

Now with these lines seem run ok

Code: Select all  Expand view  RUN
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 ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Postby nageswaragunupudi » Tue May 15, 2018 2:14 am

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
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xbrowse edit columns

Postby Silvio.Falconi » Tue May 15, 2018 7:23 am

thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse edit columns

Postby CARLOS ATUNCAR » Sat Sep 15, 2018 2:46 am

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 ??
Carlos Atuncar - CaSoftSystem
Chincha - Perú
carlosalbatun@gmail.com
CARLOS ATUNCAR
 
Posts: 176
Joined: Thu Sep 17, 2015 11:40 pm
Location: Chincha - Peru

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 31 guests