xBrowse - incremental search
Posted: Mon Nov 12, 2007 7:37 am
If I search and the find position is not on the first page I lose the header and the row pointer.
www.FiveTechSoft.com
https://fivetechsoft.com/forums/
Code: Select all
METHOD Seek( cSeek ) CLASS TXBrowse
local uBook, uSeek
local nFor, nRows
local lRefresh
if ::bSeek == nil
return nil
endif
If cSeek == nil
if ! Empty( ::cSeek )
::cSeek := ""
If ::oSeek != nil
::oSeek:SetText( "" )
Endif
endif
return nil
Endif
uBook := Eval( ::bBookMark )
if !Eval( ::bSeek, cSeek )
Eval( ::bBookMark, uBook )
MsgBeep()
return nil
endif
if ::nRowSel > Eval( ::bKeyNo,, Self )
::nRowsel := 1
endif
::cSeek := cSeek
uSeek := Eval( ::bBookMark )
nRows := ::nDataRows
lRefresh := .t.
if ::oSeek != nil
::oSeek:SetText( cSeek )
endif
Eval( ::bBookMark, uBook )
Eval( ::bSkip, 1 - ::nRowSel )
for nFor := 1 to nRows
if Eval( ::bBookMark ) == uSeek
lRefresh := .f.
exit
endif
if Eval( ::bSkip, 1 ) == 0
exit
endif
next
if lRefresh
Eval( ::bBookMark, uSeek )
if ::bChange != nil
Eval( ::bChange, Self )
endif
::Super:Refresh( .F. )
else
Eval( ::bBookMark, uBook )
::DrawLine( .f. )
::nRowSel := nFor
Eval( ::bBookMark, uSeek )
if ::bChange != nil
Eval( ::bChange, Self )
endif
::DrawLine( .t. )
endif
if ::oVScroll != nil
::VSetPos( Eval( ::bKeyNo,,Self ) )
endif
return nil
Otto wrote:Thank you.
I have verion 07.11 and I can't find lRefreshOnlyData 2 times in the methode.
Regards,
Otto
METHOD Seek( cSeek ) CLASS TXBrowse
local uBook, uSeek
local nFor, nRows
local lRefresh
if ::bSeek == nil
return nil
endif
If cSeek == nil
if !Empty(::cSeek)
::cSeek := ""
If ::oSeek != nil
::oSeek:SetText("")
Endif
endif
return nil
Endif
uBook := Eval( ::bBookMark )
if !Eval( ::bSeek, cSeek )
Eval( ::bBookMark, uBook )
MsgBeep()
return nil
endif
if ::nRowSel > Eval( ::bKeyNo )
::nRowsel := 1
else
::lRefreshOnlyData := .t. //<======================here
endif
::cSeek := cSeek
uSeek := Eval( ::bBookMark )
nRows := ::nDataRows
lRefresh := .t.
if ::oSeek != nil
::oSeek:SetText( cSeek )
endif
Eval( ::bBookMark, uBook )
Eval( ::bSkip, 1 - ::nRowSel )
for nFor := 1 to nRows
if Eval( ::bBookMark ) == uSeek
lRefresh := .f.
exit
endif
if Eval( ::bSkip, 1) == 0
exit
endif
next
if lRefresh
Eval( ::bBookMark, uSeek )
if ::bChange != nil
Eval( ::bChange, Self )
endif
// ::lRefreshOnlyData := .t. //<===================here
::Super:Refresh(.f.)
else
Eval( ::bBookMark, uBook )
::DrawLine( .f. )
::nRowSel := nFor
Eval( ::bBookMark, uSeek )
if ::bChange != nil
Eval( ::bChange, Self )
endif
::DrawLine( .t. )
endif
if ::oVScroll != nil
::VSetPos( Eval( ::bKeyNo,,Self ) )
endif
return nil