Some missing methods and etc. added

Some minor tweaks and fixes


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2000-07-03 19:23:45 +00:00
parent 8dbef32aaf
commit e21e241714
13 changed files with 374 additions and 94 deletions

View File

@@ -7,6 +7,7 @@ New in 2.2.0
Added wxLog and friends. Added wxLog and friends.
Added wxFrame.ShowFullScreen.

View File

@@ -63,7 +63,7 @@ class TestListCtrlPanel(wxPanel):
wxPanel.__init__(self, parent, -1) wxPanel.__init__(self, parent, -1)
self.log = log self.log = log
tID = NewId() tID = wxNewId()
self.il = wxImageList(16, 16) self.il = wxImageList(16, 16)
idx1 = self.il.Add(wxBitmap('bitmaps/smiles.bmp', wxBITMAP_TYPE_BMP)) idx1 = self.il.Add(wxBitmap('bitmaps/smiles.bmp', wxBITMAP_TYPE_BMP))

View File

@@ -24,10 +24,10 @@ _wxSetDictionary(vars())
# Helper function to link python methods to wxWindows virtual # Helper function to link python methods to wxWindows virtual
# functions by name. # functions by name.
## def _checkForCallback(obj, name, event, theID=-1): def _checkForCallback(obj, name, event, theID=-1):
## try: cb = getattr(obj, name) try: cb = getattr(obj, name)
## except: pass except: pass
## else: obj.Connect(theID, -1, event, cb) else: obj.Connect(theID, -1, event, cb)
## def _StdWindowCallbacks(win): ## def _StdWindowCallbacks(win):
## _checkForCallback(win, "OnChar", wxEVT_CHAR) ## _checkForCallback(win, "OnChar", wxEVT_CHAR)

View File

@@ -34,6 +34,16 @@
//---------------------------------------------------------------------- //----------------------------------------------------------------------
enum {
wxFULLSCREEN_NOMENUBAR,
wxFULLSCREEN_NOTOOLBAR,
wxFULLSCREEN_NOSTATUSBAR,
wxFULLSCREEN_NOBORDER,
wxFULLSCREEN_NOCAPTION,
wxFULLSCREEN_ALL
};
class wxFrame : public wxWindow { class wxFrame : public wxWindow {
public: public:
wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title, wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
@@ -75,6 +85,8 @@ public:
wxPoint GetClientAreaOrigin() const; wxPoint GetClientAreaOrigin() const;
bool Command(int id); bool Command(int id);
bool ProcessCommand(int id); bool ProcessCommand(int id);
bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@@ -1028,6 +1028,37 @@ static PyObject *_wrap_wxFrame_ProcessCommand(PyObject *self, PyObject *args, Py
return _resultobj; return _resultobj;
} }
#define wxFrame_ShowFullScreen(_swigobj,_swigarg0,_swigarg1) (_swigobj->ShowFullScreen(_swigarg0,_swigarg1))
static PyObject *_wrap_wxFrame_ShowFullScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxFrame * _arg0;
bool _arg1;
long _arg2 = (long ) (wxFULLSCREEN_ALL);
PyObject * _argo0 = 0;
int tempbool1;
char *_kwnames[] = { "self","show","style", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|l:wxFrame_ShowFullScreen",_kwnames,&_argo0,&tempbool1,&_arg2))
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_ShowFullScreen. Expected _wxFrame_p.");
return NULL;
}
}
_arg1 = (bool ) tempbool1;
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (bool )wxFrame_ShowFullScreen(_arg0,_arg1,_arg2);
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
static void *SwigwxMiniFrameTowxFrame(void *ptr) { static void *SwigwxMiniFrameTowxFrame(void *ptr) {
wxMiniFrame *src; wxMiniFrame *src;
wxFrame *dest; wxFrame *dest;
@@ -1122,6 +1153,7 @@ static PyObject *_wrap_new_wxMiniFrame(PyObject *self, PyObject *args, PyObject
static PyMethodDef framescMethods[] = { static PyMethodDef framescMethods[] = {
{ "new_wxMiniFrame", (PyCFunction) _wrap_new_wxMiniFrame, METH_VARARGS | METH_KEYWORDS }, { "new_wxMiniFrame", (PyCFunction) _wrap_new_wxMiniFrame, METH_VARARGS | METH_KEYWORDS },
{ "wxFrame_ShowFullScreen", (PyCFunction) _wrap_wxFrame_ShowFullScreen, METH_VARARGS | METH_KEYWORDS },
{ "wxFrame_ProcessCommand", (PyCFunction) _wrap_wxFrame_ProcessCommand, 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_Command", (PyCFunction) _wrap_wxFrame_Command, METH_VARARGS | METH_KEYWORDS },
{ "wxFrame_GetClientAreaOrigin", (PyCFunction) _wrap_wxFrame_GetClientAreaOrigin, METH_VARARGS | METH_KEYWORDS }, { "wxFrame_GetClientAreaOrigin", (PyCFunction) _wrap_wxFrame_GetClientAreaOrigin, METH_VARARGS | METH_KEYWORDS },
@@ -1498,6 +1530,12 @@ SWIGEXPORT(void) initframesc() {
SWIG_globals = SWIG_newvarlink(); SWIG_globals = SWIG_newvarlink();
m = Py_InitModule("framesc", framescMethods); m = Py_InitModule("framesc", framescMethods);
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
PyDict_SetItemString(d,"wxFULLSCREEN_NOMENUBAR", PyInt_FromLong((long) wxFULLSCREEN_NOMENUBAR));
PyDict_SetItemString(d,"wxFULLSCREEN_NOTOOLBAR", PyInt_FromLong((long) wxFULLSCREEN_NOTOOLBAR));
PyDict_SetItemString(d,"wxFULLSCREEN_NOSTATUSBAR", PyInt_FromLong((long) wxFULLSCREEN_NOSTATUSBAR));
PyDict_SetItemString(d,"wxFULLSCREEN_NOBORDER", PyInt_FromLong((long) wxFULLSCREEN_NOBORDER));
PyDict_SetItemString(d,"wxFULLSCREEN_NOCAPTION", PyInt_FromLong((long) wxFULLSCREEN_NOCAPTION));
PyDict_SetItemString(d,"wxFULLSCREEN_ALL", PyInt_FromLong((long) wxFULLSCREEN_ALL));
{ {
int i; int i;
for (i = 0; _swig_mapping[i].n1; i++) for (i = 0; _swig_mapping[i].n1; i++)

View File

@@ -101,6 +101,9 @@ class wxFramePtr(wxWindowPtr):
def ProcessCommand(self, *_args, **_kwargs): def ProcessCommand(self, *_args, **_kwargs):
val = apply(framesc.wxFrame_ProcessCommand,(self,) + _args, _kwargs) val = apply(framesc.wxFrame_ProcessCommand,(self,) + _args, _kwargs)
return val return val
def ShowFullScreen(self, *_args, **_kwargs):
val = apply(framesc.wxFrame_ShowFullScreen,(self,) + _args, _kwargs)
return val
def __repr__(self): def __repr__(self):
return "<C wxFrame instance at %s>" % (self.this,) return "<C wxFrame instance at %s>" % (self.this,)
class wxFrame(wxFramePtr): class wxFrame(wxFramePtr):
@@ -135,3 +138,9 @@ class wxMiniFrame(wxMiniFramePtr):
#-------------- VARIABLE WRAPPERS ------------------ #-------------- VARIABLE WRAPPERS ------------------
wxFULLSCREEN_NOMENUBAR = framesc.wxFULLSCREEN_NOMENUBAR
wxFULLSCREEN_NOTOOLBAR = framesc.wxFULLSCREEN_NOTOOLBAR
wxFULLSCREEN_NOSTATUSBAR = framesc.wxFULLSCREEN_NOSTATUSBAR
wxFULLSCREEN_NOBORDER = framesc.wxFULLSCREEN_NOBORDER
wxFULLSCREEN_NOCAPTION = framesc.wxFULLSCREEN_NOCAPTION
wxFULLSCREEN_ALL = framesc.wxFULLSCREEN_ALL

View File

@@ -121,6 +121,85 @@ static char* wxStringErrorMsg = "string type is required for parameter";
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
static PyObject *_wrap_wxGetLocalTime(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
long _result;
char *_kwnames[] = { NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxGetLocalTime",_kwnames))
return NULL;
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (long )wxGetLocalTime();
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("l",_result);
return _resultobj;
}
static PyObject *_wrap_wxGetUTCTime(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
long _result;
char *_kwnames[] = { NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxGetUTCTime",_kwnames))
return NULL;
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (long )wxGetUTCTime();
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("l",_result);
return _resultobj;
}
static PyObject *_wrap_wxGetCurrentTime(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
long _result;
char *_kwnames[] = { NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxGetCurrentTime",_kwnames))
return NULL;
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (long )wxGetCurrentTime();
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("l",_result);
return _resultobj;
}
static PyObject *_wrap_wxGetLocalTimeMillis(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxLongLong * _result;
char *_kwnames[] = { NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxGetLocalTimeMillis",_kwnames))
return NULL;
{
wxPy_BEGIN_ALLOW_THREADS;
_result = new wxLongLong (wxGetLocalTimeMillis());
wxPy_END_ALLOW_THREADS;
}{
PyObject *hi, *lo, *shifter, *shifted;
hi = PyLong_FromLong(_result->GetHi());
lo = PyLong_FromLong(_result->GetLo());
shifter = PyLong_FromLong(32);
shifted = PyNumber_Lshift(hi, shifter);
_resultobj = PyNumber_Or(shifted, lo);
Py_DECREF(hi);
Py_DECREF(lo);
Py_DECREF(shifter);
Py_DECREF(shifted);
}
return _resultobj;
}
#define delete_wxConfigBase(_swigobj) (delete _swigobj) #define delete_wxConfigBase(_swigobj) (delete _swigobj)
static PyObject *_wrap_delete_wxConfigBase(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_delete_wxConfigBase(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;
@@ -6240,70 +6319,6 @@ static PyObject *_wrap_wxTimeSpan_Format(PyObject *self, PyObject *args, PyObjec
return _resultobj; return _resultobj;
} }
#define wxTimeSpan_FormatDate(_swigobj) (_swigobj->FormatDate())
static PyObject *_wrap_wxTimeSpan_FormatDate(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxString * _result;
wxTimeSpan * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxTimeSpan_FormatDate",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTimeSpan_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTimeSpan_FormatDate. Expected _wxTimeSpan_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = new wxString (wxTimeSpan_FormatDate(_arg0));
wxPy_END_ALLOW_THREADS;
}{
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
}
{
delete _result;
}
return _resultobj;
}
#define wxTimeSpan_FormatTime(_swigobj) (_swigobj->FormatTime())
static PyObject *_wrap_wxTimeSpan_FormatTime(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxString * _result;
wxTimeSpan * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxTimeSpan_FormatTime",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTimeSpan_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTimeSpan_FormatTime. Expected _wxTimeSpan_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = new wxString (wxTimeSpan_FormatTime(_arg0));
wxPy_END_ALLOW_THREADS;
}{
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
}
{
delete _result;
}
return _resultobj;
}
#define new_wxDateSpan(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxDateSpan(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) #define new_wxDateSpan(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxDateSpan(_swigarg0,_swigarg1,_swigarg2,_swigarg3))
static PyObject *_wrap_new_wxDateSpan(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_new_wxDateSpan(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;
@@ -7148,8 +7163,6 @@ static PyMethodDef utilscMethods[] = {
{ "wxDateSpan_Days", (PyCFunction) _wrap_wxDateSpan_Days, METH_VARARGS | METH_KEYWORDS }, { "wxDateSpan_Days", (PyCFunction) _wrap_wxDateSpan_Days, METH_VARARGS | METH_KEYWORDS },
{ "delete_wxDateSpan", (PyCFunction) _wrap_delete_wxDateSpan, METH_VARARGS | METH_KEYWORDS }, { "delete_wxDateSpan", (PyCFunction) _wrap_delete_wxDateSpan, METH_VARARGS | METH_KEYWORDS },
{ "new_wxDateSpan", (PyCFunction) _wrap_new_wxDateSpan, METH_VARARGS | METH_KEYWORDS }, { "new_wxDateSpan", (PyCFunction) _wrap_new_wxDateSpan, METH_VARARGS | METH_KEYWORDS },
{ "wxTimeSpan_FormatTime", (PyCFunction) _wrap_wxTimeSpan_FormatTime, METH_VARARGS | METH_KEYWORDS },
{ "wxTimeSpan_FormatDate", (PyCFunction) _wrap_wxTimeSpan_FormatDate, METH_VARARGS | METH_KEYWORDS },
{ "wxTimeSpan_Format", (PyCFunction) _wrap_wxTimeSpan_Format, METH_VARARGS | METH_KEYWORDS }, { "wxTimeSpan_Format", (PyCFunction) _wrap_wxTimeSpan_Format, METH_VARARGS | METH_KEYWORDS },
{ "wxTimeSpan_GetMilliseconds", (PyCFunction) _wrap_wxTimeSpan_GetMilliseconds, METH_VARARGS | METH_KEYWORDS }, { "wxTimeSpan_GetMilliseconds", (PyCFunction) _wrap_wxTimeSpan_GetMilliseconds, METH_VARARGS | METH_KEYWORDS },
{ "wxTimeSpan_GetSeconds", (PyCFunction) _wrap_wxTimeSpan_GetSeconds, METH_VARARGS | METH_KEYWORDS }, { "wxTimeSpan_GetSeconds", (PyCFunction) _wrap_wxTimeSpan_GetSeconds, METH_VARARGS | METH_KEYWORDS },
@@ -7335,6 +7348,10 @@ static PyMethodDef utilscMethods[] = {
{ "wxConfigBase_Get", (PyCFunction) _wrap_wxConfigBase_Get, METH_VARARGS | METH_KEYWORDS }, { "wxConfigBase_Get", (PyCFunction) _wrap_wxConfigBase_Get, METH_VARARGS | METH_KEYWORDS },
{ "wxConfigBase_Set", (PyCFunction) _wrap_wxConfigBase_Set, METH_VARARGS | METH_KEYWORDS }, { "wxConfigBase_Set", (PyCFunction) _wrap_wxConfigBase_Set, METH_VARARGS | METH_KEYWORDS },
{ "delete_wxConfigBase", (PyCFunction) _wrap_delete_wxConfigBase, METH_VARARGS | METH_KEYWORDS }, { "delete_wxConfigBase", (PyCFunction) _wrap_delete_wxConfigBase, METH_VARARGS | METH_KEYWORDS },
{ "wxGetLocalTimeMillis", (PyCFunction) _wrap_wxGetLocalTimeMillis, METH_VARARGS | METH_KEYWORDS },
{ "wxGetCurrentTime", (PyCFunction) _wrap_wxGetCurrentTime, METH_VARARGS | METH_KEYWORDS },
{ "wxGetUTCTime", (PyCFunction) _wrap_wxGetUTCTime, METH_VARARGS | METH_KEYWORDS },
{ "wxGetLocalTime", (PyCFunction) _wrap_wxGetLocalTime, METH_VARARGS | METH_KEYWORDS },
{ NULL, NULL } { NULL, NULL }
}; };
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -683,12 +683,6 @@ class wxTimeSpanPtr :
def Format(self, *_args, **_kwargs): def Format(self, *_args, **_kwargs):
val = apply(utilsc.wxTimeSpan_Format,(self,) + _args, _kwargs) val = apply(utilsc.wxTimeSpan_Format,(self,) + _args, _kwargs)
return val return val
def FormatDate(self, *_args, **_kwargs):
val = apply(utilsc.wxTimeSpan_FormatDate,(self,) + _args, _kwargs)
return val
def FormatTime(self, *_args, **_kwargs):
val = apply(utilsc.wxTimeSpan_FormatTime,(self,) + _args, _kwargs)
return val
def __repr__(self): def __repr__(self):
return "<C wxTimeSpan instance at %s>" % (self.this,) return "<C wxTimeSpan instance at %s>" % (self.this,)
class wxTimeSpan(wxTimeSpanPtr): class wxTimeSpan(wxTimeSpanPtr):
@@ -787,6 +781,14 @@ class wxDateSpan(wxDateSpanPtr):
#-------------- FUNCTION WRAPPERS ------------------ #-------------- FUNCTION WRAPPERS ------------------
wxGetLocalTime = utilsc.wxGetLocalTime
wxGetUTCTime = utilsc.wxGetUTCTime
wxGetCurrentTime = utilsc.wxGetCurrentTime
wxGetLocalTimeMillis = utilsc.wxGetLocalTimeMillis
def wxConfigBase_Set(*_args, **_kwargs): def wxConfigBase_Set(*_args, **_kwargs):
val = apply(utilsc.wxConfigBase_Set,_args,_kwargs) val = apply(utilsc.wxConfigBase_Set,_args,_kwargs)
if val: val = wxConfigBasePtr(val) if val: val = wxConfigBasePtr(val)

View File

@@ -357,6 +357,42 @@ static PyObject *_wrap_wxEvtHandler_ProcessEvent(PyObject *self, PyObject *args,
return _resultobj; return _resultobj;
} }
#define wxEvtHandler_AddPendingEvent(_swigobj,_swigarg0) (_swigobj->AddPendingEvent(_swigarg0))
static PyObject *_wrap_wxEvtHandler_AddPendingEvent(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxEvtHandler * _arg0;
wxEvent * _arg1;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","event", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxEvtHandler_AddPendingEvent",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxEvtHandler_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvtHandler_AddPendingEvent. Expected _wxEvtHandler_p.");
return NULL;
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxEvent_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxEvtHandler_AddPendingEvent. Expected _wxEvent_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxEvtHandler_AddPendingEvent(_arg0,*_arg1);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxEvtHandler_GetEvtHandlerEnabled(_swigobj) (_swigobj->GetEvtHandlerEnabled()) #define wxEvtHandler_GetEvtHandlerEnabled(_swigobj) (_swigobj->GetEvtHandlerEnabled())
static PyObject *_wrap_wxEvtHandler_GetEvtHandlerEnabled(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxEvtHandler_GetEvtHandlerEnabled(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;
@@ -4643,6 +4679,40 @@ static PyObject *_wrap_wxWindow_SetSizer(PyObject *self, PyObject *args, PyObjec
return _resultobj; return _resultobj;
} }
#define wxWindow_GetSizer(_swigobj) (_swigobj->GetSizer())
static PyObject *_wrap_wxWindow_GetSizer(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxSizer * _result;
wxWindow * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_GetSizer",_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_GetSizer. Expected _wxWindow_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxSizer *)wxWindow_GetSizer(_arg0);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxSizer_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define wxWindow_GetValidator(_swigobj) (_swigobj->GetValidator()) #define wxWindow_GetValidator(_swigobj) (_swigobj->GetValidator())
static PyObject *_wrap_wxWindow_GetValidator(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxWindow_GetValidator(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;
@@ -5856,7 +5926,7 @@ static PyObject *_wrap_wxScrolledWindow_Scroll(PyObject *self, PyObject *args, P
return _resultobj; return _resultobj;
} }
#define wxScrolledWindow_SetScrollbars(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5) (_swigobj->SetScrollbars(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5)) #define wxScrolledWindow_SetScrollbars(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (_swigobj->SetScrollbars(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6))
static PyObject *_wrap_wxScrolledWindow_SetScrollbars(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxScrolledWindow_SetScrollbars(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;
wxScrolledWindow * _arg0; wxScrolledWindow * _arg0;
@@ -5866,11 +5936,12 @@ static PyObject *_wrap_wxScrolledWindow_SetScrollbars(PyObject *self, PyObject *
int _arg4; int _arg4;
int _arg5 = (int ) 0; int _arg5 = (int ) 0;
int _arg6 = (int ) 0; int _arg6 = (int ) 0;
int _arg7 = (int ) FALSE;
PyObject * _argo0 = 0; PyObject * _argo0 = 0;
char *_kwnames[] = { "self","pixelsPerUnitX","pixelsPerUnitY","noUnitsX","noUnitsY","xPos","yPos", NULL }; char *_kwnames[] = { "self","pixelsPerUnitX","pixelsPerUnitY","noUnitsX","noUnitsY","xPos","yPos","noRefresh", NULL };
self = self; self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oiiii|ii:wxScrolledWindow_SetScrollbars",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5,&_arg6)) if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oiiii|iii:wxScrolledWindow_SetScrollbars",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5,&_arg6,&_arg7))
return NULL; return NULL;
if (_argo0) { if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; } if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -5881,7 +5952,7 @@ static PyObject *_wrap_wxScrolledWindow_SetScrollbars(PyObject *self, PyObject *
} }
{ {
wxPy_BEGIN_ALLOW_THREADS; wxPy_BEGIN_ALLOW_THREADS;
wxScrolledWindow_SetScrollbars(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6); wxScrolledWindow_SetScrollbars(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6,_arg7);
wxPy_END_ALLOW_THREADS; wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None); } Py_INCREF(Py_None);
@@ -9047,6 +9118,7 @@ static PyMethodDef windowscMethods[] = {
{ "wxWindow_SetDropTarget", (PyCFunction) _wrap_wxWindow_SetDropTarget, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetDropTarget", (PyCFunction) _wrap_wxWindow_SetDropTarget, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_SetValidator", (PyCFunction) _wrap_wxWindow_SetValidator, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetValidator", (PyCFunction) _wrap_wxWindow_SetValidator, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_GetValidator", (PyCFunction) _wrap_wxWindow_GetValidator, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetValidator", (PyCFunction) _wrap_wxWindow_GetValidator, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_GetSizer", (PyCFunction) _wrap_wxWindow_GetSizer, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_SetSizer", (PyCFunction) _wrap_wxWindow_SetSizer, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetSizer", (PyCFunction) _wrap_wxWindow_SetSizer, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_GetToolTip", (PyCFunction) _wrap_wxWindow_GetToolTip, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetToolTip", (PyCFunction) _wrap_wxWindow_GetToolTip, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_SetToolTip", (PyCFunction) _wrap_wxWindow_SetToolTip, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetToolTip", (PyCFunction) _wrap_wxWindow_SetToolTip, METH_VARARGS | METH_KEYWORDS },
@@ -9175,6 +9247,7 @@ static PyMethodDef windowscMethods[] = {
{ "wxEvtHandler_GetNextHandler", (PyCFunction) _wrap_wxEvtHandler_GetNextHandler, METH_VARARGS | METH_KEYWORDS }, { "wxEvtHandler_GetNextHandler", (PyCFunction) _wrap_wxEvtHandler_GetNextHandler, METH_VARARGS | METH_KEYWORDS },
{ "wxEvtHandler_SetEvtHandlerEnabled", (PyCFunction) _wrap_wxEvtHandler_SetEvtHandlerEnabled, METH_VARARGS | METH_KEYWORDS }, { "wxEvtHandler_SetEvtHandlerEnabled", (PyCFunction) _wrap_wxEvtHandler_SetEvtHandlerEnabled, METH_VARARGS | METH_KEYWORDS },
{ "wxEvtHandler_GetEvtHandlerEnabled", (PyCFunction) _wrap_wxEvtHandler_GetEvtHandlerEnabled, METH_VARARGS | METH_KEYWORDS }, { "wxEvtHandler_GetEvtHandlerEnabled", (PyCFunction) _wrap_wxEvtHandler_GetEvtHandlerEnabled, METH_VARARGS | METH_KEYWORDS },
{ "wxEvtHandler_AddPendingEvent", (PyCFunction) _wrap_wxEvtHandler_AddPendingEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxEvtHandler_ProcessEvent", (PyCFunction) _wrap_wxEvtHandler_ProcessEvent, METH_VARARGS | METH_KEYWORDS }, { "wxEvtHandler_ProcessEvent", (PyCFunction) _wrap_wxEvtHandler_ProcessEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_PrevControlId", (PyCFunction) _wrap_wxWindow_PrevControlId, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_PrevControlId", (PyCFunction) _wrap_wxWindow_PrevControlId, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_NextControlId", (PyCFunction) _wrap_wxWindow_NextControlId, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_NextControlId", (PyCFunction) _wrap_wxWindow_NextControlId, METH_VARARGS | METH_KEYWORDS },

View File

@@ -27,6 +27,9 @@ class wxEvtHandlerPtr :
def ProcessEvent(self, *_args, **_kwargs): def ProcessEvent(self, *_args, **_kwargs):
val = apply(windowsc.wxEvtHandler_ProcessEvent,(self,) + _args, _kwargs) val = apply(windowsc.wxEvtHandler_ProcessEvent,(self,) + _args, _kwargs)
return val return val
def AddPendingEvent(self, *_args, **_kwargs):
val = apply(windowsc.wxEvtHandler_AddPendingEvent,(self,) + _args, _kwargs)
return val
def GetEvtHandlerEnabled(self, *_args, **_kwargs): def GetEvtHandlerEnabled(self, *_args, **_kwargs):
val = apply(windowsc.wxEvtHandler_GetEvtHandlerEnabled,(self,) + _args, _kwargs) val = apply(windowsc.wxEvtHandler_GetEvtHandlerEnabled,(self,) + _args, _kwargs)
return val return val
@@ -55,6 +58,9 @@ class wxEvtHandlerPtr :
return val return val
def __repr__(self): def __repr__(self):
return "<C wxEvtHandler instance at %s>" % (self.this,) return "<C wxEvtHandler instance at %s>" % (self.this,)
_prop_list_ = {}
class wxEvtHandler(wxEvtHandlerPtr): class wxEvtHandler(wxEvtHandlerPtr):
def __init__(self,this): def __init__(self,this):
self.this = this self.this = this
@@ -79,6 +85,12 @@ class wxValidatorPtr(wxEvtHandlerPtr):
return val return val
def __repr__(self): def __repr__(self):
return "<C wxValidator instance at %s>" % (self.this,) return "<C wxValidator instance at %s>" % (self.this,)
_prop_list_ = {
'window' : ('GetWindow', 'SetWindow'),
}
_prop_list_.update(wxEvtHandler._prop_list_)
class wxValidator(wxValidatorPtr): class wxValidator(wxValidatorPtr):
def __init__(self,*_args,**_kwargs): def __init__(self,*_args,**_kwargs):
self.this = apply(windowsc.new_wxValidator,_args,_kwargs) self.this = apply(windowsc.new_wxValidator,_args,_kwargs)
@@ -472,6 +484,10 @@ class wxWindowPtr(wxEvtHandlerPtr):
def SetSizer(self, *_args, **_kwargs): def SetSizer(self, *_args, **_kwargs):
val = apply(windowsc.wxWindow_SetSizer,(self,) + _args, _kwargs) val = apply(windowsc.wxWindow_SetSizer,(self,) + _args, _kwargs)
return val return val
def GetSizer(self, *_args, **_kwargs):
val = apply(windowsc.wxWindow_GetSizer,(self,) + _args, _kwargs)
if val: val = wxSizerPtr(val)
return val
def GetValidator(self, *_args, **_kwargs): def GetValidator(self, *_args, **_kwargs):
val = apply(windowsc.wxWindow_GetValidator,(self,) + _args, _kwargs) val = apply(windowsc.wxWindow_GetValidator,(self,) + _args, _kwargs)
if val: val = wxValidatorPtr(val) if val: val = wxValidatorPtr(val)
@@ -506,7 +522,38 @@ class wxWindowPtr(wxEvtHandlerPtr):
val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs) val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs)
if val: val = wxCaretPtr(val) if val: val = wxCaretPtr(val)
return val return val
_prop_list_ = {
'size' : ('GetSize', 'SetSize'),
'enabled' : ('IsEnabled', 'Enable'),
'background' : ('GetBackgroundColour', 'SetBackgroundColour'),
'foreground' : ('GetForegroundColour', 'SetForegroundColour'),
'children' : ('GetChildren', None),
'charHeight' : ('GetCharHeight', None),
'charWidth' : ('GetCharWidth', None),
'clientSize' : ('GetClientSize', 'SetClientSize'),
'font' : ('GetFont', 'SetFont'),
'grandParent' : ('GetGrandParent', None),
'handle' : ('GetHandle', None),
'label' : ('GetLabel', 'SetLabel'),
'name' : ('GetName', 'SetName'),
'parent' : ('GetParent', None),
'position' : ('GetPosition', 'SetPosition'),
'title' : ('GetTitle', 'SetTitle'),
'style' : ('GetWindowStyleFlag', 'SetWindowStyleFlag'),
'visible' : ('IsShown', 'Show'),
'toolTip' : ('GetToolTip', 'SetToolTip'),
'sizer' : ('GetSizer', 'SetSizer'),
'validator' : ('GetValidator', 'SetValidator'),
'dropTarget' : ('GetDropTarget', 'SetDropTarget'),
'caret' : ('GetCaret', 'SetCaret'),
'autoLayout' : ('GetAutoLayout', 'SetAutoLayout'),
'constraints' : ('GetConstraints', 'SetConstraints'),
}
_prop_list_.update(wxEvtHandler._prop_list_)
class wxWindow(wxWindowPtr): class wxWindow(wxWindowPtr):
def __init__(self,*_args,**_kwargs): def __init__(self,*_args,**_kwargs):
self.this = apply(windowsc.new_wxWindow,_args,_kwargs) self.this = apply(windowsc.new_wxWindow,_args,_kwargs)

View File

@@ -920,11 +920,11 @@ public:
// minutes and seconds make sense, but not "PM/AM" string for example. // minutes and seconds make sense, but not "PM/AM" string for example.
wxString Format(const char *format = "%c") const; wxString Format(const char *format = "%c") const;
// preferred date representation for the current locale // // preferred date representation for the current locale
wxString FormatDate() const; // wxString FormatDate() const;
// preferred time representation for the current locale // // preferred time representation for the current locale
wxString FormatTime() const; // wxString FormatTime() const;
// %pragma(python) addtoclass = " // %pragma(python) addtoclass = "
// def __repr__(self): // def __repr__(self):
@@ -1015,6 +1015,14 @@ public:
} }
}; };
//---------------------------------------------------------------------------
long wxGetLocalTime();
long wxGetUTCTime();
long wxGetCurrentTime();
wxLongLong wxGetLocalTimeMillis();
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@@ -36,6 +36,7 @@
class wxEvtHandler { class wxEvtHandler {
public: public:
bool ProcessEvent(wxEvent& event); bool ProcessEvent(wxEvent& event);
void AddPendingEvent(wxEvent& event);
//bool SearchEventTable(wxEventTable& table, wxEvent& event); //bool SearchEventTable(wxEventTable& table, wxEvent& event);
bool GetEvtHandlerEnabled(); bool GetEvtHandlerEnabled();
@@ -64,6 +65,32 @@ public:
} }
} }
%pragma(python) addtoclass = "
_prop_list_ = {}
"
// %pragma(python) addtoclass = "
// def __getattr__(self, name):
// pl = self._prop_list_
// if pl.has_key(name):
// getFunc, setFunc = pl[name]
// if getFunc:
// return getattr(self, getFunc)()
// else:
// raise TypeError, '%s property is write-only' % name
// raise AttributeError, name
// def __setattr__(self, name, value):
// pl = self._prop_list_
// if pl.has_key(name):
// getFunc, setFunc = pl[name]
// if setFunc:
// return getattr(self, setFunc)(value)
// else:
// raise TypeError, '%s property is read-only' % name
// self.__dict__[name] = value
// "
}; };
@@ -77,6 +104,14 @@ public:
wxValidator* Clone(); wxValidator* Clone();
wxWindow* GetWindow(); wxWindow* GetWindow();
void SetWindow(wxWindow* window); void SetWindow(wxWindow* window);
// Properties list
%pragma(python) addtoclass = "
_prop_list_ = {
'window' : ('GetWindow', 'SetWindow'),
}
_prop_list_.update(wxEvtHandler._prop_list_)
"
}; };
%inline %{ %inline %{
@@ -321,6 +356,8 @@ public:
wxToolTip* GetToolTip(); wxToolTip* GetToolTip();
void SetSizer(wxSizer* sizer); void SetSizer(wxSizer* sizer);
wxSizer* GetSizer();
wxValidator* GetValidator(); wxValidator* GetValidator();
void SetValidator(const wxValidator& validator); void SetValidator(const wxValidator& validator);
@@ -338,7 +375,41 @@ public:
val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs) val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs)
if val: val = wxCaretPtr(val) if val: val = wxCaretPtr(val)
return val return val
" "
// Properties list
%pragma(python) addtoclass = "
_prop_list_ = {
'size' : ('GetSize', 'SetSize'),
'enabled' : ('IsEnabled', 'Enable'),
'background' : ('GetBackgroundColour', 'SetBackgroundColour'),
'foreground' : ('GetForegroundColour', 'SetForegroundColour'),
'children' : ('GetChildren', None),
'charHeight' : ('GetCharHeight', None),
'charWidth' : ('GetCharWidth', None),
'clientSize' : ('GetClientSize', 'SetClientSize'),
'font' : ('GetFont', 'SetFont'),
'grandParent' : ('GetGrandParent', None),
'handle' : ('GetHandle', None),
'label' : ('GetLabel', 'SetLabel'),
'name' : ('GetName', 'SetName'),
'parent' : ('GetParent', None),
'position' : ('GetPosition', 'SetPosition'),
'title' : ('GetTitle', 'SetTitle'),
'style' : ('GetWindowStyleFlag', 'SetWindowStyleFlag'),
'visible' : ('IsShown', 'Show'),
'toolTip' : ('GetToolTip', 'SetToolTip'),
'sizer' : ('GetSizer', 'SetSizer'),
'validator' : ('GetValidator', 'SetValidator'),
'dropTarget' : ('GetDropTarget', 'SetDropTarget'),
'caret' : ('GetCaret', 'SetCaret'),
'autoLayout' : ('GetAutoLayout', 'SetAutoLayout'),
'constraints' : ('GetConstraints', 'SetConstraints'),
}
_prop_list_.update(wxEvtHandler._prop_list_)
"
}; };
//%clear int* x, int* y; //%clear int* x, int* y;
@@ -470,7 +541,7 @@ public:
void Scroll(int x, int y); void Scroll(int x, int y);
void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY, int noUnitsX, int noUnitsY,
int xPos = 0, int yPos = 0); int xPos = 0, int yPos = 0, int noRefresh=FALSE);
void SetScrollPageSize(int orient, int pageSize); void SetScrollPageSize(int orient, int pageSize);
void SetTargetWindow(wxWindow* window); void SetTargetWindow(wxWindow* window);
void GetViewStart(int* OUTPUT, int* OUTPUT); void GetViewStart(int* OUTPUT, int* OUTPUT);

View File

@@ -59,9 +59,14 @@ class SplashScreen(wxFrame):
size = (size[0], wxSystemSettings_GetSystemMetric(wxSYS_SCREEN_Y)) size = (size[0], wxSystemSettings_GetSystemMetric(wxSYS_SCREEN_Y))
wxFrame.__init__(self, parent, ID, title, pos, size, style) wxFrame.__init__(self, parent, ID, title, pos, size, style)
EVT_LEFT_DOWN(self, self.OnMouseClick)
EVT_CLOSE(self, self.OnCloseWindow)
EVT_PAINT(self, self.OnPaint)
EVT_ERASE_BACKGROUND(self, self.OnEraseBG)
self.Show(true) self.Show(true)
dc = wxClientDC(self) #dc = wxClientDC(self)
dc.DrawBitmap(self.bitmap, 0,0, false) #dc.DrawBitmap(self.bitmap, 0,0, false)
class SplashTimer(wxTimer): class SplashTimer(wxTimer):
def __init__(self, targetFunction): def __init__(self, targetFunction):
@@ -73,26 +78,23 @@ class SplashScreen(wxFrame):
self.timer = SplashTimer(callback) self.timer = SplashTimer(callback)
self.timer.Start(duration, 1) # one-shot only self.timer.Start(duration, 1) # one-shot only
EVT_LEFT_DOWN(self, self.OnMouseClick)
EVT_CLOSE(self, self.OnCloseWindow)
EVT_PAINT(self, self.OnPaint)
def OnPaint(self, event): def OnPaint(self, event):
dc = wxPaintDC(self) dc = wxPaintDC(self)
dc.DrawBitmap(self.bitmap, 0,0, false) dc.DrawBitmap(self.bitmap, 0,0, false)
def OnEraseBG(self, event):
pass
def OnSplashExitDefault(self, event=None): def OnSplashExitDefault(self, event=None):
self.Close(true) self.Close(true)
def OnCloseWindow(self, event=None): def OnCloseWindow(self, event=None):
self.Show(false) self.Show(false)
self.timer.Stop() self.timer.Stop()
del self.timer del self.timer
self.Destroy() self.Destroy()
def OnMouseClick(self, event): def OnMouseClick(self, event):
self.timer.Notify() self.timer.Notify()