FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour dbComboBox and Incremental search
Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
dbComboBox and Incremental search
Posted: Fri Feb 27, 2009 05:12 PM
I have a problem using the incrementeal search of dbComboBox class.
In line 318 method KeyChar
Code (fw): Select all Collapse
if nNewAt != nOldAt .and. nNewAT != 0  // If found and changed
...
ELSE
    ::cSearchKey := left(::cSearchKey,Len(::cSearchKey)-1)
ENDIF

Why must be diferent nNewat and nOldAt?
For example my items are the USA states
ARIZONA
ARKAKANSAS
...
I type "A" and Keychar find it in element 1, then type "R", so I'm searching "AR", found but still on the same position(so cSearchKey will be cut in one position and again will be "A"), i type "K" and KeyChar will serach "AK" instead of "ARK".
I know how to solve just changing the if on line 381, but will have any collateral efect?.
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: dbComboBox and Incremental search
Posted: Fri Feb 27, 2009 05:38 PM

Gabriel,

I wrote the original incremental search code for DBCombo, but a lot has changed since then. Most of that code was moved to TCombobox and this broke DBCombo's search. Then incremental searching was made optional since some people wanted the old first character only search.

I will take a look at your problem as soon as I can and get back to you. It may be a few days.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
Re: dbComboBox and Incremental search
Posted: Tue Jun 16, 2009 02:07 PM

Any news.
If my change fix the problem, will be nice to be included in the Class. Now I must change the source every new FW version.

Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: dbComboBox and Incremental search
Posted: Wed Jun 17, 2009 01:55 PM

Beil,

Sorry, I forgot about it. I have put it on my To Do list and will try to get to it soon.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: dbComboBox and Incremental search
Posted: Tue Dec 15, 2009 01:21 PM

Is there any news?

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: dbComboBox and Incremental search
Posted: Tue Dec 15, 2009 01:58 PM
Hi,

I have changed some lines to be worked incremental search in dbcombo. Can anyone test it to confirm?

Thanks,

Old Line 316:
Code (fw): Select all Collapse
      nNewAT := ascan(::aList, {|x| upper(x) = ::cSearchKey} )


New Line 316:
Code (fw): Select all Collapse
      nNewAT := ascan(::aList, {|x| LEFT(upper(x),LEN(ALLTRIM(::cSearchKey))) = ::cSearchKey} )


Old Line 338:
Code (fw): Select all Collapse
        else
         ::cSearchKey := left(::cSearchKey,Len(::cSearchKey)-1)
      endif


New Line 338:
Code (fw): Select all Collapse
        else
          if Empty(nNewAT)
         ::cSearchKey := left(::cSearchKey,Len(::cSearchKey)-1)
        endif
      endif
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06

Continue the discussion