Autocompleting Combobox and Strings

Share your advanced PureBasic knowledge/code with the community.
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Would you try with this updated version?

http://www.seijin.net/Storage/Code/Autocomplete.pb
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Post by kinglestat »

that was fast work
yes worked straight through
well done

KingLestat
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Post by kinglestat »

I have one more question
I've noticed that pressing the backspace the autocomplete does not find any occurances, even if there are matches

is it supposed to be like that ?

I assume that if a user made a mistake by overtyping, pressing the backspace would help to autocomplete

cheers

KingLestat
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Try again to see if this is the behavior you're looking for ...

http://www.seijin.net/Storage/Code/Autocomplete.pb
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Post by kinglestat »

perfect
do you EVER sleep ?

you're in for a couple of cases of beer should you visit my country
cheers

KingLestat
User avatar
Michael Vogel
Addict
Addict
Posts: 2798
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Post by Michael Vogel »

Sorry to ask - I loaded the last version, inserted the Main.pb from the first mail and did it a try...

click in the middle gadget
press 'J' ('Jack' appears, 'ack' is highlighted)
press backspace ('Jack' gets highlighted)
press backspace ('Jack' stays highlighted, shouldn't it be removed?)
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Oh yes, I sleep. See? I didn't get to Mr. Vogel's bug report until this morning.

http://www.seijin.net/Storage/Code/Autocomplete.pb
quasiperfect
Enthusiast
Enthusiast
Posts: 157
Joined: Tue Feb 13, 2007 6:16 pm
Location: Romania
Contact:

great piece of code

Post by quasiperfect »

hi !

great job on the autocomplete function
i have only one small problem it seams is limited to 2607 items in the array
any update that would support more items or is just me with the 2607 limit ?

this is the code

Code: Select all

Dim Array01.s(0)
For x=0 To 2607
ReDim Array01.s(x)
Array01(x)=randomstring(10)
Next x
i get a invalid memmory acces at this line of code

Code: Select all

MatchText = PeekS(@*Position\FakeString[iLoop])
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Hey. I'd have to see the actual code you're using or at least a small example that exhibits the same behavior.

In the meantime, can you try the updated code listed here:

http://www.purebasic.fr/english/viewtopic.php?t=23248

Also, is there any particular reason you're continuously redim'ming the array in the loop?

Take care.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Hey Xombie -- I just tried out this code and found that if you ac_SetAutocomplete() on a combo that's on a secondary window then close the window with CloseWindow() and re-open it, re-call ac_SetAutocomplete() that it doesn't work.

Will it only work once for any Window?
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Ouch.. Additionally if you call ac_RemoveAutocomplete() on a combo then close the window it's on there is a nasty little crash (references line 778 in the autocomplete code I have. It's the return of the _ac_HandleComboEvents() procedure..
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Why not just let Windows handle the autocomplete stuff ? (if you can require WinMe or newer)

http://www.purebasic.fr/english/viewtopic.php?t=24721
quidquid Latine dictum sit altum videtur
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Ahh.. I hadn't found that post..

I'll reply there with a question.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Karbon - if you're still interested in using these procedures can you give me short code examples for the crashes? I'll get it fixed for you.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

I switched it around to use Freak's Win API implementation..

However, I just put the autocomplete on a combo that was on a window that users can close and open. Once I opened it and the autocomplete was assigned, if I closed and re-opened it the autocomplete never worked again.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Post Reply