Implemented the first phase of OOR (Original Object Return). See the
text in the demo for more details of what this means, but in a nutshell methods such as wxWindow.GetParent or FindWindowById will now return a shadow object of the proper type if it can. By "proper type" I mean that if the wxWindow pointer returned from FindWindowById really points to a wxButton then the Python object constructed will be of a wxButtonPtr class instead of wxWindowPtr as before. This should reduce or eliminiate the need for wxPyTypeCast. (Woo Hoo!) The objects returned are still not the original Python object, but that is the next step. (Although it will probably only work on Python 2.1 and beyond because it will use weak references.) A few other minor tweaks and fixes and additions for things found while doing the OOR stuff. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -108,6 +108,7 @@ wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList);
|
||||
// virtual callbacks into Python callbacks.
|
||||
|
||||
class wxPyShapeCanvas : public wxShapeCanvas {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyShapeCanvas);
|
||||
public:
|
||||
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
@@ -130,6 +131,7 @@ public:
|
||||
|
||||
|
||||
class wxPyShapeEvtHandler : public wxShapeEvtHandler {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyShapeEvtHandler);
|
||||
public:
|
||||
wxPyShapeEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL)
|
||||
: wxShapeEvtHandler(prev, shape) {}
|
||||
@@ -139,6 +141,7 @@ public:
|
||||
|
||||
|
||||
class wxPyShape : public wxShape {
|
||||
DECLARE_ABSTRACT_CLASS(wxPyShape);
|
||||
public:
|
||||
wxPyShape(wxPyShapeCanvas *can = NULL)
|
||||
: wxShape(can) {}
|
||||
@@ -149,6 +152,7 @@ public:
|
||||
|
||||
|
||||
class wxPyRectangleShape : public wxRectangleShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyRectangleShape);
|
||||
public:
|
||||
wxPyRectangleShape(double width = 0.0, double height = 0.0)
|
||||
: wxRectangleShape(width, height) {}
|
||||
@@ -157,6 +161,7 @@ public:
|
||||
};
|
||||
|
||||
class wxPyControlPoint : public wxControlPoint {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyControlPoint);
|
||||
public:
|
||||
wxPyControlPoint(wxPyShapeCanvas *the_canvas = NULL,
|
||||
wxPyShape *object = NULL,
|
||||
@@ -171,6 +176,7 @@ public:
|
||||
|
||||
|
||||
class wxPyBitmapShape : public wxBitmapShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyBitmapShape);
|
||||
public:
|
||||
wxPyBitmapShape() : wxBitmapShape() {}
|
||||
|
||||
@@ -180,6 +186,7 @@ public:
|
||||
|
||||
|
||||
class wxPyDrawnShape : public wxDrawnShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyDrawnShape);
|
||||
public:
|
||||
wxPyDrawnShape() : wxDrawnShape() {}
|
||||
|
||||
@@ -188,6 +195,7 @@ public:
|
||||
|
||||
|
||||
class wxPyCompositeShape : public wxCompositeShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyCompositeShape);
|
||||
public:
|
||||
wxPyCompositeShape() : wxCompositeShape() {}
|
||||
|
||||
@@ -196,6 +204,7 @@ public:
|
||||
|
||||
|
||||
class wxPyDividedShape : public wxDividedShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyDividedShape);
|
||||
public:
|
||||
wxPyDividedShape(double width = 0.0, double height = 0.0)
|
||||
: wxDividedShape(width, height) {}
|
||||
@@ -205,6 +214,7 @@ public:
|
||||
|
||||
|
||||
class wxPyDivisionShape : public wxDivisionShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyDivisionShape);
|
||||
public:
|
||||
wxPyDivisionShape() : wxDivisionShape() {}
|
||||
|
||||
@@ -213,6 +223,7 @@ public:
|
||||
|
||||
|
||||
class wxPyEllipseShape : public wxEllipseShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyEllipseShape);
|
||||
public:
|
||||
wxPyEllipseShape(double width = 0.0, double height = 0.0)
|
||||
: wxEllipseShape(width, height) {}
|
||||
@@ -222,6 +233,7 @@ public:
|
||||
|
||||
|
||||
class wxPyCircleShape : public wxCircleShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyCircleShape);
|
||||
public:
|
||||
wxPyCircleShape(double width = 0.0)
|
||||
: wxCircleShape(width) {}
|
||||
@@ -231,6 +243,7 @@ public:
|
||||
|
||||
|
||||
class wxPyLineShape : public wxLineShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyLineShape);
|
||||
public:
|
||||
wxPyLineShape() : wxLineShape() {}
|
||||
|
||||
@@ -239,6 +252,7 @@ public:
|
||||
|
||||
|
||||
class wxPyPolygonShape : public wxPolygonShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyPolygonShape);
|
||||
public:
|
||||
wxPyPolygonShape() : wxPolygonShape() {}
|
||||
|
||||
@@ -247,6 +261,7 @@ public:
|
||||
|
||||
|
||||
class wxPyTextShape : public wxTextShape {
|
||||
DECLARE_DYNAMIC_CLASS(wxPyTextShape);
|
||||
public:
|
||||
wxPyTextShape(double width = 0.0, double height = 0.0)
|
||||
: wxTextShape(width, height) {}
|
||||
@@ -260,3 +275,4 @@ public:
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user