Added sample to the demo for wxJoystick
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10237 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -5714,6 +5714,33 @@ static PyObject *_wrap_new_wxJoystick(PyObject *self, PyObject *args, PyObject *
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define delete_wxJoystick(_swigobj) (delete _swigobj)
|
||||
static PyObject *_wrap_delete_wxJoystick(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxJoystick * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxJoystick",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxJoystick. Expected _wxJoystick_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
delete_wxJoystick(_arg0);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxJoystick_GetPosition(_swigobj) (_swigobj->GetPosition())
|
||||
static PyObject *_wrap_wxJoystick_GetPosition(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
@@ -7060,6 +7087,7 @@ static PyMethodDef misc2cMethods[] = {
|
||||
{ "wxJoystick_GetButtonState", (PyCFunction) _wrap_wxJoystick_GetButtonState, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxJoystick_GetZPosition", (PyCFunction) _wrap_wxJoystick_GetZPosition, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxJoystick_GetPosition", (PyCFunction) _wrap_wxJoystick_GetPosition, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "delete_wxJoystick", (PyCFunction) _wrap_delete_wxJoystick, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxJoystick", (PyCFunction) _wrap_new_wxJoystick, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxProcess_CloseOutput", (PyCFunction) _wrap_wxProcess_CloseOutput, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxProcess_GetOutputStream", (PyCFunction) _wrap_wxProcess_GetOutputStream, METH_VARARGS | METH_KEYWORDS },
|
||||
|
||||
@@ -492,6 +492,9 @@ class wxJoystickPtr(wxObjectPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def __del__(self,misc2c=misc2c):
|
||||
if self.thisown == 1 :
|
||||
misc2c.delete_wxJoystick(self)
|
||||
def GetPosition(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxJoystick_GetPosition,(self,) + _args, _kwargs)
|
||||
if val: val = wxPointPtr(val) ; val.thisown = 1
|
||||
|
||||
@@ -1341,6 +1341,34 @@ static PyObject *_wrap_wxWindow_DestroyChildren(PyObject *self, PyObject *args,
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxWindow_IsBeingDeleted(_swigobj) (_swigobj->IsBeingDeleted())
|
||||
static PyObject *_wrap_wxWindow_IsBeingDeleted(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
bool _result;
|
||||
wxWindow * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_IsBeingDeleted",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_IsBeingDeleted. Expected _wxWindow_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
_result = (bool )wxWindow_IsBeingDeleted(_arg0);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} _resultobj = Py_BuildValue("i",_result);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxWindow_DragAcceptFiles(_swigobj,_swigarg0) (_swigobj->DragAcceptFiles(_swigarg0))
|
||||
static PyObject *_wrap_wxWindow_DragAcceptFiles(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
@@ -10534,6 +10562,7 @@ static PyMethodDef windowscMethods[] = {
|
||||
{ "wxWindow_FindWindowById", (PyCFunction) _wrap_wxWindow_FindWindowById, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxWindow_Enable", (PyCFunction) _wrap_wxWindow_Enable, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxWindow_DragAcceptFiles", (PyCFunction) _wrap_wxWindow_DragAcceptFiles, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxWindow_IsBeingDeleted", (PyCFunction) _wrap_wxWindow_IsBeingDeleted, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxWindow_DestroyChildren", (PyCFunction) _wrap_wxWindow_DestroyChildren, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxWindow_Destroy", (PyCFunction) _wrap_wxWindow_Destroy, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxWindow_Close", (PyCFunction) _wrap_wxWindow_Close, METH_VARARGS | METH_KEYWORDS },
|
||||
|
||||
@@ -146,6 +146,9 @@ class wxWindowPtr(wxEvtHandlerPtr):
|
||||
def DestroyChildren(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxWindow_DestroyChildren,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def IsBeingDeleted(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxWindow_IsBeingDeleted,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def DragAcceptFiles(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxWindow_DragAcceptFiles,(self,) + _args, _kwargs)
|
||||
return val
|
||||
|
||||
@@ -1462,10 +1462,10 @@ def EVT_END_PROCESS(eh, id, func):
|
||||
|
||||
# wxJoyStick
|
||||
def EVT_JOY_DOWN(win, func):
|
||||
win.Connect(-1, -1, wxEVT_JOY_DOWN, func)
|
||||
win.Connect(-1, -1, wxEVT_JOY_BUTTON_DOWN, func)
|
||||
|
||||
def EVT_JOY_UP(win, func):
|
||||
win.Connect(-1, -1, wxEVT_JOY_UP, func)
|
||||
win.Connect(-1, -1, wxEVT_JOY_BUTTON_UP, func)
|
||||
|
||||
def EVT_JOY_MOVE(win, func):
|
||||
win.Connect(-1, -1, wxEVT_JOY_MOVE, func)
|
||||
@@ -1474,8 +1474,8 @@ def EVT_JOY_ZMOVE(win, func):
|
||||
win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func)
|
||||
|
||||
def EVT_JOYSTICK_EVENTS(win, func):
|
||||
win.Connect(-1, -1, wxEVT_JOY_DOWN, func)
|
||||
win.Connect(-1, -1, wxEVT_JOY_UP, func)
|
||||
win.Connect(-1, -1, wxEVT_JOY_BUTTON_DOWN, func)
|
||||
win.Connect(-1, -1, wxEVT_JOY_BUTTON_UP, func)
|
||||
win.Connect(-1, -1, wxEVT_JOY_MOVE, func)
|
||||
win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user