Yes, there are differences between constructors.
wxWidgets 2.8.10:
void wxGLCanvas(wxWindow* parent,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style=0,
const wxString& name="GLCanvas",
int* attribList = 0,
const wxPalette& palette = wxNullPalette)
wxWidgets 2.9:
wxGLCanvas (wxWindow *parent,
wxWindowID id=wxID_ANY,
const int *attribList=NULL,
const wxPoint &pos=wxDefaultPosition,
const wxSize &size=wxDefaultSize,
long style=0,
const wxString &name="GLCanvas",
const wxPalette &palette=wxNullPalette)
The attribList parameter shifts from last to third position between the 2 wxWidgets versions - and it gives a compiler mistakes.
It is true that the patch will break the 2.8.10 constructor (not a so good solution).
Therefore I propose the following change:
ORIGINAL CODE:
#if wxCHECK_VERSION(2, 9, 0)
Codef(_T("%C(%W, %I, %P, %S, %T, %N, %v);\n"),aname.wx_str());
#else
Codef(_T("%C(%W, %I, %P, %S, %T, %N, %v);\n"),aname.c_str());
#endif
NEW CODE:
#if wxCHECK_VERSION(2, 9, 0)
Codef(_T("#if wxCHECK_VERSION(2, 9, 0)\n"),aname.wx_str());
Codef(_T("%C(%W, %I, %v, %P, %S, %T, %N);\n"),aname.wx_str());
Codef(_T("#else\n"),aname.wx_str());
Codef(_T("%C(%W, %I, %P, %S, %T, %N, %v);\n"),aname.wx_str());
Codef(_T("#endif\n"),aname.wx_str());
#else
Codef(_T("#if wxCHECK_VERSION(2, 9, 0)\n"),aname.c_str());
Codef(_T("%C(%W, %I, %v, %P, %S, %T, %N);\n"),aname.c_str());
Codef(_T("#else\n"),aname.c_str());
Codef(_T("%C(%W, %I, %P, %S, %T, %N, %v);\n"),aname.c_str());
Codef(_T("#endif\n"),aname.c_str());
#endif
That will put a wxCHECK_VERSION directive in the user code - therefore
wxSmith will adapt itself directly to the user choice.
I have tested it this morning - here is the result code generated by wxSmith:
int GLCanvasAttributes_1[] = {
WX_GL_RGBA,
WX_GL_DOUBLEBUFFER,
WX_GL_DEPTH_SIZE, 16,
WX_GL_STENCIL_SIZE, 0,
0, 0 };
#if wxCHECK_VERSION(2, 9, 0)
GLCanvas1 = new wxGLCanvas(this, ID_GLCANVAS1, GLCanvasAttributes_1, wxDefaultPosition, wxSize(60,180), 0, _T("ID_GLCANVAS1"));
#else
GLCanvas1 = new wxGLCanvas(this, ID_GLCANVAS1, wxDefaultPosition, wxSize(60,180), 0, _T("ID_GLCANVAS1"), GLCanvasAttributes_1);
#endif
and it compiles perfectly well on my computer.
I attach also a patch (done against trunk this morning):
[attachment deleted by admin]