FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Xbrowse refresh question
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Xbrowse refresh question
Posted: Thu Jun 18, 2009 02:22 PM
Hello

I have a problem with a xbrowse refresh when editing a cell ,

When i dbl click on a cell, the whole browse is refreshed (before any editing or operation) , in a network environment this is very long to display

any idea ?

here is part of the code below,

thanks for help,

Richard
Code (fw): Select all Collapse
   @ 10,200 XBROWSE oBrwpla OF wndpmain ;
         SIZE wndpmain:nwidth - 200,wndpmain:nHeight - 30 PIXEL ;
         ALIAS TRANS[04]

   oCol := oBrwPLA:AddCol()
   oCol:bStrData := {|| (TRANS[04])->PLAGE}

   AEval( TABVAR[15], { |DLIB,X | CRECOL(x,@TRANS,@OBRWPLA) } )

   oBrwPLA:nMarqueeStyle       := 1
   oBrwpla:nColDividerStyle    := LINESTYLE_INSET
   oBrwPLA:lColDividerComplete := .T.
   oBrwPLA:lRecordSelector     := .T.

   oBrwPLA:bClrStd    := {|| { CLR_BLUE, CLR_WHITE } }
   oBrwPLA:bClrHEADER := {|| { CLR_BLUE, COULDLG("TD") } }

   oBRWPLA:blDblClick := { | nRow, nCol, nKey | EditCel(@TRANS, OBRWPLA,@TPAR,nRow,nCol) }

   FOR I = 1 TO LEN(oBrwPLA:aCols)
       oBrwPLA:aCols[I]:nWidth  := TRANS[10][I]
       oBrwPLA:aCols[i]:bRClickData := {|| Menucopy(@TRANS,OBRWPLA) }
   NEXT

   AEVAL(oBrwPLA:aCols, { |DLIB,X | SETCOLBRW(x,@TRANS,@OBRWPLA) } )

   obrwPLA:nRowHeight    := AGPREF->HCELL
   oBrwPLA:ndatalines    := 4
   oBrwPLA:nHeaderLines  := 2
   OBRWPLA:nFreeze       := 1
   oBrwPLA:nCOLSEL       := 2
   oBrwPLA:nCOLoffset    := 1
   oBrwPLA:nROWSEL       := 1

   oBrwPLA:bGotFocus     := {|| IF( FILE(TRANS[04] + ".DBF"),dbSelectArea(TRANS[04]), )  }

   OBRWPLA:bKeyDown := {|nKey| iif(nKey=VK_DELETE,SUPCEL(@OBRWPLA,@TRANS, .T. ,@TPAR) , ) }

   OBRWPLA:lAllowColHiding    := .F.
   OBRWPLA:lAllowRowSizing    := .F.
   OBRWPLA:lAllowColSwapping  := .F.
   OBRWPLA:l2007              := .T.

   oBrwPLA:CreateFromCODE()

   oBrwPLA:bKeyCount := {|| ( oBrwPLA:cAlias )->( OrdKeyCount() ) }

   oBrwPLA:oDragCursor   := TRANS[12]

   oBrwPLA:bDragBegin    := { |nRow,nCol,nFlags| DragBegin( nRow, nCol, nFlags, @TRANS, @oBrwPLA ) }
   oBrwPLA:bDropOver     := { |uDropInfo, nRow, nCol, nFlags| DropOver( uDropInfo, nRow, nCol, nFlags, @TRANS, @oBrwPLA ) }
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Xbrowse refresh question
Posted: Thu Jun 18, 2009 04:55 PM

Richard,

Why not just use spreadsheet style editing?

oBrw:lFastEdit:=.t. // any alpha-numeric key triggers the edit

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Xbrowse refresh question
Posted: Fri Jun 19, 2009 03:40 AM

James

I know about cell fast editing, but this does not make a change in background permanent refresh my main concern

Thanks for the help

Richard

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse refresh question
Posted: Fri Jun 19, 2009 04:58 AM

Mr Chidiak

You can be quite sure that double click by itself, does not call Refresh() method.
Possible that some other operation inside the function that is called on double click triggers a refresh() directly or indirectly.

I have tested this by modifying the xbrowse.prg temporarily for this test.

I created a new data nRefresh init 0
I modified method refresh() to increment obrw:nrefresh every time refresh() is called.
I checked the value of nRefresh before and after doubleclick. There is no change in the value by double clicking.
( tested with edittype, assigning function to double click, etc. )

I would suggest you to please check with a dummy EditCell() function without any action inside.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion