Compiling wxWidgets for 10.4?

Kinniken said:
Oh, concerning step one, I have to admit I forgot how you call a parent's function when overloading it in a child class (apart from constructors)... Do you remember?

I haven't used wxWidgets for a while, and I'm not certain of the other bits of your questions. This I am certain. To call your parent classes method, just do ParentClass::methodname(). It's simple :D.

I'm a little fuzzy on the message map pattern. If it is anything similar to the observer pattern common in other OO libraries (or signal/slots in Qt), you should be able to bind a message to any method, even multiple methods to a single message. In lieu of any better advice, you could just play around with what you think should work. In my experience, C++ is usually quite consistent :):ha::) and what you think would work normally does.
 
Quick and (hopefully) easy C++ question... how do I initialise a static const table of either strings or char* in one of my class? I tried things like:

static const char** myStrings = {"s1","s2","s3"};

or

static const string* myStrings = {"s1","s2","s3"};

But the compiler refuses them...
 
Kinniken said:
Quick and (hopefully) easy C++ question... how do I initialise a static const table of either strings or char* in one of my class? I tried things like:

static const char** myStrings = {"s1","s2","s3"};

or

static const string* myStrings = {"s1","s2","s3"};

But the compiler refuses them...

Code:
static const string a[] = {"hello", "I", "b"};

That seems to work fine. That how I normally deal with arrays, probably due to the fact that I program in Java. Don't ask me what the difference is though... :D
 
It doesn't work :( :

UTC.h:69: error: a brace-enclosed initializer is not allowed here before '{' token
UTC.h:69: error: invalid in-class initialization of static data member of non-integral type 'const std::string []'
 
I guess I'll just use global constants until I find a better way.

In the meantime, I have yet an other question... How do you create a multi-line wxTextCtrl? According to the doc I thought txAdresse->SetWindowStyle(wxTE_MULTILINE); would do it but it seems to have no effect...
 
Static constants do not get defined in the .h file. They get defined in the .cpp file. In the header file, you need to have an 'extern' reference to the constant. Something like extern const std::string a[];
 
I'm pleased to say that I'm about done with that project :D
Only a few wrinkles to iron out (like that annoying vector sorting problem) and I'll be done.

Thanks for your help, you saved me many fruitless hours peering at stupid bugs :)
 
Back
Top