Jump to content


Photo

Autocomplete property on TNXComboBox


  • Please log in to reply
14 replies to this topic

#1 Marc

Marc
  • Members
  • 62 posts

Posted 19 February 2007 - 02:31 AM

Hi,

I think it will be cool to add a "Autocomplete" property on TNXComboBox to complete input automatically with strings found in combo list.

Like standard TComboBox

cool.gif

#2 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 19 February 2007 - 10:15 AM

u already have the TnxAutoComplete component
that u can attach to any component u want

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,195 posts
  • Gender:Male

Posted 20 February 2007 - 07:03 AM

Hello,

Yes, this component is located in Packages\NxAddonsRun.dpk package (great thanks to Wim).

If you wish, I may add property AutoComplete to point to NxAutoComplete component?

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#4 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 20 February 2007 - 11:06 AM

add an autocomplete to nxcombobox?

but currently autocomplete has a link to a component
which is more generic, i think it should stay that way

#5 Marc

Marc
  • Members
  • 62 posts

Posted 20 February 2007 - 11:49 AM

QUOTE (emailaya @ Feb 19 2007, 10:15 AM) <{POST_SNAPBACK}>
u already have the TnxAutoComplete component
that u can attach to any component u want


In DBGRid, it's not automatic, we must add lines code in events to work with it

QUOTE (Boki (Berg) @ Feb 20 2007, 07:03 AM) <{POST_SNAPBACK}>
Hello,

Yes, this component is located in Packages\NxAddonsRun.dpk package (great thanks to Wim).

If you wish, I may add property AutoComplete to point to NxAutoComplete component?

regards


It would be well !

smile.gif

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,195 posts
  • Gender:Male

Posted 21 February 2007 - 12:31 AM

Hello,

In that case, NxAutoComplete must be added to NxCommonRun package.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#7 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 21 February 2007 - 01:32 AM

Hi All,

QUOTE (Boki (Berg) @ Feb 21 2007, 12:31 AM) <{POST_SNAPBACK}>
In that case, NxAutoComplete must be added to NxCommonRun package.


Some remarks on Autocompletion. As it's using the windows api making it part of the core of NxCommonRun isn't a good idea because it breaks the pure vcl (and I like that very much btw). I wrote it especially the way it is so i would have to change the rest of the NextSuite for a feature I liked having myself and was fun to write. It links to a component and not the other way round (as it would not work on other vcl's like plain TEdit's anymore).

Beware it's a tricky windows api you're tapping into that might not be that portable between operating systems (I tested it on winxp pro only). Thats the reason why i think it should remain in a separate package and not linked hard into the rest of the suite.

Autocompletion will never be easy on a grid as you probably want it on some columns only and perhaps different between column. So you'll end up with either a bunch of autocompletions or just add the code (a few lines) and have a single one that is working as it should. Autocompletion cannot work on the grid, it can only work on the editor when it's visible. And because it only exists during the editing cycle linking a grid to autocompletion makes no sense.

Personally I cannot see a reason to sacrifice pure vcl for the sake of not having to add those few lines (where these lines will be necessary very soon anyway). Bottom line: if you like the AutoCompletion component, just add the lines to the grid and you'll notice that it's more powerfull that way.
G.W. van der Vegt

#8 Marc

Marc
  • Members
  • 62 posts

Posted 21 February 2007 - 01:36 AM

ok

I'm trying to put a NXAutocomplete with my DBGrid as shown in tutorial web page.

It works fine, but when I enter characters Tab cannot be use to exit the edited column. Without autocomplete, TAB character has good comportement and cursor switch to next input control

#9 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 21 February 2007 - 10:46 AM

is there a chance that autocompletion wont work under old windows
like me, 2000 etc?

#10 Marc

Marc
  • Members
  • 62 posts

Posted 21 February 2007 - 03:29 PM

QUOTE (emailaya @ Feb 21 2007, 10:46 AM) <{POST_SNAPBACK}>
is there a chance that autocompletion wont work under old windows
like me, 2000 etc?


TAB key don't work with Autocomplete linked to a inplace dbgrid combobox sad.gif

#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,195 posts
  • Gender:Male

Posted 21 February 2007 - 06:04 PM

Hello Marc,

There are 2 possibilities:

1) When WantTabs is set to True, next item in TNxAutoCompletion popup will be selected.
2) When WantTabs is set to False, next control will be selected as usuall.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#12 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 21 February 2007 - 11:52 PM

Hi,

QUOTE (Marc @ Feb 21 2007, 01:36 AM) <{POST_SNAPBACK}>
I'm trying to put a NXAutocomplete with my DBGrid as shown in tutorial web page.

It works fine, but when I enter characters Tab cannot be use to exit the edited column. Without autocomplete, TAB character has good comportement and cursor switch to next input control


In the autocomplete stuff there is no character passed, so there is no way to fix behaviour like this other than workaround. The api says once a selection is made the control should behave like it's typed in by the user (but hey it's microsoft doing a promise for their own controls).

You might try to add aoUseTab to TnxAcOption and add ACO_USETAB Options in TnxAutoCompletion.Setup, recompile and see what it does. A number of IAutoComplete2 options are not made public.

Let me know what it does.
G.W. van der Vegt

#13 Marc

Marc
  • Members
  • 62 posts

Posted 22 February 2007 - 12:16 AM

QUOTE (wvd_vegt @ Feb 21 2007, 11:52 PM) <{POST_SNAPBACK}>
Hi,
In the autocomplete stuff there is no character passed, so there is no way to fix behaviour like this other than workaround. The api says once a selection is made the control should behave like it's typed in by the user (but hey it's microsoft doing a promise for their own controls).

You might try to add aoUseTab to TnxAcOption and add ACO_USETAB Options in TnxAutoCompletion.Setup, recompile and see what it does. A number of IAutoComplete2 options are not made public.

Let me know what it does.


It doesn't work sad.gif

#14 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 22 February 2007 - 02:10 AM

Hi,

QUOTE (Marc @ Feb 22 2007, 12:16 AM) <{POST_SNAPBACK}>
It doesn't work sad.gif


I was afraid of that. I'll make the option public anyway (as it will not harm).
G.W. van der Vegt

#15 Marc

Marc
  • Members
  • 62 posts

Posted 22 February 2007 - 03:04 PM

QUOTE (wvd_vegt @ Feb 22 2007, 02:10 AM) <{POST_SNAPBACK}>
Hi,
I was afraid of that.


me too sad.gif sad.gif




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users