Browse edit of cell with brush

Browse edit of cell with brush

Postby AntoninoP » Tue Sep 20, 2022 3:54 pm

On my program I have a XBrowse with fast edit and brush. My problem is when I edit last visible row and go down to end the edit the scrolling does not update well:
Image
This piece of code reproduces the issue:
Code: Select all  Expand view
#include "fivewin.ch"

Function main()
   local oWnd,oBrw
   LOCAL aData := {},n, oBrush
   for n:=1 to 200
      aAdd(aData, {"Product "+hb_ntoc(n),0.0})
   next
   DEFINE WINDOW oWnd
   @ 0, 0 XBROWSE oBrw OF oWnd STYLE 2015 ;
      DATASOURCE aData ;
      COLUMNS 1,2 ;
      HEADERS "Desc","Qta"
   with object oBrw
      :lFastEdit := .T.
   end
   DEFINE BRUSH oBrush COLOR RGB(192,192,192)
   #define CLR_EDITED RGB(240,64,64)
   with object oBrw:aCols[2]
      :nEditType := EDIT_GET
      :cEditPicture := "999999.99"
      :lAutoSave := .T.
      :oBrush := {|| iif(empty(oBrw:aArrayData[oBrw:KeyNo(),2]),oBrush,nil) }
      :bClrStd := {|| ;
         {  iif(empty(oBrw:aArrayData[oBrw:KeyNo(),2]),CLR_BLACK,CLR_EDITED), ;
            CLR_WHITE} ;
      }
   end
   oBrw:CreateFromCode()
   oWnd:oClient := oBrw
   activate Window oWnd
return nil
 


I am using the FW 18.01, maybe is it already fixed on newer versions?

using 18.01 my PC create an executable of 3.686.400 bytes for this sample, how big is with new version? (the size is main reason why we don't update so long)

Regards,

PS: without brush is worse, you see the old value
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Browse edit of cell with brush

Postby karinha » Tue Sep 20, 2022 4:38 pm

yo haria asi:

Code: Select all  Expand view

// C:\FWH..\SAMPLES\ANTONINO.PRG

#Include "Fivewin.ch"

#Define CLR_EDITED RGB(240,64,64)

FUNCTION main()

   LOCAL oWnd, oBrw

   LOCAL aData := {}, n, oBrush

   FOR n := 1 TO 200
      aAdd( aData, { "Product " + hb_ntoc( n ), 0.0 } )
   NEXT

   DEFINE BRUSH oBrush COLOR RGB( 192, 192, 192 )

   DEFINE WINDOW oWnd

   @ 0, 0 XBROWSE oBrw OF oWnd STYLE 2015 DATASOURCE aData ;
      COLUMNS 1, 2 HEADERS "Desc", "Qta"

   WITH object oBrw
      :lFastEdit := .T.
   END

   WITH object oBrw:aCols[2]

      :nEditType := EDIT_GET
      :cEditPicture := "999999.99"
      :lAutoSave := .T.

      :oBrush := {|| iif( empty( oBrw:aArrayData[oBrw:KeyNo(),2] ), oBrush, nil ) }

      :bClrStd := {|| ;
         {  iif( empty( oBrw:aArrayData[oBrw:KeyNo(),2] ), CLR_BLACK, CLR_EDITED ), ;
         CLR_WHITE } ;
         }
   end

   oBrw:CreateFromCode()

   oWnd:oClient := oBrw

   ACTIVATE WINDOW oWnd

RETURN NIL
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Browse edit of cell with brush

Postby AntoninoP » Wed Sep 21, 2022 6:27 am

karinha wrote:yo haria asi:
Regards, saludos.

I don't see changes in your code
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Browse edit of cell with brush

Postby AntoninoP » Wed Sep 21, 2022 7:41 am

Looks like if I put
Code: Select all  Expand view
oBrw:lFullPaint := .T.
resolves the issue
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Browse edit of cell with brush

Postby karinha » Wed Sep 21, 2022 11:53 am

AntoninoP wrote:Looks like if I put
Code: Select all  Expand view
oBrw:lFullPaint := .T.
resolves the issue


Asi?

Code: Select all  Expand view

// C:\FWH..\SAMPLES\ANTONINO.PRG

#Include "Fivewin.ch"

#Define CLR_EDITED RGB(240,64,64)

FUNCTION main()

   LOCAL oWnd, oBrw

   LOCAL aData := {}, n, oBrush

   FOR n := 1 TO 200
      aAdd( aData, { "Product " + hb_ntoc( n ), 0.0 } )
   NEXT

   DEFINE BRUSH oBrush COLOR RGB( 192, 192, 192 )

   DEFINE WINDOW oWnd

   @ 0, 0 XBROWSE oBrw OF oWnd STYLE 2015 DATASOURCE aData ;
      COLUMNS 1, 2 HEADERS "Desc", "Qta"

   WITH object oBrw
      :lFastEdit := .T.
   END

   WITH object oBrw:aCols[2]

      :nEditType := EDIT_GET
      :cEditPicture := "999999.99"
      :lAutoSave := .T.

      :oBrush := {|| iif( empty( oBrw:aArrayData[oBrw:KeyNo(),2] ), oBrush, nil ) }

      :bClrStd := {|| ;
         {  iif( empty( oBrw:aArrayData[oBrw:KeyNo(),2] ), CLR_BLACK, CLR_EDITED ), ;
         CLR_WHITE } ;
         }
   end

   oBrw:lFullPaint := .T.

   oBrw:CreateFromCode()

   oWnd:oClient := oBrw

   ACTIVATE WINDOW oWnd

RETURN NIL
 


Gracias, thanks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Browse edit of cell with brush

Postby nageswaragunupudi » Sun Sep 25, 2022 1:07 pm

On my program I have a XBrowse with fast edit and brush. My problem is when I edit last visible row and go down to end the edit the scrolling does not update well:


Here is the real bug. This has nothing to do with colors or brushes.
Bug:
When the user edits a cell in the last row and then exits the Get by pressing Enter key or UpArrowKey, there is no problem at all and everything works correctly as expected.

But if the user exits the Get by pressing Down Arrow key, the changes are written to the array (or other datasource) but the change is not updated in the browse.
What exactly happening is that the browse is scrolled up without repainting the last row.

This bug remains even till today.

We will work on suitable fix and get back.

Till then, please depend on oBrw:lFullPaint := .t., though this slows down the browse painting
Regards

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

Re: Browse edit of cell with brush

Postby nageswaragunupudi » Sun Sep 25, 2022 1:27 pm

using 18.01 my PC create an executable of 3.686.400 bytes for this sample, how big is with new version? (the size is main reason why we don't update so long)


4.8 MB
Regards

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

Re: Browse edit of cell with brush

Postby cnavarro » Sun Sep 25, 2022 1:53 pm

nageswaragunupudi wrote:
This bug remains even till today.

We will work on suitable fix and get back.

Till then, please depend on oBrw:lFullRefresh := .t., though this slows down the browse painting


Mr. Rao,
oBrw:lFullRefresh := .t. // I do not know this DATA


or

oBrw:lFullPaint := .t.

Thanks
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Browse edit of cell with brush

Postby nageswaragunupudi » Sun Sep 25, 2022 5:48 pm

Extremely sorry.
lFullPaint is the correct name.
I edited and corrected this mistake
Thanks
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 50 guests