Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
wx2.9.5 Patch for wxWidgets - Contrib Items wx2.9.x
(1/1)
stahta01:
I have found an compile bug/design changed issue caused by wxWidgets 2.9.5
Example Compiler Error
--- Code: ---src\plugins\contrib\wxContribItems\wxchart\src\legendwindow.cpp|34|error: no 'wxObject* wxLegendWindow::wxCreateObject()' member function declared in class 'wxLegendWindow'|
--- End code ---
Reason seems to be the use of wxWidgets Macro DECLARE_CLASS when the correct Macro is DECLARE_DYNAMIC_CLASS in the header file.
It is needed if IMPLEMENT_DYNAMIC_CLASS is used in the source file.
Can an C++ and wxWidgets expect confirm this is correct?
Patch below; it compiles with wxWidgets 2.9.5; but, no other testing has been done.
--- Code: ---Index: src/plugins/contrib/wxContribItems/wxchart/include/wx/yaxiswindow.h
===================================================================
--- src/plugins/contrib/wxContribItems/wxchart/include/wx/yaxiswindow.h (revision 9266)
+++ src/plugins/contrib/wxContribItems/wxchart/include/wx/yaxiswindow.h (working copy)
@@ -86,7 +86,7 @@
void OnPaint(wxPaintEvent &event);
void OnMouse(wxMouseEvent &event);
- DECLARE_CLASS(wxYAxisWindow)
+ DECLARE_DYNAMIC_CLASS(wxYAxisWindow)
DECLARE_EVENT_TABLE()
};
Index: src/plugins/contrib/wxContribItems/wxchart/include/wx/legendwindow.h
===================================================================
--- src/plugins/contrib/wxContribItems/wxchart/include/wx/legendwindow.h (revision 9266)
+++ src/plugins/contrib/wxContribItems/wxchart/include/wx/legendwindow.h (working copy)
@@ -67,7 +67,7 @@
void OnMouse(wxMouseEvent &event);
void OnMouseMove(wxMouseEvent &event);
- DECLARE_CLASS(wxLegendWindow)
+ DECLARE_DYNAMIC_CLASS(wxLegendWindow);
DECLARE_EVENT_TABLE()
};
--- End code ---
Tim S.
Jenna:
I just stumbled across the same issue.
I just committed the fix.
In wx2.8 DECLARE_CLASS and DECLARE_DYNAMIC_CLASS are the same, while in wx2.9 they differ.
The dynamic classes implement a static wxCreateObject function, which is not declared by DECLARE_CLASS.
MortenMacFly:
...I already have a patch pending for this - it just needs testing....
Navigation
[0] Message Index
Go to full version