Subclassing a wx(Rich)TextCtrl show a listbox??

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Subclassing a wx(Rich)TextCtrl show a listbox??

Post by NinjaNL » Wed Feb 04, 2009 12:24 pm

Could someone share any code wrt implementing some sort of intellisense/autocomplete within a (Rich)text control?

Anything that pops up a listbox on some event (key sequence?) would suffice.

I know that this is something that should be simple, but I'm having a bad coffee day.

Has anyone some sample code to share?
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/

User avatar
doublemax
Moderator
Moderator
Posts: 13993
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax » Wed Feb 04, 2009 6:29 pm

in SVN trunk there is autocomplete support for single-line textcontrols and wxStyledTextCtrl. Maybe you can find some "inspiration" there ;)

http://docs.wxwidgets.org/trunk/classwx ... _ctrl.html
Use the source, Luke!

NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL » Thu Feb 05, 2009 4:35 am

Unfortunately, it looks as though autocomplete text controls are windows/gtk only and that the AutoCompleteFileNames function relies on wx_OLE which I don't want.

However it might be possible to take the code from stc and adapt it to be functional in wxRichTextCtrl.

It isn't the autocompletion with which I am concerned, that is just a matter of comparing strings, it is actually showing the listbox on some event.

I have several places where I want to perform autocompletion, and it is the showing of a listbox at a given location on a given event that I wondered about.

Still, if I dive into the STC code, I might never come up for air, but it does offer a start.
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/

Post Reply