From dad0803d489f040937d0242d9ab21f71f8f75f4c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 4 Oct 2002 00:44:55 +0000 Subject: [PATCH] Removed Command() but left an alias git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/frames.i | 4 +--- wxPython/src/msw/frames.cpp | 30 ------------------------------ wxPython/src/msw/frames.py | 4 +--- 3 files changed, 2 insertions(+), 36 deletions(-) diff --git a/wxPython/src/frames.i b/wxPython/src/frames.i index 25989c93f0..619ae6ebe2 100644 --- a/wxPython/src/frames.i +++ b/wxPython/src/frames.i @@ -145,11 +145,9 @@ public: wxMenuBar *GetMenuBar(); - // call this to simulate a menu command - bool Command(int id); - // process menu command: returns TRUE if processed bool ProcessCommand(int id); + %pragma(python) addtoclass = "Command = ProcessCommand" // create the main status bar wxStatusBar* CreateStatusBar(int number = 1, diff --git a/wxPython/src/msw/frames.cpp b/wxPython/src/msw/frames.cpp index 1a9e0c9c15..8d30faa5aa 100644 --- a/wxPython/src/msw/frames.cpp +++ b/wxPython/src/msw/frames.cpp @@ -999,35 +999,6 @@ static PyObject *_wrap_wxFrame_GetMenuBar(PyObject *self, PyObject *args, PyObje return _resultobj; } -#define wxFrame_Command(_swigobj,_swigarg0) (_swigobj->Command(_swigarg0)) -static PyObject *_wrap_wxFrame_Command(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - bool _result; - wxFrame * _arg0; - int _arg1; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self","id", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxFrame_Command",_kwnames,&_argo0,&_arg1)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFrame_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFrame_Command. Expected _wxFrame_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxFrame_Command(_arg0,_arg1); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - #define wxFrame_ProcessCommand(_swigobj,_swigarg0) (_swigobj->ProcessCommand(_swigarg0)) static PyObject *_wrap_wxFrame_ProcessCommand(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2663,7 +2634,6 @@ static PyMethodDef framescMethods[] = { { "wxFrame_GetStatusBar", (PyCFunction) _wrap_wxFrame_GetStatusBar, METH_VARARGS | METH_KEYWORDS }, { "wxFrame_CreateStatusBar", (PyCFunction) _wrap_wxFrame_CreateStatusBar, METH_VARARGS | METH_KEYWORDS }, { "wxFrame_ProcessCommand", (PyCFunction) _wrap_wxFrame_ProcessCommand, METH_VARARGS | METH_KEYWORDS }, - { "wxFrame_Command", (PyCFunction) _wrap_wxFrame_Command, METH_VARARGS | METH_KEYWORDS }, { "wxFrame_GetMenuBar", (PyCFunction) _wrap_wxFrame_GetMenuBar, METH_VARARGS | METH_KEYWORDS }, { "wxFrame_SetMenuBar", (PyCFunction) _wrap_wxFrame_SetMenuBar, METH_VARARGS | METH_KEYWORDS }, { "wxFrame_GetClientAreaOrigin", (PyCFunction) _wrap_wxFrame_GetClientAreaOrigin, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/frames.py b/wxPython/src/msw/frames.py index 26b4e08cff..0fae1a5d20 100644 --- a/wxPython/src/msw/frames.py +++ b/wxPython/src/msw/frames.py @@ -95,9 +95,6 @@ class wxFramePtr(wxTopLevelWindowPtr): def GetMenuBar(self, *_args, **_kwargs): val = apply(framesc.wxFrame_GetMenuBar,(self,) + _args, _kwargs) return val - def Command(self, *_args, **_kwargs): - val = apply(framesc.wxFrame_Command,(self,) + _args, _kwargs) - return val def ProcessCommand(self, *_args, **_kwargs): val = apply(framesc.wxFrame_ProcessCommand,(self,) + _args, _kwargs) return val @@ -145,6 +142,7 @@ class wxFramePtr(wxTopLevelWindowPtr): return val def __repr__(self): return "" % (self.this,) + Command = ProcessCommand class wxFrame(wxFramePtr): def __init__(self,*_args,**_kwargs): self.this = apply(framesc.new_wxFrame,_args,_kwargs)