xbrowse : bchange is executed twice in lButtondown

xbrowse : bchange is executed twice in lButtondown

Postby demont frank » Tue Sep 30, 2008 10:36 am

Hello,

I have a problem with wbrose , using bChange

In this version bChange is executed twice , after linking in i can see that bChange is executed in lButtondown

1) on line 2645

if nRowPos > 0
::Skip( nRowPos - ::nRowSel ) // Eval( ::bSkip, nRowPos - ::nRowSel )
::nRowSel := nRowPos
::Change( .t. ) <----------- 2645
endif

2) on line 2669


This error was already present in 8.01. Looking in the source i can see the changes i made already (but was forgotten)

I introduced a local var

# ifdef FRANKDEMONT
local lChangExecuted := .F.
# endif

Which is changed when bChange is executed (line 2646)

The ::change(.T.) on line 2669 is only executed when lChangeExecuted is .F.

Maybe there is a better solution ????
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Postby Antonio Linares » Wed Oct 01, 2008 8:05 am

Frank,

It is simpler if we remove the call to ::Change( .t. ) from line 2669 as it is already called from line 2645.

Thanks for your feedback! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby demont frank » Wed Oct 01, 2008 12:31 pm

Antonio Linares wrote:Frank,

It is simpler if we remove the call to ::Change( .t. ) from line 2669 as it is already called from line 2645.

Thanks for your feedback! :-)


What if NOT nRowpos > 0 ? Change() would not be executed !

Frank
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Postby nageswaragunupudi » Wed Oct 01, 2008 1:11 pm

Will this be okay?
Code: Select all  Expand view
if nRowPos > 0 .and. nRowPos != ::nRowSel
   ::Skip( nRowPos - ::nRowSel )
   ::nRowSel := nRowPos
   if nColPos > 0
      ::nColSel   := nColPos
   endif
   ::Change( .t. )
else
   if nColPos > 0 .and. nColPos != ::nColSel
      ::nColSel   := nColPos
      ::Change( .f. )
   endif
endif


And remove the ::Change( .t. ) at the end ( just before oVSroll present line 2669 )
Regards

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

Postby Antonio Linares » Wed Oct 01, 2008 1:23 pm

nRowPos is only zero for the header, and the header will not change for skipping records.

So IMO it is fine if we simply remove the extra call to ::Change(). Unless I am missing something :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

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