I want to implement autocorrect on my wxTextCtrl but I don't want it to be a dropdown menu with options. Instead, I want it to have text that appears in front of the text that has already been inputted and attempt to predict what the final input is going to be. When the additional text is clicked or tab is pressed while in the wxTextCtrl then the additional text is appended to the input text, otherwise it acts like its not there. To make it clear that the additional text is not part of the input yet I want it to be grey. Example: wxWidgets
Google's search engine has this feature to except the additional text is highlighted and not grey.
I don't need help with predicting the final input, just displaying the additional text.
wxTextCtrl greyed out "autocorrect" text Topic is solved
-
- Earned a small fee
- Posts: 20
- Joined: Wed Jun 01, 2022 5:49 pm
Re: wxTextCtrl greyed out "autocorrect" text
That may be quite difficult with a native control. You'll have to add the predicted part of the word to the text with a different style. Keep track of its position. And when the user types, you'll have to update the text and style accordingly.
Use the source, Luke!
Re: wxTextCtrl greyed out "autocorrect" text
Hi,
This is not autocorrect, but autocompletion.
Check the widgets sample - it shows how to implement it.
Thank you.
This is not autocorrect, but autocompletion.
Check the widgets sample - it shows how to implement it.
Thank you.
-
- Earned a small fee
- Posts: 20
- Joined: Wed Jun 01, 2022 5:49 pm
Re: wxTextCtrl greyed out "autocorrect" text
Can you give me a link for the sample? Couldn't find it.
Re: wxTextCtrl greyed out "autocorrect" text
Hi,
What OS do you use? Did you install the library or build it yourself?
Thank you.
What OS do you use? Did you install the library or build it yourself?
Thank you.
Re: wxTextCtrl greyed out "autocorrect" text
The "text" sample shows how to use the spell checking of native controls (if supported by the platform), but you can not affect the dictionary or how its visualized. So i don't think that works for you.
https://docs.wxwidgets.org/trunk/classw ... 6495c43653
https://docs.wxwidgets.org/trunk/classw ... 6495c43653
Use the source, Luke!