AutoComplete Textfield Control Open Source [update v.1.0.2]

Hi everyone,

I was hoping that you all could help me regression test this control as I know there are some behavioral things to tweak, but I need others that will use it differently than I. This is so new I don’t have docs yet, but I will be keeping everything on Github here at this link:

https://github.com/IntelligentVisibility/AutoCompleteTextField

Please let me know your feedback.

Please Note The following before you post :slight_smile: :

  • This version is 1.0.1 and Mac OSX has only been tested. I have to make easy mods tomorrow to support Win and Linux which I plan to do

  • I only have the subclassed Textfield for now until we tighten this code base up. Ill easily add the TextArea in the example demo then.

  • Written for Xojo Desktop so far.

  • Open Source using MIT License

  • I purposely used UTF8 encoded plain text for my AutoComplete source textfile. I thought about JSON, but seemed to be more work for no current gain.

Click on the DemoWindow1.AutoCompleteTextfield_Class1 and view the inspector. You will see three options I added for this control.

  • SearchStartPosition
  • UseWordSegments
  • AutoCompleteSourceTextfile

Thank you again and I think this control with your help will turn into a great tool.

Thank you again!

Hi Mike

I couldn’t find the file ac_textfile in the download - do we need to create one ourselves and if so, what does the format need to be?

Thanks for sharing this!

Cheers

Paul

Hi Paul,

Normally you would create your own file and name it what you want and indicate that name in the IDE. However I can include this file for the demo. Its now committed.

The format is UTF-8 with normal system line endings.

Thanks!

This looks good Mike. One thing I noticed -

If you hit the escape key (OS X) you get Apple’s autocomplete dropdown on top of your autocomplete dropdown. You might want to investigate blocking that.

Added to gitHub issues.

thanks for that!

In KeyDown you should add

if me.Text = "" Then Return False

otherwise it crashes when pressing enter and field is empty

[quote=143347:@Peter Fargo]This looks good Mike. One thing I noticed -

If you hit the escape key (OS X) you get Apple’s autocomplete dropdown on top of your autocomplete dropdown. You might want to investigate blocking that.

Added to gitHub issues.[/quote]

Thanks Peter! I also saw your issue on the Github page! I appreciate it since today is “Bug Fix Friday” :slight_smile:

[quote=143367:@Axel Schneider]thanks for that!

In KeyDown you should add

if me.Text = "" Then Return False

otherwise it crashes when pressing enter and field is empty[/quote]
Thanks Axel! I do appreciate this and Ill add to the Github issues list.

Thanks!

Keep them coming everyone :slight_smile: I appreciate the bug finds and and features you may want to see:

https://github.com/IntelligentVisibility/AutoCompleteTextField/issues

Hi MIke, looks really good, useful control. I have added 3 issues on GitHub, nitpicking really but Yosemite graphics issues. Great stuff. I love the enthusiasm you drum up with your custom controls on github, the date time picker was phenomenal

This looks great!

Perfect Mike and thank you!

I have accepted all of them on GIthub and will be working on those this PM :slight_smile: Thank you again for the support!

I am actually finishing up a few bugs on the Calendar/Time Chooser project at this time :wink: Thanks again!

Link again:
https://github.com/IntelligentVisibility/AutoCompleteTextField

[quote=143347:@Peter Fargo]This looks good Mike. One thing I noticed -

If you hit the escape key (OS X) you get Apple’s autocomplete dropdown on top of your autocomplete dropdown. You might want to investigate blocking that.

Added to gitHub issues.[/quote]
To fix that (in keydown event):

if asc(key) = 27 then return True end if

Jason thanks I had figured this out just a few minutes before looking at this. :slight_smile: Thanks and I am glad it wasn’t too crazy :slight_smile:

Update:

Issues Reported: 5
Issues Resolved: 4
Issues invalid: 1

  • Fixed Issue #1 - Conflict w/ OS X Autocomplete

  • Fixed Issue #2 - Crash when keydown on Custom Textfield control

  • Fixed Issue #3 - Container Control mis-alignment causing the Auto Complete listbox to look cutoff

  • Fixed Issue #4 - Linked to the fix of #3

  • Couldn’t Resolve #5 as I am using Xojo native listbox and have no declares for Yosemite translucent behaviors

I have committed these changes and are merged back into the master.

https://github.com/IntelligentVisibility/AutoCompleteTextField

Thank you again everyone!

Images from this project.



This looks great! My only suggestion right now is to move the “Me.SetFocus” out of AutoComplete_Container.AC_Listbox.MouseEnter and have it in the AC_Listbox.MouseMove instead.

Every time I’ve tested this, I’ve clicked in the textbox to get the cursor and then without meaning to, let the mouse move down a bit into the open area below. Then when I start typing, it sees the mouse was there and sets the focus to the listbox and highlights an entry, making it impossible for me to type any more. Moving the SetFocus into the MouseMove fixes that for me.

Anyway, great work, thanks!

Looking Fandabydozee !

link text

Thanks Bill. I will do that as I an “always on the fence” when it comes to usability :slight_smile: thanks!

[quote=143618:@Bill Gookin]This looks great! My only suggestion right now is to move the “Me.SetFocus” out of AutoComplete_Container.AC_Listbox.MouseEnter and have it in the AC_Listbox.MouseMove instead.

Every time I’ve tested this, I’ve clicked in the textbox to get the cursor and then without meaning to, let the mouse move down a bit into the open area below. Then when I start typing, it sees the mouse was there and sets the focus to the listbox and highlights an entry, making it impossible for me to type any more. Moving the SetFocus into the MouseMove fixes that for me.

Anyway, great work, thanks![/quote]
Done! Thanks again Bill!