FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse and bChange
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
xBrowse and bChange
Posted: Tue Aug 23, 2011 04:29 PM

Hello ,
bChange in xBrowse is executed after a skip , is there a codeblock to use before a skip ?

Regards Maurizio

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse and bChange
Posted: Wed Aug 24, 2011 11:25 AM

oBrw:bOnRowLeave.

Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: xBrowse and bChange
Posted: Wed Aug 24, 2011 02:16 PM
Hello Rao ,

:-) bOnRowLeave dosn't work

Regards Maurizio

Code (fw): Select all Collapse
#include 'fivewin.ch'
#include 'xbrowse.ch'

function main()

   local oWnd, oBrw

   use customer

   DEFINE WINDOW oWnd

   @ 0,0 XBROWSE oBrw ;
      COLUMNS 'First', 'Last', 'Age' ;
      OF oWnd ;
      ALIAS 'CUSTOMER' ;
      LINES CELL

   WITH OBJECT oBrw 
      
       :bChange := {|| Msginfo("After") }
                      
       :bOnRowLeave := {||Msginfo("Before")} 
      
      
   END


  oBrw:nColDividerStyle    := LINESTYLE_BLACK
  oBrw:lColDividerComplete := .T.
  oBrw:lRecordSelector     := .F.   
  oBrw:nStretchCol = STRETCHCOL_LAST


  oBrw:CreateFromCode()
  oWnd:oClient := oBrw

   ACTIVATE WINDOW oWnd  

return nil
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse and bChange
Posted: Wed Aug 24, 2011 05:47 PM

You are right.

bOnRowLeave is evaluated only when oBrw:lEdited := .t., i.e., when a cell is edited and row ( or even column is moved ).

If you can tell me what you want to do in your application, I might come out with some working suggestion for you.

Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: xBrowse and bChange
Posted: Thu Aug 25, 2011 06:55 AM
Hello Rao ,

execute a codeblock before making a skip ( :GoDown,:GoUp,:GoTop, ecc.. ) on the record
Code (fw): Select all Collapse
METHOD GoDown( nDown ) CLASS TXBrowse

.
.
.
.

   if bBefore != NIL
      Eval( bBefore)
   endif  
         
 
   for n := 1 to nDown

      if ::Skip( 1 ) == 1           //Eval( ::bSkip, 1 ) == 1
         if ::nRowSel < nLines
            
            
.
.
.
.            
            
return nil


Regards Maurizio

Continue the discussion