From 7ea515abfb0211078d9ffcd4420ef0b53f3fcabe Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 30 Sep 2003 21:04:25 +0000 Subject: [PATCH] Various changes needed to get up to date with current CVS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/controls.i | 18 +++++ wxPython/src/events.i | 22 +++--- wxPython/src/fonts.i | 21 +++--- wxPython/src/gtk/controls.cpp | 123 ++++++++++++++++++++++++++++++ wxPython/src/gtk/controls.py | 18 +++++ wxPython/src/gtk/events.cpp | 136 +++++++++++++++++----------------- wxPython/src/gtk/events.py | 22 +++--- wxPython/src/gtk/fonts.cpp | 8 +- wxPython/src/gtk/fonts.py | 8 +- wxPython/src/helpers.cpp | 7 -- 10 files changed, 269 insertions(+), 114 deletions(-) diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index e2d6e99dbe..dfe73ed2b1 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -318,6 +318,20 @@ public: //---------------------------------------------------------------------- +enum { + wxCHK_2STATE, + wxCHK_3STATE, + wxCHK_ALLOW_3RD_STATE_FOR_USER, +}; + +enum wxCheckBoxState +{ + wxCHK_UNCHECKED, + wxCHK_CHECKED, + wxCHK_UNDETERMINED /* 3-state checkbox only */ +}; + + class wxCheckBox : public wxControl { public: wxCheckBox(wxWindow* parent, wxWindowID id, const wxString& label, @@ -341,6 +355,10 @@ public: bool GetValue(); bool IsChecked(); void SetValue(const bool state); + wxCheckBoxState Get3StateValue() const; + void Set3StateValue(wxCheckBoxState state); + bool Is3State() const; + bool Is3rdStateAllowedForUser() const; }; //---------------------------------------------------------------------- diff --git a/wxPython/src/events.i b/wxPython/src/events.i index 3c825cbaf5..3219045950 100644 --- a/wxPython/src/events.i +++ b/wxPython/src/events.i @@ -46,17 +46,18 @@ int wxNewEventType(); class wxEvent : public wxObject { public: - // wxEvent(int id = 0); // *** This class is now an ABC + // wxEvent(int winid = 0, wxEventType commandType = wxEVT_NULL); // *** This class is now an ABC ~wxEvent(); - wxObject* GetEventObject(); - wxEventType GetEventType(); - int GetId(); - long GetTimestamp(); - void SetEventObject(wxObject* object); void SetEventType(wxEventType typ); - void SetId(int id); - void SetTimestamp(long timeStamp); + wxEventType GetEventType() const; + wxObject *GetEventObject() const; + void SetEventObject(wxObject *obj); + long GetTimestamp() const; + void SetTimestamp(long ts = 0); + int GetId() const; + void SetId(int Id); + bool IsCommandEvent() const; @@ -78,7 +79,10 @@ public: // (returned by StopPropagation()) void ResumePropagation(int propagationLevel); - wxEvent *Clone(); + // this function is used to create a copy of the event polymorphically and + // all derived classes must implement it because otherwise wxPostEvent() + // for them wouldn't work (it needs to do a copy of the event) + virtual wxEvent *Clone() /* =0*/; }; //--------------------------------------------------------------------------- diff --git a/wxPython/src/fonts.i b/wxPython/src/fonts.i index fc3cf551f3..2c81f771d1 100644 --- a/wxPython/src/fonts.i +++ b/wxPython/src/fonts.i @@ -131,26 +131,25 @@ enum wxFontEncoding wxFONTENCODING_UTF7, // UTF-7 Unicode encoding wxFONTENCODING_UTF8, // UTF-8 Unicode encoding - wxFONTENCODING_UTF16, // UTF-16 Unicode encoding + wxFONTENCODING_EUC_JP, // Extended Unix Codepage for Japanese wxFONTENCODING_UTF16BE, // UTF-16 Big Endian Unicode encoding wxFONTENCODING_UTF16LE, // UTF-16 Little Endian Unicode encoding - wxFONTENCODING_UTF32, // UTF-32 Unicode encoding wxFONTENCODING_UTF32BE, // UTF-32 Big Endian Unicode encoding wxFONTENCODING_UTF32LE, // UTF-32 Little Endian Unicode encoding + wxFONTENCODING_MAX, + // Far Eastern encodings - // Chinese - wxFONTENCODING_GB2312 = wxFONTENCODING_CP936, // Simplified Chinese - wxFONTENCODING_BIG5 = wxFONTENCODING_CP950, // Traditional Chinese + wxFONTENCODING_GB2312, // Simplified Chinese + wxFONTENCODING_BIG5, // Traditional Chinese - // Japanese (see http://zsigri.tripod.com/fontboard/cjk/jis.html) - wxFONTENCODING_SHIFT_JIS = wxFONTENCODING_CP932, // Shift JIS - wxFONTENCODING_EUC_JP = wxFONTENCODING_UTF8 + 1, // Extended Unix Codepage - // for Japanese + wxFONTENCODING_SHIFT_JIS, // Shift JIS - wxFONTENCODING_UNICODE, // Unicode (for wxEncodingConverter only) - wxFONTENCODING_MAX + // Aliases + wxFONTENCODING_UTF16, + wxFONTENCODING_UTF32, + wxFONTENCODING_UNICODE, }; diff --git a/wxPython/src/gtk/controls.cpp b/wxPython/src/gtk/controls.cpp index 5f53185049..a4b72f305a 100644 --- a/wxPython/src/gtk/controls.cpp +++ b/wxPython/src/gtk/controls.cpp @@ -2191,6 +2191,119 @@ static PyObject *_wrap_wxCheckBox_SetValue(PyObject *self, PyObject *args, PyObj return _resultobj; } +#define wxCheckBox_Get3StateValue(_swigobj) (_swigobj->Get3StateValue()) +static PyObject *_wrap_wxCheckBox_Get3StateValue(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxCheckBoxState _result; + wxCheckBox * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCheckBox_Get3StateValue",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCheckBox_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCheckBox_Get3StateValue. Expected _wxCheckBox_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxCheckBoxState )wxCheckBox_Get3StateValue(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxCheckBox_Set3StateValue(_swigobj,_swigarg0) (_swigobj->Set3StateValue(_swigarg0)) +static PyObject *_wrap_wxCheckBox_Set3StateValue(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxCheckBox * _arg0; + wxCheckBoxState _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","state", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxCheckBox_Set3StateValue",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCheckBox_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCheckBox_Set3StateValue. Expected _wxCheckBox_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxCheckBox_Set3StateValue(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxCheckBox_Is3State(_swigobj) (_swigobj->Is3State()) +static PyObject *_wrap_wxCheckBox_Is3State(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxCheckBox * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCheckBox_Is3State",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCheckBox_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCheckBox_Is3State. Expected _wxCheckBox_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxCheckBox_Is3State(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxCheckBox_Is3rdStateAllowedForUser(_swigobj) (_swigobj->Is3rdStateAllowedForUser()) +static PyObject *_wrap_wxCheckBox_Is3rdStateAllowedForUser(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxCheckBox * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCheckBox_Is3rdStateAllowedForUser",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCheckBox_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCheckBox_Is3rdStateAllowedForUser. Expected _wxCheckBox_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxCheckBox_Is3rdStateAllowedForUser(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxChoiceTowxControlWithItems(void *ptr) { wxChoice *src; wxControlWithItems *dest; @@ -12582,6 +12695,10 @@ static PyMethodDef controlscMethods[] = { { "wxChoice_Create", (PyCFunction) _wrap_wxChoice_Create, METH_VARARGS | METH_KEYWORDS }, { "new_wxPreChoice", (PyCFunction) _wrap_new_wxPreChoice, METH_VARARGS | METH_KEYWORDS }, { "new_wxChoice", (PyCFunction) _wrap_new_wxChoice, METH_VARARGS | METH_KEYWORDS }, + { "wxCheckBox_Is3rdStateAllowedForUser", (PyCFunction) _wrap_wxCheckBox_Is3rdStateAllowedForUser, METH_VARARGS | METH_KEYWORDS }, + { "wxCheckBox_Is3State", (PyCFunction) _wrap_wxCheckBox_Is3State, METH_VARARGS | METH_KEYWORDS }, + { "wxCheckBox_Set3StateValue", (PyCFunction) _wrap_wxCheckBox_Set3StateValue, METH_VARARGS | METH_KEYWORDS }, + { "wxCheckBox_Get3StateValue", (PyCFunction) _wrap_wxCheckBox_Get3StateValue, METH_VARARGS | METH_KEYWORDS }, { "wxCheckBox_SetValue", (PyCFunction) _wrap_wxCheckBox_SetValue, METH_VARARGS | METH_KEYWORDS }, { "wxCheckBox_IsChecked", (PyCFunction) _wrap_wxCheckBox_IsChecked, METH_VARARGS | METH_KEYWORDS }, { "wxCheckBox_GetValue", (PyCFunction) _wrap_wxCheckBox_GetValue, METH_VARARGS | METH_KEYWORDS }, @@ -12836,6 +12953,12 @@ SWIGEXPORT(void) initcontrolsc() { d = PyModule_GetDict(m); PyDict_SetItemString(d,"cvar", SWIG_globals); SWIG_addvarlink(SWIG_globals,"wxDefaultValidator",_wrap_wxDefaultValidator_get, _wrap_wxDefaultValidator_set); + PyDict_SetItemString(d,"wxCHK_2STATE", PyInt_FromLong((long) wxCHK_2STATE)); + PyDict_SetItemString(d,"wxCHK_3STATE", PyInt_FromLong((long) wxCHK_3STATE)); + PyDict_SetItemString(d,"wxCHK_ALLOW_3RD_STATE_FOR_USER", PyInt_FromLong((long) wxCHK_ALLOW_3RD_STATE_FOR_USER)); + PyDict_SetItemString(d,"wxCHK_UNCHECKED", PyInt_FromLong((long) wxCHK_UNCHECKED)); + PyDict_SetItemString(d,"wxCHK_CHECKED", PyInt_FromLong((long) wxCHK_CHECKED)); + PyDict_SetItemString(d,"wxCHK_UNDETERMINED", PyInt_FromLong((long) wxCHK_UNDETERMINED)); PyDict_SetItemString(d,"wxTE_NO_VSCROLL", PyInt_FromLong((long) wxTE_NO_VSCROLL)); PyDict_SetItemString(d,"wxTE_AUTO_SCROLL", PyInt_FromLong((long) wxTE_AUTO_SCROLL)); PyDict_SetItemString(d,"wxTE_READONLY", PyInt_FromLong((long) wxTE_READONLY)); diff --git a/wxPython/src/gtk/controls.py b/wxPython/src/gtk/controls.py index 94f4a8b53a..216a3d963c 100644 --- a/wxPython/src/gtk/controls.py +++ b/wxPython/src/gtk/controls.py @@ -206,6 +206,18 @@ class wxCheckBoxPtr(wxControlPtr): def SetValue(self, *_args, **_kwargs): val = controlsc.wxCheckBox_SetValue(self, *_args, **_kwargs) return val + def Get3StateValue(self, *_args, **_kwargs): + val = controlsc.wxCheckBox_Get3StateValue(self, *_args, **_kwargs) + return val + def Set3StateValue(self, *_args, **_kwargs): + val = controlsc.wxCheckBox_Set3StateValue(self, *_args, **_kwargs) + return val + def Is3State(self, *_args, **_kwargs): + val = controlsc.wxCheckBox_Is3State(self, *_args, **_kwargs) + return val + def Is3rdStateAllowedForUser(self, *_args, **_kwargs): + val = controlsc.wxCheckBox_Is3rdStateAllowedForUser(self, *_args, **_kwargs) + return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxCheckBox instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) class wxCheckBox(wxCheckBoxPtr): @@ -1262,6 +1274,12 @@ def wxTextAttr_Combine(*_args, **_kwargs): cvar = controlsc.cvar wxDefaultValidator = wxValidatorPtr(controlsc.cvar.wxDefaultValidator) +wxCHK_2STATE = controlsc.wxCHK_2STATE +wxCHK_3STATE = controlsc.wxCHK_3STATE +wxCHK_ALLOW_3RD_STATE_FOR_USER = controlsc.wxCHK_ALLOW_3RD_STATE_FOR_USER +wxCHK_UNCHECKED = controlsc.wxCHK_UNCHECKED +wxCHK_CHECKED = controlsc.wxCHK_CHECKED +wxCHK_UNDETERMINED = controlsc.wxCHK_UNDETERMINED wxTE_NO_VSCROLL = controlsc.wxTE_NO_VSCROLL wxTE_AUTO_SCROLL = controlsc.wxTE_AUTO_SCROLL wxTE_READONLY = controlsc.wxTE_READONLY diff --git a/wxPython/src/gtk/events.cpp b/wxPython/src/gtk/events.cpp index 84ddb5e9ce..133bdbe854 100644 --- a/wxPython/src/gtk/events.cpp +++ b/wxPython/src/gtk/events.cpp @@ -140,31 +140,32 @@ static PyObject *_wrap_delete_wxEvent(PyObject *self, PyObject *args, PyObject * return _resultobj; } -#define wxEvent_GetEventObject(_swigobj) (_swigobj->GetEventObject()) -static PyObject *_wrap_wxEvent_GetEventObject(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxEvent_SetEventType(_swigobj,_swigarg0) (_swigobj->SetEventType(_swigarg0)) +static PyObject *_wrap_wxEvent_SetEventType(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxObject * _result; wxEvent * _arg0; + wxEventType _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + char *_kwnames[] = { "self","typ", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEvent_GetEventObject",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxEvent_SetEventType",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_GetEventObject. Expected _wxEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_SetEventType. Expected _wxEvent_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxObject *)wxEvent_GetEventObject(_arg0); + wxEvent_SetEventType(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -}{ _resultobj = wxPyMake_wxObject(_result); } +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } @@ -196,120 +197,120 @@ static PyObject *_wrap_wxEvent_GetEventType(PyObject *self, PyObject *args, PyOb return _resultobj; } -#define wxEvent_GetId(_swigobj) (_swigobj->GetId()) -static PyObject *_wrap_wxEvent_GetId(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxEvent_GetEventObject(_swigobj) (_swigobj->GetEventObject()) +static PyObject *_wrap_wxEvent_GetEventObject(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; + wxObject * _result; wxEvent * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEvent_GetId",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEvent_GetEventObject",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_GetId. Expected _wxEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_GetEventObject. Expected _wxEvent_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (int )wxEvent_GetId(_arg0); + _result = (wxObject *)wxEvent_GetEventObject(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +}{ _resultobj = wxPyMake_wxObject(_result); } return _resultobj; } -#define wxEvent_GetTimestamp(_swigobj) (_swigobj->GetTimestamp()) -static PyObject *_wrap_wxEvent_GetTimestamp(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxEvent_SetEventObject(_swigobj,_swigarg0) (_swigobj->SetEventObject(_swigarg0)) +static PyObject *_wrap_wxEvent_SetEventObject(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - long _result; wxEvent * _arg0; + wxObject * _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","obj", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEvent_GetTimestamp",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxEvent_SetEventObject",_kwnames,&_argo0,&_argo1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_GetTimestamp. Expected _wxEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_SetEventObject. Expected _wxEvent_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxObject_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxEvent_SetEventObject. Expected _wxObject_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (long )wxEvent_GetTimestamp(_arg0); + wxEvent_SetEventObject(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("l",_result); +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxEvent_SetEventObject(_swigobj,_swigarg0) (_swigobj->SetEventObject(_swigarg0)) -static PyObject *_wrap_wxEvent_SetEventObject(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxEvent_GetTimestamp(_swigobj) (_swigobj->GetTimestamp()) +static PyObject *_wrap_wxEvent_GetTimestamp(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; + long _result; wxEvent * _arg0; - wxObject * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "self","object", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxEvent_SetEventObject",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEvent_GetTimestamp",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_SetEventObject. Expected _wxEvent_p."); - return NULL; - } - } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxObject_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxEvent_SetEventObject. Expected _wxObject_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_GetTimestamp. Expected _wxEvent_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxEvent_SetEventObject(_arg0,_arg1); + _result = (long )wxEvent_GetTimestamp(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} _resultobj = Py_BuildValue("l",_result); return _resultobj; } -#define wxEvent_SetEventType(_swigobj,_swigarg0) (_swigobj->SetEventType(_swigarg0)) -static PyObject *_wrap_wxEvent_SetEventType(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxEvent_SetTimestamp(_swigobj,_swigarg0) (_swigobj->SetTimestamp(_swigarg0)) +static PyObject *_wrap_wxEvent_SetTimestamp(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxEvent * _arg0; - wxEventType _arg1; + long _arg1 = (long ) 0; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","typ", NULL }; + char *_kwnames[] = { "self","ts", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxEvent_SetEventType",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|l:wxEvent_SetTimestamp",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_SetEventType. Expected _wxEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_SetTimestamp. Expected _wxEvent_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxEvent_SetEventType(_arg0,_arg1); + wxEvent_SetTimestamp(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -318,56 +319,55 @@ static PyObject *_wrap_wxEvent_SetEventType(PyObject *self, PyObject *args, PyOb return _resultobj; } -#define wxEvent_SetId(_swigobj,_swigarg0) (_swigobj->SetId(_swigarg0)) -static PyObject *_wrap_wxEvent_SetId(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxEvent_GetId(_swigobj) (_swigobj->GetId()) +static PyObject *_wrap_wxEvent_GetId(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; + int _result; wxEvent * _arg0; - int _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","id", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxEvent_SetId",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEvent_GetId",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_SetId. Expected _wxEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_GetId. Expected _wxEvent_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxEvent_SetId(_arg0,_arg1); + _result = (int )wxEvent_GetId(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxEvent_SetTimestamp(_swigobj,_swigarg0) (_swigobj->SetTimestamp(_swigarg0)) -static PyObject *_wrap_wxEvent_SetTimestamp(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxEvent_SetId(_swigobj,_swigarg0) (_swigobj->SetId(_swigarg0)) +static PyObject *_wrap_wxEvent_SetId(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxEvent * _arg0; - long _arg1; + int _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","timeStamp", NULL }; + char *_kwnames[] = { "self","Id", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxEvent_SetTimestamp",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxEvent_SetId",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_SetTimestamp. Expected _wxEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvent_SetId. Expected _wxEvent_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxEvent_SetTimestamp(_arg0,_arg1); + wxEvent_SetId(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -8511,14 +8511,14 @@ static PyMethodDef eventscMethods[] = { { "wxEvent_GetSkipped", (PyCFunction) _wrap_wxEvent_GetSkipped, METH_VARARGS | METH_KEYWORDS }, { "wxEvent_Skip", (PyCFunction) _wrap_wxEvent_Skip, METH_VARARGS | METH_KEYWORDS }, { "wxEvent_IsCommandEvent", (PyCFunction) _wrap_wxEvent_IsCommandEvent, METH_VARARGS | METH_KEYWORDS }, - { "wxEvent_SetTimestamp", (PyCFunction) _wrap_wxEvent_SetTimestamp, METH_VARARGS | METH_KEYWORDS }, { "wxEvent_SetId", (PyCFunction) _wrap_wxEvent_SetId, METH_VARARGS | METH_KEYWORDS }, - { "wxEvent_SetEventType", (PyCFunction) _wrap_wxEvent_SetEventType, METH_VARARGS | METH_KEYWORDS }, - { "wxEvent_SetEventObject", (PyCFunction) _wrap_wxEvent_SetEventObject, METH_VARARGS | METH_KEYWORDS }, - { "wxEvent_GetTimestamp", (PyCFunction) _wrap_wxEvent_GetTimestamp, METH_VARARGS | METH_KEYWORDS }, { "wxEvent_GetId", (PyCFunction) _wrap_wxEvent_GetId, METH_VARARGS | METH_KEYWORDS }, - { "wxEvent_GetEventType", (PyCFunction) _wrap_wxEvent_GetEventType, METH_VARARGS | METH_KEYWORDS }, + { "wxEvent_SetTimestamp", (PyCFunction) _wrap_wxEvent_SetTimestamp, METH_VARARGS | METH_KEYWORDS }, + { "wxEvent_GetTimestamp", (PyCFunction) _wrap_wxEvent_GetTimestamp, METH_VARARGS | METH_KEYWORDS }, + { "wxEvent_SetEventObject", (PyCFunction) _wrap_wxEvent_SetEventObject, METH_VARARGS | METH_KEYWORDS }, { "wxEvent_GetEventObject", (PyCFunction) _wrap_wxEvent_GetEventObject, METH_VARARGS | METH_KEYWORDS }, + { "wxEvent_GetEventType", (PyCFunction) _wrap_wxEvent_GetEventType, METH_VARARGS | METH_KEYWORDS }, + { "wxEvent_SetEventType", (PyCFunction) _wrap_wxEvent_SetEventType, METH_VARARGS | METH_KEYWORDS }, { "delete_wxEvent", (PyCFunction) _wrap_delete_wxEvent, METH_VARARGS | METH_KEYWORDS }, { "wxNewEventType", (PyCFunction) _wrap_wxNewEventType, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL } diff --git a/wxPython/src/gtk/events.py b/wxPython/src/gtk/events.py index 3505d67a41..6a07e75b46 100644 --- a/wxPython/src/gtk/events.py +++ b/wxPython/src/gtk/events.py @@ -16,30 +16,30 @@ class wxEventPtr(wxObjectPtr): delfunc(self) except: pass - def GetEventObject(self, *_args, **_kwargs): - val = eventsc.wxEvent_GetEventObject(self, *_args, **_kwargs) + def SetEventType(self, *_args, **_kwargs): + val = eventsc.wxEvent_SetEventType(self, *_args, **_kwargs) return val def GetEventType(self, *_args, **_kwargs): val = eventsc.wxEvent_GetEventType(self, *_args, **_kwargs) return val - def GetId(self, *_args, **_kwargs): - val = eventsc.wxEvent_GetId(self, *_args, **_kwargs) + def GetEventObject(self, *_args, **_kwargs): + val = eventsc.wxEvent_GetEventObject(self, *_args, **_kwargs) + return val + def SetEventObject(self, *_args, **_kwargs): + val = eventsc.wxEvent_SetEventObject(self, *_args, **_kwargs) return val def GetTimestamp(self, *_args, **_kwargs): val = eventsc.wxEvent_GetTimestamp(self, *_args, **_kwargs) return val - def SetEventObject(self, *_args, **_kwargs): - val = eventsc.wxEvent_SetEventObject(self, *_args, **_kwargs) + def SetTimestamp(self, *_args, **_kwargs): + val = eventsc.wxEvent_SetTimestamp(self, *_args, **_kwargs) return val - def SetEventType(self, *_args, **_kwargs): - val = eventsc.wxEvent_SetEventType(self, *_args, **_kwargs) + def GetId(self, *_args, **_kwargs): + val = eventsc.wxEvent_GetId(self, *_args, **_kwargs) return val def SetId(self, *_args, **_kwargs): val = eventsc.wxEvent_SetId(self, *_args, **_kwargs) return val - def SetTimestamp(self, *_args, **_kwargs): - val = eventsc.wxEvent_SetTimestamp(self, *_args, **_kwargs) - return val def IsCommandEvent(self, *_args, **_kwargs): val = eventsc.wxEvent_IsCommandEvent(self, *_args, **_kwargs) return val diff --git a/wxPython/src/gtk/fonts.cpp b/wxPython/src/gtk/fonts.cpp index 3df05d1222..87c77f8511 100644 --- a/wxPython/src/gtk/fonts.cpp +++ b/wxPython/src/gtk/fonts.cpp @@ -4246,18 +4246,18 @@ SWIGEXPORT(void) initfontsc() { PyDict_SetItemString(d,"wxFONTENCODING_CP12_MAX", PyInt_FromLong((long) wxFONTENCODING_CP12_MAX)); PyDict_SetItemString(d,"wxFONTENCODING_UTF7", PyInt_FromLong((long) wxFONTENCODING_UTF7)); PyDict_SetItemString(d,"wxFONTENCODING_UTF8", PyInt_FromLong((long) wxFONTENCODING_UTF8)); - PyDict_SetItemString(d,"wxFONTENCODING_UTF16", PyInt_FromLong((long) wxFONTENCODING_UTF16)); + PyDict_SetItemString(d,"wxFONTENCODING_EUC_JP", PyInt_FromLong((long) wxFONTENCODING_EUC_JP)); PyDict_SetItemString(d,"wxFONTENCODING_UTF16BE", PyInt_FromLong((long) wxFONTENCODING_UTF16BE)); PyDict_SetItemString(d,"wxFONTENCODING_UTF16LE", PyInt_FromLong((long) wxFONTENCODING_UTF16LE)); - PyDict_SetItemString(d,"wxFONTENCODING_UTF32", PyInt_FromLong((long) wxFONTENCODING_UTF32)); PyDict_SetItemString(d,"wxFONTENCODING_UTF32BE", PyInt_FromLong((long) wxFONTENCODING_UTF32BE)); PyDict_SetItemString(d,"wxFONTENCODING_UTF32LE", PyInt_FromLong((long) wxFONTENCODING_UTF32LE)); + PyDict_SetItemString(d,"wxFONTENCODING_MAX", PyInt_FromLong((long) wxFONTENCODING_MAX)); PyDict_SetItemString(d,"wxFONTENCODING_GB2312", PyInt_FromLong((long) wxFONTENCODING_GB2312)); PyDict_SetItemString(d,"wxFONTENCODING_BIG5", PyInt_FromLong((long) wxFONTENCODING_BIG5)); PyDict_SetItemString(d,"wxFONTENCODING_SHIFT_JIS", PyInt_FromLong((long) wxFONTENCODING_SHIFT_JIS)); - PyDict_SetItemString(d,"wxFONTENCODING_EUC_JP", PyInt_FromLong((long) wxFONTENCODING_EUC_JP)); + PyDict_SetItemString(d,"wxFONTENCODING_UTF16", PyInt_FromLong((long) wxFONTENCODING_UTF16)); + PyDict_SetItemString(d,"wxFONTENCODING_UTF32", PyInt_FromLong((long) wxFONTENCODING_UTF32)); PyDict_SetItemString(d,"wxFONTENCODING_UNICODE", PyInt_FromLong((long) wxFONTENCODING_UNICODE)); - PyDict_SetItemString(d,"wxFONTENCODING_MAX", PyInt_FromLong((long) wxFONTENCODING_MAX)); PyDict_SetItemString(d,"wxLANGUAGE_DEFAULT", PyInt_FromLong((long) wxLANGUAGE_DEFAULT)); PyDict_SetItemString(d,"wxLANGUAGE_UNKNOWN", PyInt_FromLong((long) wxLANGUAGE_UNKNOWN)); PyDict_SetItemString(d,"wxLANGUAGE_ABKHAZIAN", PyInt_FromLong((long) wxLANGUAGE_ABKHAZIAN)); diff --git a/wxPython/src/gtk/fonts.py b/wxPython/src/gtk/fonts.py index 5567f57dd2..361cdcc5b6 100644 --- a/wxPython/src/gtk/fonts.py +++ b/wxPython/src/gtk/fonts.py @@ -535,18 +535,18 @@ wxFONTENCODING_CP1257 = fontsc.wxFONTENCODING_CP1257 wxFONTENCODING_CP12_MAX = fontsc.wxFONTENCODING_CP12_MAX wxFONTENCODING_UTF7 = fontsc.wxFONTENCODING_UTF7 wxFONTENCODING_UTF8 = fontsc.wxFONTENCODING_UTF8 -wxFONTENCODING_UTF16 = fontsc.wxFONTENCODING_UTF16 +wxFONTENCODING_EUC_JP = fontsc.wxFONTENCODING_EUC_JP wxFONTENCODING_UTF16BE = fontsc.wxFONTENCODING_UTF16BE wxFONTENCODING_UTF16LE = fontsc.wxFONTENCODING_UTF16LE -wxFONTENCODING_UTF32 = fontsc.wxFONTENCODING_UTF32 wxFONTENCODING_UTF32BE = fontsc.wxFONTENCODING_UTF32BE wxFONTENCODING_UTF32LE = fontsc.wxFONTENCODING_UTF32LE +wxFONTENCODING_MAX = fontsc.wxFONTENCODING_MAX wxFONTENCODING_GB2312 = fontsc.wxFONTENCODING_GB2312 wxFONTENCODING_BIG5 = fontsc.wxFONTENCODING_BIG5 wxFONTENCODING_SHIFT_JIS = fontsc.wxFONTENCODING_SHIFT_JIS -wxFONTENCODING_EUC_JP = fontsc.wxFONTENCODING_EUC_JP +wxFONTENCODING_UTF16 = fontsc.wxFONTENCODING_UTF16 +wxFONTENCODING_UTF32 = fontsc.wxFONTENCODING_UTF32 wxFONTENCODING_UNICODE = fontsc.wxFONTENCODING_UNICODE -wxFONTENCODING_MAX = fontsc.wxFONTENCODING_MAX wxLANGUAGE_DEFAULT = fontsc.wxLANGUAGE_DEFAULT wxLANGUAGE_UNKNOWN = fontsc.wxLANGUAGE_UNKNOWN wxLANGUAGE_ABKHAZIAN = fontsc.wxLANGUAGE_ABKHAZIAN diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 1e7a62009d..e71d858d5b 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -115,9 +115,6 @@ int wxPyApp::MainLoop() { DeletePendingObjects(); bool initialized = wxTopLevelWindows.GetCount() != 0; -#ifdef __WXGTK__ - m_initialized = initialized; -#endif if (initialized) { if ( m_exitOnFrameDelete == Later ) { @@ -439,10 +436,6 @@ PyObject* __wxStart(PyObject* /* self */, PyObject* args) goto error; } -#ifdef __WXGTK__ - wxTheApp->m_initialized = (wxTopLevelWindows.GetCount() > 0); -#endif - Py_DECREF(result); Py_DECREF(pyint); Py_INCREF(Py_None); -- 2.45.2