Using wxStyedTextCtrl

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Antipole
In need of some credit
In need of some credit
Posts: 2
Joined: Thu May 28, 2020 5:38 pm

Using wxStyedTextCtrl

Post by Antipole » Thu May 28, 2020 6:12 pm

Question from a wxWidgets newbie here - I hope I am in the right place...

I am using wxFormBuilder to build an application that allows the user to type JavaScript in a wxTextCtrl window. The application reads text from the window and compiles it using a built-in JavaScript machine. All good here and it works, except that it is a real pain typing JavaScript into a window that knows nothing about tabs, JavaScript syntax etc.

I have discovered in wxFormBuilder support for C++ wxStyedTextCtrl text. This is a huge improvement and using the window in the wxFormBuilder application shows it is what I need. {For my use the differences between C++ and JavaScript syntax are not significant. Note I am not wanting to link into a text editor application - just enter text in a window which knows about tabs and { } pairs etc.

When I build my application, there are missing methods for the window, such as SetTabWidth, SetUseTabs. These methods correspond to the options available in wxFormBuilder for the wxStyedTextCtrl window. It seems I am missing the necessary class definitions. The generated .h files are now including #include <wx/stc/stc.h>, which is where support for scintilla lies. But clearly I am missing something.

Can anyone help me here, please? What am I missing? Might I need to reconfigure wxWidgets and if so, how?

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

Re: Using wxStyedTextCtrl

Post by doublemax » Thu May 28, 2020 7:47 pm

Which platform and wxWidgets version are you using?

Do you get compiler or linker errors? If they are linker errors, add the stintilla library to the CB project. Assuming you're under Windows and using MinGW, the name should be "libwxscintilla.a".
Use the source, Luke!

Antipole
In need of some credit
In need of some credit
Posts: 2
Joined: Thu May 28, 2020 5:38 pm

Re: Using wxStyedTextCtrl

Post by Antipole » Sun Jun 21, 2020 3:25 pm

Only just picked up your reply - thanks.
I am using wxWidgets 3.1.2 - and must use that version for compatibility with the program I am building the plugin for.
I am on Mac OSX Catalina and building using Xcode.
A c++ window in wxFormBuilder gives me the window I need.
The issue was that as soon as soon as I add such a C++ window and generate the code and then build the application, I get lots of missing symbols of wxStyledTextCtrl linker errors. So yes, I guess I need to include in the build something that has the various functions/methods referenced.

Inspired by your feedback, I have included the libwx_osx-cocoau_stc-3.1.2.dylib and all is working as I want. Thank you!

Post Reply