wxStyledTextCtrl

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
chadman
Experienced Solver
Experienced Solver
Posts: 70
Joined: Wed Mar 23, 2005 8:28 am

wxStyledTextCtrl

Post by chadman » Mon May 09, 2005 6:04 am

Hey, I'm looking into using wxStyledTextCtrl in an application I'm working on, but I can't really get a simple app that uses it to compile. I get all kinds of unresolved external errors, like this:

Code: Select all

maintemplate_maintemplate.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ScintillaWX::AddToPopUp(char const *,int,bool)" ([email protected]@@[email protected])
maintemplate_maintemplate.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ScintillaWX::CreateCallTipWindow(class PRectangle)" ([email protected]@@[email protected]@@Z)
maintemplate_maintemplate.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall ScintillaWX::WndProc(unsigned int,unsigned long,long)" ([email protected]@@[email protected])
maintemplate_maintemplate.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall ScintillaWX::DefWndProc(unsigned int,unsigned long,long)" ([email protected]@@[email protected])
maintemplate_maintemplate.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall ScintillaWX::HaveMouseCapture(void)" ([email protected]@@UAE_NXZ)
maintemplate_maintemplate.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ScintillaWX::SetMouseCapture(bool)" ([email protected]@@[email protected])
maintemplate_maintemplate.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall ScintillaWX::SetIdle(bool)" ([email protected]@@[email protected])
maintemplate_maintemplate.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ScintillaWX::SetTicking(bool)" ([email protected]@@[email protected])
I'd really like to use it though. This attempt is actually based on the example on the corresponding Wiki page. Can someone give me a better example, just a bare-bones example that uses wxStyledTextCtrl? Better yet, here is a template file I always use - maybe someone could just plug it into that. Just something that gets one of those controls in the main window - that's it, nothing fancy. You can e-mail it to me (chad.d.johnson AT gmail.com) or whatever.

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Mon May 09, 2005 6:41 am

Hi!
Did you add the wxmsw26_stc.lib in your project linker settings?
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

chadman
Experienced Solver
Experienced Solver
Posts: 70
Joined: Wed Mar 23, 2005 8:28 am

Post by chadman » Mon May 09, 2005 12:44 pm

Dude. Sweet.

I've been wondering, what do the library files (.lib) even do? Why do you have to link them in and why does it not work to just #include the files?

Also, I haven't looked at the docs extensively for Scintilla yet, but does it let you take away that brownish/grayish border on the left? Does it also let you change the background color for selecting text (e.g. it's blue for Win32, but gray here)?

Avi
Super wx Problem Solver
Super wx Problem Solver
Posts: 398
Joined: Mon Aug 30, 2004 9:27 pm
Location: Tel-Aviv, Israel

Post by Avi » Mon May 09, 2005 12:50 pm

The includes just have the definitions in them... meaning the function's name and signature (return value, parameters)... The .lib files contain the actual function's code... meaning what it does. That is why you have to link your .obj object files (or .o when using GCC) to the .lib library files (or .a when using GCC)...

chadman
Experienced Solver
Experienced Solver
Posts: 70
Joined: Wed Mar 23, 2005 8:28 am

Another question

Post by chadman » Tue May 10, 2005 4:13 am

Well I've played around with it and it seems pretty cool.

I can't, however, figure out how to change the background color of a range of text. Is there a way to do this? This is really what I was planning on using this control for.

Also, is this control derived from wxTextCtrl, or is it pretty much done form scratch?

Avi
Super wx Problem Solver
Super wx Problem Solver
Posts: 398
Joined: Mon Aug 30, 2004 9:27 pm
Location: Tel-Aviv, Israel

Re: Another question

Post by Avi » Tue May 10, 2005 5:18 am

chadman wrote: Also, is this control derived from wxTextCtrl, or is it pretty much done form scratch?

Code: Select all

class WXDLLIMPEXP_STC wxStyledTextCtrl : public wxControl {
From scratch... ;)

Post Reply