dbComboBox and Incremental search

dbComboBox and Incremental search

Postby Biel EA6DD » Fri Feb 27, 2009 5:12 pm

I have a problem using the incrementeal search of dbComboBox class.
In line 318 method KeyChar
Code: Select all  Expand view

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/
User avatar
Biel EA6DD
 
Posts: 682
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca

Re: dbComboBox and Incremental search

Postby James Bott » Fri Feb 27, 2009 5: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: dbComboBox and Incremental search

Postby Biel EA6DD » Tue Jun 16, 2009 2: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/
User avatar
Biel EA6DD
 
Posts: 682
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca

Re: dbComboBox and Incremental search

Postby James Bott » Wed Jun 17, 2009 1: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: dbComboBox and Incremental search

Postby Horizon » Tue Dec 15, 2009 1:21 pm

Is there any news?
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: dbComboBox and Incremental search

Postby Horizon » Tue Dec 15, 2009 1: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: Select all  Expand view
     nNewAT := ascan(::aList, {|x| upper(x) = ::cSearchKey} )
 


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


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


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

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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