reSWIGged

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29135 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-09-14 06:29:24 +00:00
parent 7e63a44037
commit 629e65c221
17 changed files with 318 additions and 110 deletions

View File

@@ -7260,6 +7260,22 @@ class Window(EvtHandler):
"""
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)
@@ -9377,12 +9393,13 @@ class Sizer(Object):
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)
@@ -9397,11 +9414,11 @@ class Sizer(Object):
"""
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):
"""

View File

@@ -205,6 +205,8 @@ class SystemOptionsPtr(SystemOptions):
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)"""
@@ -544,7 +546,6 @@ class MutexGuiLockerPtr(MutexGuiLocker):
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
@@ -3440,6 +3441,14 @@ class DateTime(object):
"""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)
@@ -3827,6 +3836,10 @@ def DateTimeFromDMY(*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,)

View File

@@ -149,11 +149,11 @@ class CalendarEvent(_core.CommandEvent):
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):
@@ -476,19 +476,19 @@ class CalendarCtrl(_core.Control):
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"""
@@ -497,11 +497,11 @@ class CalendarCtrl(_core.Control):
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):
@@ -540,17 +540,20 @@ def CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs):
"""
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