xBrowse and bChange

xBrowse and bChange

Postby Maurizio » Tue Aug 23, 2011 4:29 pm

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

Regards Maurizio
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: xBrowse and bChange

Postby nageswaragunupudi » Wed Aug 24, 2011 11:25 am

oBrw:bOnRowLeave.
Regards

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

Re: xBrowse and bChange

Postby Maurizio » Wed Aug 24, 2011 2:16 pm

Hello Rao ,

:( bOnRowLeave dosn't work

Regards Maurizio

Code: Select all  Expand view
#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
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: xBrowse and bChange

Postby nageswaragunupudi » Wed Aug 24, 2011 5: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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse and bChange

Postby Maurizio » Thu Aug 25, 2011 6:55 am

Hello Rao ,

execute a codeblock before making a skip ( :GoDown,:GoUp,:GoTop, ecc.. ) on the record
Code: Select all  Expand view

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
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Enrico Maria Giordano and 90 guests