Added name to wxShapeCanvas ctor for consistency

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-07-06 04:14:52 +00:00
parent e2e02194a9
commit 4fcf77bc06
5 changed files with 45 additions and 12 deletions

View File

@@ -23,6 +23,8 @@
#define StartDraggingRight 3 #define StartDraggingRight 3
#define ContinueDraggingRight 4 #define ContinueDraggingRight 4
extern wxChar* wxShapeCanvasNameStr;
// When drag_count reaches 0, process drag message // When drag_count reaches 0, process drag message
class wxDiagram; class wxDiagram;
@@ -31,8 +33,11 @@ class wxShapeCanvas: public wxScrolledWindow
{ {
DECLARE_DYNAMIC_CLASS(wxShapeCanvas) DECLARE_DYNAMIC_CLASS(wxShapeCanvas)
public: public:
wxShapeCanvas(wxWindow *parent = NULL, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, wxShapeCanvas(wxWindow *parent = NULL, wxWindowID id = -1,
long style = wxBORDER | wxRETAINED); const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxBORDER | wxRETAINED,
const wxString& name = wxShapeCanvasNameStr);
~wxShapeCanvas(); ~wxShapeCanvas();
inline void SetDiagram(wxDiagram *diag) { m_shapeDiagram = diag; } inline void SetDiagram(wxDiagram *diag) { m_shapeDiagram = diag; }
@@ -54,7 +59,7 @@ class wxShapeCanvas: public wxScrolledWindow
virtual wxShape *FindShape(double x, double y, int *attachment, wxClassInfo *info = NULL, wxShape *notImage = NULL); virtual wxShape *FindShape(double x, double y, int *attachment, wxClassInfo *info = NULL, wxShape *notImage = NULL);
wxShape *FindFirstSensitiveShape(double x, double y, int *new_attachment, int op); wxShape *FindFirstSensitiveShape(double x, double y, int *new_attachment, int op);
wxShape *FindFirstSensitiveShape1(wxShape *image, int op); wxShape *FindFirstSensitiveShape1(wxShape *image, int op);
// Redirect to wxDiagram object // Redirect to wxDiagram object
virtual void AddShape(wxShape *object, wxShape *addAfter = NULL); virtual void AddShape(wxShape *object, wxShape *addAfter = NULL);
virtual void InsertShape(wxShape *object); virtual void InsertShape(wxShape *object);

View File

@@ -68,9 +68,15 @@ BEGIN_EVENT_TABLE(wxShapeCanvas, wxScrolledWindow)
EVT_MOUSE_EVENTS(wxShapeCanvas::OnMouseEvent) EVT_MOUSE_EVENTS(wxShapeCanvas::OnMouseEvent)
END_EVENT_TABLE() END_EVENT_TABLE()
wxChar* wxShapeCanvasNameStr = wxT("shapeCanvas");
// Object canvas // Object canvas
wxShapeCanvas::wxShapeCanvas(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style): wxShapeCanvas::wxShapeCanvas(wxWindow *parent, wxWindowID id,
wxScrolledWindow(parent, id, pos, size, style) const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name):
wxScrolledWindow(parent, id, pos, size, style, name)
{ {
m_shapeDiagram = NULL; m_shapeDiagram = NULL;
m_dragState = NoDragging; m_dragState = NoDragging;

View File

@@ -85,6 +85,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
return target; return target;
} }
// Put some wx default wxChar* values into wxStrings.
DECLARE_DEF_STRING(ShapeCanvasNameStr);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragLeft); IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragLeft);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragRight); IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragRight);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnEndDragLeft); IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnEndDragLeft);
@@ -1157,7 +1160,7 @@ static void *SwigwxPyShapeCanvasTowxObject(void *ptr) {
return (void *) dest; return (void *) dest;
} }
#define new_wxPyShapeCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4) (new wxPyShapeCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4)) #define new_wxPyShapeCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5) (new wxPyShapeCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5))
static PyObject *_wrap_new_wxPyShapeCanvas(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_new_wxPyShapeCanvas(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;
wxPyShapeCanvas * _result; wxPyShapeCanvas * _result;
@@ -1166,16 +1169,18 @@ static PyObject *_wrap_new_wxPyShapeCanvas(PyObject *self, PyObject *args, PyObj
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxDefaultSize; wxSize * _arg3 = (wxSize *) &wxDefaultSize;
long _arg4 = (long ) wxBORDER; long _arg4 = (long ) wxBORDER;
wxString * _arg5 = (wxString *) &wxPyShapeCanvasNameStr;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
wxPoint temp; wxPoint temp;
PyObject * _obj2 = 0; PyObject * _obj2 = 0;
wxSize temp0; wxSize temp0;
PyObject * _obj3 = 0; PyObject * _obj3 = 0;
char *_kwnames[] = { "parent","id","pos","size","style", NULL }; PyObject * _obj5 = 0;
char *_kwnames[] = { "parent","id","pos","size","style","name", NULL };
char _ptemp[128]; char _ptemp[128];
self = self; self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OiOOl:new_wxPyShapeCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4)) if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OiOOlO:new_wxPyShapeCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5))
return NULL; return NULL;
if (_argo0) { if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; } if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -1195,10 +1200,16 @@ static PyObject *_wrap_new_wxPyShapeCanvas(PyObject *self, PyObject *args, PyObj
_arg3 = &temp0; _arg3 = &temp0;
if (! wxSize_helper(_obj3, &_arg3)) if (! wxSize_helper(_obj3, &_arg3))
return NULL; return NULL;
}
if (_obj5)
{
_arg5 = wxString_in_helper(_obj5);
if (_arg5 == NULL)
return NULL;
} }
{ {
PyThreadState* __tstate = wxPyBeginAllowThreads(); PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxPyShapeCanvas *)new_wxPyShapeCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4); _result = (wxPyShapeCanvas *)new_wxPyShapeCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5);
wxPyEndAllowThreads(__tstate); wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL; if (PyErr_Occurred()) return NULL;
@@ -1209,6 +1220,10 @@ static PyObject *_wrap_new_wxPyShapeCanvas(PyObject *self, PyObject *args, PyObj
Py_INCREF(Py_None); Py_INCREF(Py_None);
_resultobj = Py_None; _resultobj = Py_None;
} }
{
if (_obj5)
delete _arg5;
}
return _resultobj; return _resultobj;
} }

View File

@@ -37,6 +37,11 @@
%pragma(python) code = "import wx" %pragma(python) code = "import wx"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
%{
// Put some wx default wxChar* values into wxStrings.
DECLARE_DEF_STRING(ShapeCanvasNameStr);
%}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@@ -114,7 +119,8 @@ public:
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1, wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxBORDER); long style = wxBORDER,
const wxString& name = wxPyShapeCanvasNameStr);
void _setCallbackInfo(PyObject* self, PyObject* _class); void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyShapeCanvas)" %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyShapeCanvas)"

View File

@@ -115,8 +115,9 @@ public:
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1, wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxBORDER) long style = wxBORDER,
: wxShapeCanvas(parent, id, pos, size, style) {} const wxString& name = wxT("shapeCanvas"))
: wxShapeCanvas(parent, id, pos, size, style, name) {}
DEC_PYCALLBACK__2DBLINT(OnBeginDragLeft); DEC_PYCALLBACK__2DBLINT(OnBeginDragLeft);
DEC_PYCALLBACK__2DBLINT(OnBeginDragRight); DEC_PYCALLBACK__2DBLINT(OnBeginDragRight);