import sys, os, time, string
from wxPython.wx import *
-from wxPython.lib.splashscreen import SplashScreen
from wxPython.html import wxHtmlWindow
import images
sys.__wxPythonCleanup = __wxPyCleanup()
-## # another possible solution, but it gets called too eary...
+## # another possible solution, but it gets called too early...
## if sys.version[0] == '2':
## import atexit
## atexit.register(wxc.wxApp_CleanUp)
return _resultobj;
}
+static void *SwigwxDisplayChangedEventTowxEvent(void *ptr) {
+ wxDisplayChangedEvent *src;
+ wxEvent *dest;
+ src = (wxDisplayChangedEvent *) ptr;
+ dest = (wxEvent *) src;
+ return (void *) dest;
+}
+
+static void *SwigwxDisplayChangedEventTowxObject(void *ptr) {
+ wxDisplayChangedEvent *src;
+ wxObject *dest;
+ src = (wxDisplayChangedEvent *) ptr;
+ dest = (wxObject *) src;
+ return (void *) dest;
+}
+
+#define new_wxDisplayChangedEvent() (new wxDisplayChangedEvent())
+static PyObject *_wrap_new_wxDisplayChangedEvent(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxDisplayChangedEvent * _result;
+ char *_kwnames[] = { NULL };
+ char _ptemp[128];
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxDisplayChangedEvent",_kwnames))
+ return NULL;
+{
+ PyThreadState* __tstate = wxPyBeginAllowThreads();
+ _result = (wxDisplayChangedEvent *)new_wxDisplayChangedEvent();
+
+ wxPyEndAllowThreads(__tstate);
+ if (PyErr_Occurred()) return NULL;
+} if (_result) {
+ SWIG_MakePtr(_ptemp, (char *) _result,"_wxDisplayChangedEvent_p");
+ _resultobj = Py_BuildValue("s",_ptemp);
+ } else {
+ Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ }
+ return _resultobj;
+}
+
static void *SwigwxPaletteChangedEventTowxEvent(void *ptr) {
wxPaletteChangedEvent *src;
wxEvent *dest;
{ "wxPaletteChangedEvent_GetChangedWindow", (PyCFunction) _wrap_wxPaletteChangedEvent_GetChangedWindow, METH_VARARGS | METH_KEYWORDS },
{ "wxPaletteChangedEvent_SetChangedWindow", (PyCFunction) _wrap_wxPaletteChangedEvent_SetChangedWindow, METH_VARARGS | METH_KEYWORDS },
{ "new_wxPaletteChangedEvent", (PyCFunction) _wrap_new_wxPaletteChangedEvent, METH_VARARGS | METH_KEYWORDS },
+ { "new_wxDisplayChangedEvent", (PyCFunction) _wrap_new_wxDisplayChangedEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxNotifyEvent_Veto", (PyCFunction) _wrap_wxNotifyEvent_Veto, METH_VARARGS | METH_KEYWORDS },
{ "wxNotifyEvent_Allow", (PyCFunction) _wrap_wxNotifyEvent_Allow, METH_VARARGS | METH_KEYWORDS },
{ "wxNotifyEvent_IsAllowed", (PyCFunction) _wrap_wxNotifyEvent_IsAllowed, METH_VARARGS | METH_KEYWORDS },
{ "_wxEvent","_wxWindowCreateEvent",SwigwxWindowCreateEventTowxEvent},
{ "_wxEvent","_wxQueryNewPaletteEvent",SwigwxQueryNewPaletteEventTowxEvent},
{ "_wxEvent","_wxPaletteChangedEvent",SwigwxPaletteChangedEventTowxEvent},
+ { "_wxEvent","_wxDisplayChangedEvent",SwigwxDisplayChangedEventTowxEvent},
{ "_wxEvent","_wxNotifyEvent",SwigwxNotifyEventTowxEvent},
{ "_wxEvent","_wxSysColourChangedEvent",SwigwxSysColourChangedEventTowxEvent},
{ "_wxEvent","_wxUpdateUIEvent",SwigwxUpdateUIEventTowxEvent},
{ "_wxObject","_wxWindowCreateEvent",SwigwxWindowCreateEventTowxObject},
{ "_wxObject","_wxQueryNewPaletteEvent",SwigwxQueryNewPaletteEventTowxObject},
{ "_wxObject","_wxPaletteChangedEvent",SwigwxPaletteChangedEventTowxObject},
+ { "_wxObject","_wxDisplayChangedEvent",SwigwxDisplayChangedEventTowxObject},
{ "_wxObject","_wxNotifyEvent",SwigwxNotifyEventTowxObject},
{ "_wxObject","_wxSysColourChangedEvent",SwigwxSysColourChangedEventTowxObject},
{ "_wxObject","_wxUpdateUIEvent",SwigwxUpdateUIEventTowxObject},
+class wxDisplayChangedEventPtr(wxEventPtr):
+ def __init__(self,this):
+ self.this = this
+ self.thisown = 0
+ def __repr__(self):
+ return "<C wxDisplayChangedEvent instance at %s>" % (self.this,)
+class wxDisplayChangedEvent(wxDisplayChangedEventPtr):
+ def __init__(self,*_args,**_kwargs):
+ self.this = apply(eventsc.new_wxDisplayChangedEvent,_args,_kwargs)
+ self.thisown = 1
+
+
+
+
class wxPaletteChangedEventPtr(wxEventPtr):
def __init__(self,this):
self.this = this
}
static void wxColourDatabase_Append(wxColourDatabase *self,const wxString & name,int red,int green,int blue) {
+ // first see if the name is already there
+ wxString cName = name;
+ cName.MakeUpper();
+ wxString cName2 = cName;
+ if ( !cName2.Replace("GRAY", "GREY") )
+ cName2.clear();
+
+ wxNode *node = self->First();
+ while ( node ) {
+ const wxChar *key = node->GetKeyString();
+ if ( cName == key || cName2 == key ) {
+ wxColour* c = (wxColour *)node->Data();
+ c->Set(red, green, blue);
+ return;
+ }
+ node = node->Next();
+ }
+
+ // otherwise append the new colour
self->Append(name.c_str(), new wxColour(red, green, blue));
}
static PyObject *_wrap_wxColourDatabase_Append(PyObject *self, PyObject *args, PyObject *kwargs) {
wxPalette * _arg0;
int _arg1;
byte * _arg2;
+ int temp;
byte * _arg3;
+ int temp0;
byte * _arg4;
+ int temp1;
PyObject * _argo0 = 0;
- PyObject * _argo2 = 0;
- PyObject * _argo3 = 0;
- PyObject * _argo4 = 0;
- char *_kwnames[] = { "self","pixel","OUTPUT","OUTPUT","OUTPUT", NULL };
+ char *_kwnames[] = { "self","pixel", NULL };
self = self;
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiOOO:wxPalette_GetRGB",_kwnames,&_argo0,&_arg1,&_argo2,&_argo3,&_argo4))
+{
+ _arg2 = (byte*)&temp;
+}
+{
+ _arg3 = (byte*)&temp0;
+}
+{
+ _arg4 = (byte*)&temp1;
+}
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxPalette_GetRGB",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
return NULL;
}
}
- if (_argo2) {
- if (_argo2 == Py_None) { _arg2 = NULL; }
- else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_byte_p")) {
- PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxPalette_GetRGB. Expected _byte_p.");
- return NULL;
- }
- }
- if (_argo3) {
- if (_argo3 == Py_None) { _arg3 = NULL; }
- else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_byte_p")) {
- PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxPalette_GetRGB. Expected _byte_p.");
- return NULL;
- }
- }
- if (_argo4) {
- if (_argo4 == Py_None) { _arg4 = NULL; }
- else if (SWIG_GetPtrObj(_argo4,(void **) &_arg4,"_byte_p")) {
- PyErr_SetString(PyExc_TypeError,"Type error in argument 5 of wxPalette_GetRGB. Expected _byte_p.");
- return NULL;
- }
- }
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxPalette_GetRGB(_arg0,_arg1,_arg2,_arg3,_arg4);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
+{
+ PyObject *o;
+ o = PyInt_FromLong((long) (*_arg2));
+ _resultobj = t_output_helper(_resultobj, o);
+}
+{
+ PyObject *o;
+ o = PyInt_FromLong((long) (*_arg3));
+ _resultobj = t_output_helper(_resultobj, o);
+}
+{
+ PyObject *o;
+ o = PyInt_FromLong((long) (*_arg4));
+ _resultobj = t_output_helper(_resultobj, o);
+}
return _resultobj;
}
extern "C" SWIGEXPORT(void) initclip_dndc();
extern "C" SWIGEXPORT(void) initstreamsc();
extern "C" SWIGEXPORT(void) initfilesysc();
+extern "C" SWIGEXPORT(void) initutilsc();
PyDict_SetItemString(d,"wxEVT_MENU_HIGHLIGHT", PyInt_FromLong((long) wxEVT_MENU_HIGHLIGHT));
PyDict_SetItemString(d,"wxEVT_POPUP_MENU_INIT", PyInt_FromLong((long) wxEVT_POPUP_MENU_INIT));
PyDict_SetItemString(d,"wxEVT_SYS_COLOUR_CHANGED", PyInt_FromLong((long) wxEVT_SYS_COLOUR_CHANGED));
+ PyDict_SetItemString(d,"wxEVT_DISPLAY_CHANGED", PyInt_FromLong((long) wxEVT_DISPLAY_CHANGED));
PyDict_SetItemString(d,"wxEVT_SETTING_CHANGED", PyInt_FromLong((long) wxEVT_SETTING_CHANGED));
PyDict_SetItemString(d,"wxEVT_QUERY_NEW_PALETTE", PyInt_FromLong((long) wxEVT_QUERY_NEW_PALETTE));
PyDict_SetItemString(d,"wxEVT_PALETTE_CHANGED", PyInt_FromLong((long) wxEVT_PALETTE_CHANGED));
initclip_dndc();
initstreamsc();
initfilesysc();
+ initutilsc();
PyDict_SetItemString(d,"wxMAJOR_VERSION", PyInt_FromLong((long)wxMAJOR_VERSION ));
wxEVT_MENU_HIGHLIGHT = wxc.wxEVT_MENU_HIGHLIGHT
wxEVT_POPUP_MENU_INIT = wxc.wxEVT_POPUP_MENU_INIT
wxEVT_SYS_COLOUR_CHANGED = wxc.wxEVT_SYS_COLOUR_CHANGED
+wxEVT_DISPLAY_CHANGED = wxc.wxEVT_DISPLAY_CHANGED
wxEVT_SETTING_CHANGED = wxc.wxEVT_SETTING_CHANGED
wxEVT_QUERY_NEW_PALETTE = wxc.wxEVT_QUERY_NEW_PALETTE
wxEVT_PALETTE_CHANGED = wxc.wxEVT_PALETTE_CHANGED
def EVT_SYS_COLOUR_CHANGED(win, func):
win.Connect(-1, -1, wxEVT_SYS_COLOUR_CHANGED, func)
+def EVT_DISPLAY_CHANGED(win, func):
+ win.Connect(-1, -1, wxEVT_DISPLAY_CHANGED, func)
+
def EVT_SHOW(win, func):
win.Connect(-1, -1, wxEVT_SHOW, func)
def __del__(self):
self.cleanup()
-__cleanMeUp = __wxPyCleanup()
+sys.__wxPythonCleanup = __wxPyCleanup()
+
+## # another possible solution, but it gets called too early...
+## if sys.version[0] == '2':
+## import atexit
+## atexit.register(wxc.wxApp_CleanUp)
+## else:
+## sys.exitfunc = wxc.wxApp_CleanUp
+
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------