} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
- } else {
- o2 = target;
- target = PyTuple_New(1);
- PyTuple_SetItem(target, 0, o2);
-
+ } else {
+ if (!PyTuple_Check(target)) {
+ o2 = target;
+ target = PyTuple_New(1);
+ PyTuple_SetItem(target, 0, o2);
+ }
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
Py_DECREF(o3);
}
return target;
-}
+ }
PyObject *wxPyTreeListCtrl_GetBoundingRect(wxPyTreeListCtrl *self,wxTreeItemId const &item,bool textOnly){
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
- } else {
- o2 = target;
- target = PyTuple_New(1);
- PyTuple_SetItem(target, 0, o2);
-
+ } else {
+ if (!PyTuple_Check(target)) {
+ o2 = target;
+ target = PyTuple_New(1);
+ PyTuple_SetItem(target, 0, o2);
+ }
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
Py_DECREF(o3);
}
return target;
-}
+ }
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
- } else {
- o2 = target;
- target = PyTuple_New(1);
- PyTuple_SetItem(target, 0, o2);
-
+ } else {
+ if (!PyTuple_Check(target)) {
+ o2 = target;
+ target = PyTuple_New(1);
+ PyTuple_SetItem(target, 0, o2);
+ }
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
Py_DECREF(o3);
}
return target;
-}
+ }
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
- } else {
- o2 = target;
- target = PyTuple_New(1);
- PyTuple_SetItem(target, 0, o2);
-
+ } else {
+ if (!PyTuple_Check(target)) {
+ o2 = target;
+ target = PyTuple_New(1);
+ PyTuple_SetItem(target, 0, o2);
+ }
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
Py_DECREF(o3);
}
return target;
-}
+ }
"""
return _core_.Window_GetHandle(*args, **kwargs)
+ def AssociateHandle(*args, **kwargs):
+ """
+ AssociateHandle(self, long handle)
+
+ Associate the window with a new native handle
+ """
+ return _core_.Window_AssociateHandle(*args, **kwargs)
+
+ def DissociateHandle(*args, **kwargs):
+ """
+ DissociateHandle(self)
+
+ Dissociate the current native handle from the window
+ """
+ return _core_.Window_DissociateHandle(*args, **kwargs)
+
def HasScrollbar(*args, **kwargs):
"""
HasScrollbar(self, int orient) -> bool
def Show(*args, **kwargs):
"""
- Show(self, item, bool show=True)
+ Show(self, item, bool show=True, bool recursive=False) -> bool
Shows or hides an item managed by the sizer. To make a sizer item
disappear or reappear, use Show followed by `Layout`. The *item*
parameter can be either a window, a sizer, or the zero-based index of
- the item.
+ the item. Use the recursive parameter to show or hide an item in a
+ subsizer. Returns True if the item was found.
"""
return _core_.Sizer_Show(*args, **kwargs)
"""
return _core_.Sizer_IsShown(*args, **kwargs)
- def Hide(self, item):
+ def Hide(self, item, recursive=False):
"""
- A convenience method for Show(item, False).
+ A convenience method for Show(item, False, recursive).
"""
- self.Show(item, False)
+ return self.Show(item, False, recursive)
def ShowItems(*args, **kwargs):
"""
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
- } else {
- o2 = target;
- target = PyTuple_New(1);
- PyTuple_SetItem(target, 0, o2);
-
+ } else {
+ if (!PyTuple_Check(target)) {
+ o2 = target;
+ target = PyTuple_New(1);
+ PyTuple_SetItem(target, 0, o2);
+ }
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
Py_DECREF(o3);
}
return target;
-}
+ }
void wxPoint2D_Set(wxPoint2D *self,double x,double y){
long wxWindow_GetHandle(wxWindow *self){
return wxPyGetWinHandle(self);
}
+void wxWindow_AssociateHandle(wxWindow *self,long handle){
+ self->AssociateHandle((WXWidget)handle);
+ }
wxWindow* wxFindWindowById( long id, const wxWindow *parent = NULL ) {
return wxWindow::FindWindowById(id, parent);
wxSizerItemList& list = self->GetChildren();
return wxPy_ConvertList(&list);
}
-void wxSizer_Show(wxSizer *self,PyObject *item,bool show){
+bool wxSizer_Show(wxSizer *self,PyObject *item,bool show,bool recursive){
bool blocked = wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True);
wxPyEndBlockThreads(blocked);
if ( info.window )
- self->Show(info.window, show);
+ return self->Show(info.window, show, recursive);
else if ( info.sizer )
- self->Show(info.sizer, show);
+ return self->Show(info.sizer, show, recursive);
else if ( info.gotPos )
- self->Show(info.pos, show);
+ return self->Show(info.pos, show);
}
bool wxSizer_IsShown(wxSizer *self,PyObject *item){
bool blocked = wxPyBeginBlockThreads();
}
+static PyObject *_wrap_Window_AssociateHandle(PyObject *, PyObject *args, PyObject *kwargs) {
+ PyObject *resultobj;
+ wxWindow *arg1 = (wxWindow *) 0 ;
+ long arg2 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ char *kwnames[] = {
+ (char *) "self",(char *) "handle", NULL
+ };
+
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Window_AssociateHandle",kwnames,&obj0,&obj1)) goto fail;
+ if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow,
+ SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+ arg2 = (long)SWIG_As_long(obj1);
+ if (PyErr_Occurred()) SWIG_fail;
+ {
+ PyThreadState* __tstate = wxPyBeginAllowThreads();
+ wxWindow_AssociateHandle(arg1,arg2);
+
+ wxPyEndAllowThreads(__tstate);
+ if (PyErr_Occurred()) SWIG_fail;
+ }
+ Py_INCREF(Py_None); resultobj = Py_None;
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
+static PyObject *_wrap_Window_DissociateHandle(PyObject *, PyObject *args, PyObject *kwargs) {
+ PyObject *resultobj;
+ wxWindow *arg1 = (wxWindow *) 0 ;
+ PyObject * obj0 = 0 ;
+ char *kwnames[] = {
+ (char *) "self", NULL
+ };
+
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Window_DissociateHandle",kwnames,&obj0)) goto fail;
+ if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow,
+ SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+ {
+ PyThreadState* __tstate = wxPyBeginAllowThreads();
+ (arg1)->DissociateHandle();
+
+ wxPyEndAllowThreads(__tstate);
+ if (PyErr_Occurred()) SWIG_fail;
+ }
+ Py_INCREF(Py_None); resultobj = Py_None;
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
static PyObject *_wrap_Window_HasScrollbar(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxWindow *arg1 = (wxWindow *) 0 ;
wxSizer *arg1 = (wxSizer *) 0 ;
PyObject *arg2 = (PyObject *) 0 ;
bool arg3 = (bool) True ;
+ bool arg4 = (bool) False ;
+ bool result;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
char *kwnames[] = {
- (char *) "self",(char *) "item",(char *) "show", NULL
+ (char *) "self",(char *) "item",(char *) "show",(char *) "recursive", NULL
};
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:Sizer_Show",kwnames,&obj0,&obj1,&obj2)) goto fail;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OO:Sizer_Show",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail;
if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxSizer,
SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
arg2 = obj1;
arg3 = (bool)SWIG_As_bool(obj2);
if (PyErr_Occurred()) SWIG_fail;
}
+ if (obj3) {
+ arg4 = (bool)SWIG_As_bool(obj3);
+ if (PyErr_Occurred()) SWIG_fail;
+ }
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- wxSizer_Show(arg1,arg2,arg3);
+ result = (bool)wxSizer_Show(arg1,arg2,arg3,arg4);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
}
- Py_INCREF(Py_None); resultobj = Py_None;
+ {
+ resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+ }
return resultobj;
fail:
return NULL;
{ (char *)"Window_PopupMenuXY", (PyCFunction) _wrap_Window_PopupMenuXY, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Window_PopupMenu", (PyCFunction) _wrap_Window_PopupMenu, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Window_GetHandle", (PyCFunction) _wrap_Window_GetHandle, METH_VARARGS | METH_KEYWORDS, NULL },
+ { (char *)"Window_AssociateHandle", (PyCFunction) _wrap_Window_AssociateHandle, METH_VARARGS | METH_KEYWORDS, NULL },
+ { (char *)"Window_DissociateHandle", (PyCFunction) _wrap_Window_DissociateHandle, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Window_HasScrollbar", (PyCFunction) _wrap_Window_HasScrollbar, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Window_SetScrollbar", (PyCFunction) _wrap_Window_SetScrollbar, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Window_SetScrollPos", (PyCFunction) _wrap_Window_SetScrollPos, METH_VARARGS | METH_KEYWORDS, NULL },
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
- } else {
- o2 = target;
- target = PyTuple_New(1);
- PyTuple_SetItem(target, 0, o2);
-
+ } else {
+ if (!PyTuple_Check(target)) {
+ o2 = target;
+ target = PyTuple_New(1);
+ PyTuple_SetItem(target, 0, o2);
+ }
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
Py_DECREF(o3);
}
return target;
-}
+ }
PyObject *wxPen_GetDashes(wxPen *self){
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = SystemOptions
_misc_.SystemOptions_swigregister(SystemOptionsPtr)
+cvar = _misc_.cvar
+WINDOW_DEFAULT_VARIANT = cvar.WINDOW_DEFAULT_VARIANT
def SystemOptions_SetOption(*args, **kwargs):
"""SystemOptions_SetOption(String name, String value)"""
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = MutexGuiLocker
_misc_.MutexGuiLocker_swigregister(MutexGuiLockerPtr)
-cvar = _misc_.cvar
FileSelectorPromptStr = cvar.FileSelectorPromptStr
FileSelectorDefaultWildcardStr = cvar.FileSelectorDefaultWildcardStr
DirSelectorPromptStr = cvar.DirSelectorPromptStr
"""GetWeek(self, int numWeek, int weekday=Mon, int flags=Monday_First) -> DateTime"""
return _misc_.DateTime_GetWeek(*args, **kwargs)
+ SetToTheWeek = wx._deprecated(SetToTheWeek, "SetToTheWeek is deprecated, use (static) SetToWeekOfYear instead")
+ GetWeek = wx._deprecated(GetWeek, "GetWeek is deprecated, use GetWeekOfYear instead")
+
+ def SetToWeekOfYear(*args, **kwargs):
+ """SetToWeekOfYear(int year, int numWeek, int weekday=Mon) -> DateTime"""
+ return _misc_.DateTime_SetToWeekOfYear(*args, **kwargs)
+
+ SetToWeekOfYear = staticmethod(SetToWeekOfYear)
def SetToLastMonthDay(*args, **kwargs):
"""SetToLastMonthDay(self, int month=Inv_Month, int year=Inv_Year) -> DateTime"""
return _misc_.DateTime_SetToLastMonthDay(*args, **kwargs)
val.thisown = 1
return val
+def DateTime_SetToWeekOfYear(*args, **kwargs):
+ """DateTime_SetToWeekOfYear(int year, int numWeek, int weekday=Mon) -> DateTime"""
+ return _misc_.DateTime_SetToWeekOfYear(*args, **kwargs)
+
class TimeSpan(object):
def __repr__(self):
return "<%s.%s; proxy of C++ wxTimeSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
return SWIG_AsVal_int(obj, (int*)0);
}
+ static const wxString wxPyWINDOW_DEFAULT_VARIANT(wxWINDOW_DEFAULT_VARIANT);
#include <wx/stockitem.h>
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
- } else {
- o2 = target;
- target = PyTuple_New(1);
- PyTuple_SetItem(target, 0, o2);
-
+ } else {
+ if (!PyTuple_Check(target)) {
+ o2 = target;
+ target = PyTuple_New(1);
+ PyTuple_SetItem(target, 0, o2);
+ }
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
Py_DECREF(o3);
}
return target;
-}
+ }
Py_INCREF(obj);
return Py_BuildValue((char *)"");
}
+static int _wrap_WINDOW_DEFAULT_VARIANT_set(PyObject *) {
+ PyErr_SetString(PyExc_TypeError,"Variable WINDOW_DEFAULT_VARIANT is read-only.");
+ return 1;
+}
+
+
+static PyObject *_wrap_WINDOW_DEFAULT_VARIANT_get() {
+ PyObject *pyobj;
+
+ {
+#if wxUSE_UNICODE
+ pyobj = PyUnicode_FromWideChar((&wxPyWINDOW_DEFAULT_VARIANT)->c_str(), (&wxPyWINDOW_DEFAULT_VARIANT)->Len());
+#else
+ pyobj = PyString_FromStringAndSize((&wxPyWINDOW_DEFAULT_VARIANT)->c_str(), (&wxPyWINDOW_DEFAULT_VARIANT)->Len());
+#endif
+ }
+ return pyobj;
+}
+
+
static PyObject *_wrap_new_SystemOptions(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxSystemOptions *result;
}
+static PyObject *_wrap_DateTime_SetToWeekOfYear(PyObject *, PyObject *args, PyObject *kwargs) {
+ PyObject *resultobj;
+ int arg1 ;
+ int arg2 ;
+ int arg3 = (int) wxDateTime::Mon ;
+ wxDateTime result;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ char *kwnames[] = {
+ (char *) "year",(char *) "numWeek",(char *) "weekday", NULL
+ };
+
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:DateTime_SetToWeekOfYear",kwnames,&obj0,&obj1,&obj2)) goto fail;
+ arg1 = (int)SWIG_As_int(obj0);
+ if (PyErr_Occurred()) SWIG_fail;
+ arg2 = (int)SWIG_As_int(obj1);
+ if (PyErr_Occurred()) SWIG_fail;
+ if (obj2) {
+ arg3 = (int)SWIG_As_int(obj2);
+ if (PyErr_Occurred()) SWIG_fail;
+ }
+ {
+ PyThreadState* __tstate = wxPyBeginAllowThreads();
+ result = wxDateTime::SetToWeekOfYear(arg1,arg2,(wxDateTime::WeekDay )arg3);
+
+ wxPyEndAllowThreads(__tstate);
+ if (PyErr_Occurred()) SWIG_fail;
+ }
+ {
+ wxDateTime * resultptr;
+ resultptr = new wxDateTime((wxDateTime &) result);
+ resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_wxDateTime, 1);
+ }
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
static PyObject *_wrap_DateTime_SetToLastMonthDay(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxDateTime *arg1 = (wxDateTime *) 0 ;
{ (char *)"DateTime_GetLastWeekDay", (PyCFunction) _wrap_DateTime_GetLastWeekDay, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"DateTime_SetToTheWeek", (PyCFunction) _wrap_DateTime_SetToTheWeek, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"DateTime_GetWeek", (PyCFunction) _wrap_DateTime_GetWeek, METH_VARARGS | METH_KEYWORDS, NULL },
+ { (char *)"DateTime_SetToWeekOfYear", (PyCFunction) _wrap_DateTime_SetToWeekOfYear, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"DateTime_SetToLastMonthDay", (PyCFunction) _wrap_DateTime_SetToLastMonthDay, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"DateTime_GetLastMonthDay", (PyCFunction) _wrap_DateTime_GetLastMonthDay, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"DateTime_SetToYearDay", (PyCFunction) _wrap_DateTime_SetToYearDay, METH_VARARGS | METH_KEYWORDS, NULL },
PyDict_SetItemString(d,"SYS_SCREEN_SMALL", SWIG_From_int((int)wxSYS_SCREEN_SMALL));
PyDict_SetItemString(d,"SYS_SCREEN_DESKTOP", SWIG_From_int((int)wxSYS_SCREEN_DESKTOP));
PyDict_SetItemString(d,(char*)"cvar", SWIG_globals);
+ SWIG_addvarlink(SWIG_globals,(char*)"WINDOW_DEFAULT_VARIANT",_wrap_WINDOW_DEFAULT_VARIANT_get, _wrap_WINDOW_DEFAULT_VARIANT_set);
SWIG_addvarlink(SWIG_globals,(char*)"FileSelectorPromptStr",_wrap_FileSelectorPromptStr_get, _wrap_FileSelectorPromptStr_set);
SWIG_addvarlink(SWIG_globals,(char*)"FileSelectorDefaultWildcardStr",_wrap_FileSelectorDefaultWildcardStr_get, _wrap_FileSelectorDefaultWildcardStr_set);
SWIG_addvarlink(SWIG_globals,(char*)"DirSelectorPromptStr",_wrap_DirSelectorPromptStr_get, _wrap_DirSelectorPromptStr_set);
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
- } else {
- o2 = target;
- target = PyTuple_New(1);
- PyTuple_SetItem(target, 0, o2);
-
+ } else {
+ if (!PyTuple_Check(target)) {
+ o2 = target;
+ target = PyTuple_New(1);
+ PyTuple_SetItem(target, 0, o2);
+ }
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
Py_DECREF(o3);
}
return target;
-}
+ }
def PySetDate(self, date):
"""takes datetime.datetime or datetime.date object"""
- self.SetDate(_py2wx(date))
+ self.SetDate(_pydate2wxdate(date))
def PyGetDate(self):
"""returns datetime.date object"""
- return _wx2py(self.GetDate())
+ return _wxdate2pydate(self.GetDate())
class CalendarEventPtr(CalendarEvent):
GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
def PySetDate(self, date):
"""takes datetime.datetime or datetime.date object"""
- self.SetDate(_py2wx(date))
+ self.SetDate(_pydate2wxdate(date))
def PyGetDate(self):
"""returns datetime.date object"""
- return _wx2py(self.GetDate())
+ return _wxdate2pydate(self.GetDate())
def PySetLowerDateLimit(self, date):
"""takes datetime.datetime or datetime.date object"""
- self.SetLowerDateLimit(_py2wx(date))
+ self.SetLowerDateLimit(_pydate2wxdate(date))
def PySetUpperDateLimit(self, date):
"""takes datetime.datetime or datetime.date object"""
- self.SetUpperDateLimit(_py2wx(date))
+ self.SetUpperDateLimit(_pydate2wxdate(date))
def PySetDateRange(self, lowerdate, upperdate):
"""takes datetime.datetime or datetime.date objects"""
def PyGetLowerDateLimit(self):
"""returns datetime.date object"""
- return _wx2py(self.GetLowerDateLimit())
+ return _wxdate2pydate(self.GetLowerDateLimit())
def PyGetUpperDateLimit(self):
"""returns datetime.date object"""
- return _wx2py(self.GetUpperDateLimit())
+ return _wxdate2pydate(self.GetUpperDateLimit())
class CalendarCtrlPtr(CalendarCtrl):
"""
return _calendar.CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs)
-def _py2wx(date):
+def _pydate2wxdate(date):
import datetime
assert isinstance(date, (datetime.datetime, datetime.date))
tt = date.timetuple()
dmy = (tt[2], tt[1]-1, tt[0])
return wx.DateTimeFromDMY(*dmy)
-def _wx2py(date):
+def _wxdate2pydate(date):
import datetime
assert isinstance(date, wx.DateTime)
- ymd = map(int, date.FormatISODate().split('-'))
- return datetime.date(*ymd)
+ if date.IsValid():
+ ymd = map(int, date.FormatISODate().split('-'))
+ return datetime.date(*ymd)
+ else:
+ return None
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
- } else {
- o2 = target;
- target = PyTuple_New(1);
- PyTuple_SetItem(target, 0, o2);
-
+ } else {
+ if (!PyTuple_Check(target)) {
+ o2 = target;
+ target = PyTuple_New(1);
+ PyTuple_SetItem(target, 0, o2);
+ }
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
Py_DECREF(o3);
}
return target;
-}
+ }
void wxGridCellAttrProvider__setOORInfo(wxGridCellAttrProvider *self,PyObject *_self){
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
- } else {
- o2 = target;
- target = PyTuple_New(1);
- PyTuple_SetItem(target, 0, o2);
-
+ } else {
+ if (!PyTuple_Check(target)) {
+ o2 = target;
+ target = PyTuple_New(1);
+ PyTuple_SetItem(target, 0, o2);
+ }
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
Py_DECREF(o3);
}
return target;
-}
+ }
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
- } else {
- o2 = target;
- target = PyTuple_New(1);
- PyTuple_SetItem(target, 0, o2);
-
+ } else {
+ if (!PyTuple_Check(target)) {
+ o2 = target;
+ target = PyTuple_New(1);
+ PyTuple_SetItem(target, 0, o2);
+ }
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
Py_DECREF(o3);
}
return target;
-}
+ }
"""
return _core_.Window_GetHandle(*args, **kwargs)
+ def AssociateHandle(*args, **kwargs):
+ """
+ AssociateHandle(self, long handle)
+
+ Associate the window with a new native handle
+ """
+ return _core_.Window_AssociateHandle(*args, **kwargs)
+
+ def DissociateHandle(*args, **kwargs):
+ """
+ DissociateHandle(self)
+
+ Dissociate the current native handle from the window
+ """
+ return _core_.Window_DissociateHandle(*args, **kwargs)
+
def OnPaint(*args, **kwargs):
"""OnPaint(self, PaintEvent event)"""
return _core_.Window_OnPaint(*args, **kwargs)
def Show(*args, **kwargs):
"""
- Show(self, item, bool show=True)
+ Show(self, item, bool show=True, bool recursive=False) -> bool
Shows or hides an item managed by the sizer. To make a sizer item
disappear or reappear, use Show followed by `Layout`. The *item*
parameter can be either a window, a sizer, or the zero-based index of
- the item.
+ the item. Use the recursive parameter to show or hide an item in a
+ subsizer. Returns True if the item was found.
"""
return _core_.Sizer_Show(*args, **kwargs)
"""
return _core_.Sizer_IsShown(*args, **kwargs)
- def Hide(self, item):
+ def Hide(self, item, recursive=False):
"""
- A convenience method for Show(item, False).
+ A convenience method for Show(item, False, recursive).
"""
- self.Show(item, False)
+ return self.Show(item, False, recursive)
def ShowItems(*args, **kwargs):
"""
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = SystemOptions
_misc_.SystemOptions_swigregister(SystemOptionsPtr)
+cvar = _misc_.cvar
+WINDOW_DEFAULT_VARIANT = cvar.WINDOW_DEFAULT_VARIANT
def SystemOptions_SetOption(*args, **kwargs):
"""SystemOptions_SetOption(String name, String value)"""
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = MutexGuiLocker
_misc_.MutexGuiLocker_swigregister(MutexGuiLockerPtr)
-cvar = _misc_.cvar
FileSelectorPromptStr = cvar.FileSelectorPromptStr
FileSelectorDefaultWildcardStr = cvar.FileSelectorDefaultWildcardStr
DirSelectorPromptStr = cvar.DirSelectorPromptStr
"""GetWeek(self, int numWeek, int weekday=Mon, int flags=Monday_First) -> DateTime"""
return _misc_.DateTime_GetWeek(*args, **kwargs)
+ SetToTheWeek = wx._deprecated(SetToTheWeek, "SetToTheWeek is deprecated, use (static) SetToWeekOfYear instead")
+ GetWeek = wx._deprecated(GetWeek, "GetWeek is deprecated, use GetWeekOfYear instead")
+
+ def SetToWeekOfYear(*args, **kwargs):
+ """SetToWeekOfYear(int year, int numWeek, int weekday=Mon) -> DateTime"""
+ return _misc_.DateTime_SetToWeekOfYear(*args, **kwargs)
+
+ SetToWeekOfYear = staticmethod(SetToWeekOfYear)
def SetToLastMonthDay(*args, **kwargs):
"""SetToLastMonthDay(self, int month=Inv_Month, int year=Inv_Year) -> DateTime"""
return _misc_.DateTime_SetToLastMonthDay(*args, **kwargs)
val.thisown = 1
return val
+def DateTime_SetToWeekOfYear(*args, **kwargs):
+ """DateTime_SetToWeekOfYear(int year, int numWeek, int weekday=Mon) -> DateTime"""
+ return _misc_.DateTime_SetToWeekOfYear(*args, **kwargs)
+
class TimeSpan(object):
def __repr__(self):
return "<%s.%s; proxy of C++ wxTimeSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def PySetDate(self, date):
"""takes datetime.datetime or datetime.date object"""
- self.SetDate(_py2wx(date))
+ self.SetDate(_pydate2wxdate(date))
def PyGetDate(self):
"""returns datetime.date object"""
- return _wx2py(self.GetDate())
+ return _wxdate2pydate(self.GetDate())
class CalendarEventPtr(CalendarEvent):
GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
def PySetDate(self, date):
"""takes datetime.datetime or datetime.date object"""
- self.SetDate(_py2wx(date))
+ self.SetDate(_pydate2wxdate(date))
def PyGetDate(self):
"""returns datetime.date object"""
- return _wx2py(self.GetDate())
+ return _wxdate2pydate(self.GetDate())
def PySetLowerDateLimit(self, date):
"""takes datetime.datetime or datetime.date object"""
- self.SetLowerDateLimit(_py2wx(date))
+ self.SetLowerDateLimit(_pydate2wxdate(date))
def PySetUpperDateLimit(self, date):
"""takes datetime.datetime or datetime.date object"""
- self.SetUpperDateLimit(_py2wx(date))
+ self.SetUpperDateLimit(_pydate2wxdate(date))
def PySetDateRange(self, lowerdate, upperdate):
"""takes datetime.datetime or datetime.date objects"""
def PyGetLowerDateLimit(self):
"""returns datetime.date object"""
- return _wx2py(self.GetLowerDateLimit())
+ return _wxdate2pydate(self.GetLowerDateLimit())
def PyGetUpperDateLimit(self):
"""returns datetime.date object"""
- return _wx2py(self.GetUpperDateLimit())
+ return _wxdate2pydate(self.GetUpperDateLimit())
class CalendarCtrlPtr(CalendarCtrl):
"""
return _calendar.CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs)
-def _py2wx(date):
+def _pydate2wxdate(date):
import datetime
assert isinstance(date, (datetime.datetime, datetime.date))
tt = date.timetuple()
dmy = (tt[2], tt[1]-1, tt[0])
return wx.DateTimeFromDMY(*dmy)
-def _wx2py(date):
+def _wxdate2pydate(date):
import datetime
assert isinstance(date, wx.DateTime)
- ymd = map(int, date.FormatISODate().split('-'))
- return datetime.date(*ymd)
+ if date.IsValid():
+ ymd = map(int, date.FormatISODate().split('-'))
+ return datetime.date(*ymd)
+ else:
+ return None