X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d55e5bfc69a44b707b15fd27050d8bf634ef92c7..5f57b149e60ac95a47d45409ae3a9c9acaee04be:/wxPython/src/msw/_misc.py diff --git a/wxPython/src/msw/_misc.py b/wxPython/src/msw/_misc.py index dd18159de4..7b54b0a4d8 100644 --- a/wxPython/src/msw/_misc.py +++ b/wxPython/src/msw/_misc.py @@ -3,9 +3,49 @@ import _misc_ +def _swig_setattr_nondynamic(self,class_type,name,value,static=1): + if (name == "this"): + if isinstance(value, class_type): + self.__dict__[name] = value.this + if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown + del value.thisown + return + method = class_type.__swig_setmethods__.get(name,None) + if method: return method(self,value) + if (not static) or hasattr(self,name) or (name == "thisown"): + self.__dict__[name] = value + else: + raise AttributeError("You cannot add attributes to %s" % self) + +def _swig_setattr(self,class_type,name,value): + return _swig_setattr_nondynamic(self,class_type,name,value,0) + +def _swig_getattr(self,class_type,name): + method = class_type.__swig_getmethods__.get(name,None) + if method: return method(self) + raise AttributeError,name + +import types +try: + _object = types.ObjectType + _newclass = 1 +except AttributeError: + class _object : pass + _newclass = 0 +del types + + +def _swig_setattr_nondynamic_method(set): + def set_attr(self,name,value): + if hasattr(self,name) or (name in ("this", "thisown")): + set(self,name,value) + else: + raise AttributeError("You cannot add attributes to %s" % self) + return set_attr + + import _core wx = _core -__docfilter__ = wx.__docfilter__ #--------------------------------------------------------------------------- SYS_OEM_FIXED_FONT = _misc_.SYS_OEM_FIXED_FONT @@ -100,36 +140,37 @@ SYS_SCREEN_PDA = _misc_.SYS_SCREEN_PDA SYS_SCREEN_SMALL = _misc_.SYS_SCREEN_SMALL SYS_SCREEN_DESKTOP = _misc_.SYS_SCREEN_DESKTOP class SystemSettings(object): + """Proxy of C++ SystemSettings class""" def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ wxSystemSettings instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def GetColour(*args, **kwargs): - """SystemSettings.GetColour(int index) -> Colour""" + """GetColour(int index) -> Colour""" return _misc_.SystemSettings_GetColour(*args, **kwargs) GetColour = staticmethod(GetColour) def GetFont(*args, **kwargs): - """SystemSettings.GetFont(int index) -> Font""" + """GetFont(int index) -> Font""" return _misc_.SystemSettings_GetFont(*args, **kwargs) GetFont = staticmethod(GetFont) def GetMetric(*args, **kwargs): - """SystemSettings.GetMetric(int index) -> int""" + """GetMetric(int index, Window win=None) -> int""" return _misc_.SystemSettings_GetMetric(*args, **kwargs) GetMetric = staticmethod(GetMetric) def HasFeature(*args, **kwargs): - """SystemSettings.HasFeature(int index) -> bool""" + """HasFeature(int index) -> bool""" return _misc_.SystemSettings_HasFeature(*args, **kwargs) HasFeature = staticmethod(HasFeature) def GetScreenType(*args, **kwargs): - """SystemSettings.GetScreenType() -> int""" + """GetScreenType() -> int""" return _misc_.SystemSettings_GetScreenType(*args, **kwargs) GetScreenType = staticmethod(GetScreenType) def SetScreenType(*args, **kwargs): - """SystemSettings.SetScreenType(int screen)""" + """SetScreenType(int screen)""" return _misc_.SystemSettings_SetScreenType(*args, **kwargs) SetScreenType = staticmethod(SetScreenType) @@ -150,7 +191,7 @@ def SystemSettings_GetFont(*args, **kwargs): return _misc_.SystemSettings_GetFont(*args, **kwargs) def SystemSettings_GetMetric(*args, **kwargs): - """SystemSettings_GetMetric(int index) -> int""" + """SystemSettings_GetMetric(int index, Window win=None) -> int""" return _misc_.SystemSettings_GetMetric(*args, **kwargs) def SystemSettings_HasFeature(*args, **kwargs): @@ -166,6 +207,7 @@ def SystemSettings_SetScreenType(*args, **kwargs): return _misc_.SystemSettings_SetScreenType(*args, **kwargs) class SystemOptions(_core.Object): + """Proxy of C++ SystemOptions class""" def __repr__(self): return "<%s.%s; proxy of C++ wxSystemOptions instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -175,30 +217,35 @@ class SystemOptions(_core.Object): self.thisown = 1 del newobj.thisown def SetOption(*args, **kwargs): - """SystemOptions.SetOption(String name, String value)""" + """SetOption(String name, String value)""" return _misc_.SystemOptions_SetOption(*args, **kwargs) SetOption = staticmethod(SetOption) def SetOptionInt(*args, **kwargs): - """SystemOptions.SetOptionInt(String name, int value)""" + """SetOptionInt(String name, int value)""" return _misc_.SystemOptions_SetOptionInt(*args, **kwargs) SetOptionInt = staticmethod(SetOptionInt) def GetOption(*args, **kwargs): - """SystemOptions.GetOption(String name) -> String""" + """GetOption(String name) -> String""" return _misc_.SystemOptions_GetOption(*args, **kwargs) GetOption = staticmethod(GetOption) def GetOptionInt(*args, **kwargs): - """SystemOptions.GetOptionInt(String name) -> int""" + """GetOptionInt(String name) -> int""" return _misc_.SystemOptions_GetOptionInt(*args, **kwargs) GetOptionInt = staticmethod(GetOptionInt) def HasOption(*args, **kwargs): - """SystemOptions.HasOption(String name) -> bool""" + """HasOption(String name) -> bool""" return _misc_.SystemOptions_HasOption(*args, **kwargs) HasOption = staticmethod(HasOption) + def IsFalse(*args, **kwargs): + """IsFalse(String name) -> bool""" + return _misc_.SystemOptions_IsFalse(*args, **kwargs) + + IsFalse = staticmethod(IsFalse) class SystemOptionsPtr(SystemOptions): def __init__(self, this): @@ -206,6 +253,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)""" @@ -227,6 +276,10 @@ def SystemOptions_HasOption(*args, **kwargs): """SystemOptions_HasOption(String name) -> bool""" return _misc_.SystemOptions_HasOption(*args, **kwargs) +def SystemOptions_IsFalse(*args, **kwargs): + """SystemOptions_IsFalse(String name) -> bool""" + return _misc_.SystemOptions_IsFalse(*args, **kwargs) + #--------------------------------------------------------------------------- @@ -242,6 +295,18 @@ def GetCurrentId(*args, **kwargs): """GetCurrentId() -> long""" return _misc_.GetCurrentId(*args, **kwargs) +def IsStockID(*args, **kwargs): + """IsStockID(int id) -> bool""" + return _misc_.IsStockID(*args, **kwargs) + +def IsStockLabel(*args, **kwargs): + """IsStockLabel(int id, String label) -> bool""" + return _misc_.IsStockLabel(*args, **kwargs) + +def GetStockLabel(*args, **kwargs): + """GetStockLabel(int id, bool withCodes=True, String accelerator=EmptyString) -> String""" + return _misc_.GetStockLabel(*args, **kwargs) + def Bell(*args, **kwargs): """Bell()""" return _misc_.Bell(*args, **kwargs) @@ -296,9 +361,14 @@ def Sleep(*args, **kwargs): """Sleep(int secs)""" return _misc_.Sleep(*args, **kwargs) -def Usleep(*args, **kwargs): - """Usleep(unsigned long milliseconds)""" - return _misc_.Usleep(*args, **kwargs) +def MilliSleep(*args, **kwargs): + """MilliSleep(unsigned long milliseconds)""" + return _misc_.MilliSleep(*args, **kwargs) + +def MicroSleep(*args, **kwargs): + """MicroSleep(unsigned long microseconds)""" + return _misc_.MicroSleep(*args, **kwargs) +Usleep = MilliSleep def EnableTopLevelWindows(*args, **kwargs): """EnableTopLevelWindows(bool enable)""" @@ -394,17 +464,17 @@ def GetPasswordFromUser(*args, **kwargs): def GetSingleChoice(*args, **kwargs): """ - GetSingleChoice(String message, String caption, int choices, String choices_array, - Window parent=None, int x=-1, - int y=-1, bool centre=True, int width=150, int height=200) -> String + GetSingleChoice(String message, String caption, int choices, Window parent=None, + int x=-1, int y=-1, bool centre=True, + int width=150, int height=200) -> String """ return _misc_.GetSingleChoice(*args, **kwargs) def GetSingleChoiceIndex(*args, **kwargs): """ - GetSingleChoiceIndex(String message, String caption, int choices, String choices_array, - Window parent=None, int x=-1, - int y=-1, bool centre=True, int width=150, int height=200) -> int + GetSingleChoiceIndex(String message, String caption, int choices, Window parent=None, + int x=-1, int y=-1, bool centre=True, + int width=150, int height=200) -> int """ return _misc_.GetSingleChoiceIndex(*args, **kwargs) @@ -485,7 +555,14 @@ def GetTopLevelParent(*args, **kwargs): return _misc_.GetTopLevelParent(*args, **kwargs) def GetKeyState(*args, **kwargs): - """GetKeyState(int key) -> bool""" + """ + GetKeyState(int key) -> bool + + Get the state of a key (true if pressed or toggled on, false if not.) + This is generally most useful getting the state of the modifier or + toggle keys. On some platforms those may be the only keys that work. + + """ return _misc_.GetKeyState(*args, **kwargs) def WakeUpMainThread(*args, **kwargs): @@ -500,6 +577,7 @@ def MutexGuiLeave(*args, **kwargs): """MutexGuiLeave()""" return _misc_.MutexGuiLeave(*args, **kwargs) class MutexGuiLocker(object): + """Proxy of C++ MutexGuiLocker class""" def __repr__(self): return "<%s.%s; proxy of C++ wxMutexGuiLocker instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -521,7 +599,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 @@ -533,6 +610,7 @@ def Thread_IsMain(*args, **kwargs): #--------------------------------------------------------------------------- class ToolTip(_core.Object): + """Proxy of C++ ToolTip class""" def __repr__(self): return "<%s.%s; proxy of C++ wxToolTip instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -554,12 +632,12 @@ class ToolTip(_core.Object): return _misc_.ToolTip_GetWindow(*args, **kwargs) def Enable(*args, **kwargs): - """ToolTip.Enable(bool flag)""" + """Enable(bool flag)""" return _misc_.ToolTip_Enable(*args, **kwargs) Enable = staticmethod(Enable) def SetDelay(*args, **kwargs): - """ToolTip.SetDelay(long milliseconds)""" + """SetDelay(long milliseconds)""" return _misc_.ToolTip_SetDelay(*args, **kwargs) SetDelay = staticmethod(SetDelay) @@ -580,6 +658,7 @@ def ToolTip_SetDelay(*args, **kwargs): return _misc_.ToolTip_SetDelay(*args, **kwargs) class Caret(object): + """Proxy of C++ Caret class""" def __repr__(self): return "<%s.%s; proxy of C++ wxCaret instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -588,11 +667,13 @@ class Caret(object): self.this = newobj.this self.thisown = 1 del newobj.thisown - def __del__(self, destroy=_misc_.delete_Caret): - """__del__(self)""" - try: - if self.thisown: destroy(self) - except: pass + def Destroy(*args, **kwargs): + """ + Destroy(self) + + Deletes the C++ object this Python object is a proxy for. + """ + return _misc_.Caret_Destroy(*args, **kwargs) def IsOk(*args, **kwargs): """IsOk(self) -> bool""" @@ -647,6 +728,16 @@ class Caret(object): return _misc_.Caret_Hide(*args, **kwargs) def __nonzero__(self): return self.IsOk() + def GetBlinkTime(*args, **kwargs): + """GetBlinkTime() -> int""" + return _misc_.Caret_GetBlinkTime(*args, **kwargs) + + GetBlinkTime = staticmethod(GetBlinkTime) + def SetBlinkTime(*args, **kwargs): + """SetBlinkTime(int milliseconds)""" + return _misc_.Caret_SetBlinkTime(*args, **kwargs) + + SetBlinkTime = staticmethod(SetBlinkTime) class CaretPtr(Caret): def __init__(self, this): @@ -655,7 +746,6 @@ class CaretPtr(Caret): self.__class__ = Caret _misc_.Caret_swigregister(CaretPtr) - def Caret_GetBlinkTime(*args, **kwargs): """Caret_GetBlinkTime() -> int""" return _misc_.Caret_GetBlinkTime(*args, **kwargs) @@ -663,7 +753,9 @@ def Caret_GetBlinkTime(*args, **kwargs): def Caret_SetBlinkTime(*args, **kwargs): """Caret_SetBlinkTime(int milliseconds)""" return _misc_.Caret_SetBlinkTime(*args, **kwargs) + class BusyCursor(object): + """Proxy of C++ BusyCursor class""" def __repr__(self): return "<%s.%s; proxy of C++ wxBusyCursor instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -687,6 +779,7 @@ class BusyCursorPtr(BusyCursor): _misc_.BusyCursor_swigregister(BusyCursorPtr) class WindowDisabler(object): + """Proxy of C++ WindowDisabler class""" def __repr__(self): return "<%s.%s; proxy of C++ wxWindowDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -710,6 +803,7 @@ class WindowDisablerPtr(WindowDisabler): _misc_.WindowDisabler_swigregister(WindowDisablerPtr) class BusyInfo(_core.Object): + """Proxy of C++ BusyInfo class""" def __repr__(self): return "<%s.%s; proxy of C++ wxBusyInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -733,6 +827,7 @@ class BusyInfoPtr(BusyInfo): _misc_.BusyInfo_swigregister(BusyInfoPtr) class StopWatch(object): + """Proxy of C++ StopWatch class""" def __repr__(self): return "<%s.%s; proxy of C++ wxStopWatch instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -766,10 +861,11 @@ class StopWatchPtr(StopWatch): _misc_.StopWatch_swigregister(StopWatchPtr) class FileHistory(_core.Object): + """Proxy of C++ FileHistory class""" def __repr__(self): return "<%s.%s; proxy of C++ wxFileHistory instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(self, int maxFiles=9) -> FileHistory""" + """__init__(self, int maxFiles=9, int idBase=ID_FILE1) -> FileHistory""" newobj = _misc_.new_FileHistory(*args, **kwargs) self.this = newobj.this self.thisown = 1 @@ -834,6 +930,7 @@ class FileHistoryPtr(FileHistory): _misc_.FileHistory_swigregister(FileHistoryPtr) class SingleInstanceChecker(object): + """Proxy of C++ SingleInstanceChecker class""" def __repr__(self): return "<%s.%s; proxy of C++ wxSingleInstanceChecker instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -872,11 +969,12 @@ def PreSingleInstanceChecker(*args, **kwargs): def DrawWindowOnDC(*args, **kwargs): - """DrawWindowOnDC(Window window, DC dc, int method)""" + """DrawWindowOnDC(Window window, DC dc) -> bool""" return _misc_.DrawWindowOnDC(*args, **kwargs) #--------------------------------------------------------------------------- class TipProvider(object): + """Proxy of C++ TipProvider class""" def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ wxTipProvider instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) @@ -907,6 +1005,7 @@ class TipProviderPtr(TipProvider): _misc_.TipProvider_swigregister(TipProviderPtr) class PyTipProvider(TipProvider): + """Proxy of C++ PyTipProvider class""" def __repr__(self): return "<%s.%s; proxy of C++ wxPyTipProvider instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -915,6 +1014,8 @@ class PyTipProvider(TipProvider): self.this = newobj.this self.thisown = 1 del newobj.thisown + self._setCallbackInfo(self, PyTipProvider) + def _setCallbackInfo(*args, **kwargs): """_setCallbackInfo(self, PyObject self, PyObject _class)""" return _misc_.PyTipProvider__setCallbackInfo(*args, **kwargs) @@ -941,6 +1042,7 @@ TIMER_CONTINUOUS = _misc_.TIMER_CONTINUOUS TIMER_ONE_SHOT = _misc_.TIMER_ONE_SHOT wxEVT_TIMER = _misc_.wxEVT_TIMER class Timer(_core.EvtHandler): + """Proxy of C++ Timer class""" def __repr__(self): return "<%s.%s; proxy of C++ wxPyTimer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -949,7 +1051,7 @@ class Timer(_core.EvtHandler): self.this = newobj.this self.thisown = 1 del newobj.thisown - self._setCallbackInfo(self, Timer, 0) + self._setCallbackInfo(self, Timer, 0); self._setOORInfo(self, 0) def __del__(self, destroy=_misc_.delete_Timer): """__del__(self)""" @@ -965,6 +1067,10 @@ class Timer(_core.EvtHandler): """SetOwner(self, EvtHandler owner, int id=-1)""" return _misc_.Timer_SetOwner(*args, **kwargs) + def GetOwner(*args, **kwargs): + """GetOwner(self) -> EvtHandler""" + return _misc_.Timer_GetOwner(*args, **kwargs) + def Start(*args, **kwargs): """Start(self, int milliseconds=-1, bool oneShot=False) -> bool""" return _misc_.Timer_Start(*args, **kwargs) @@ -989,6 +1095,10 @@ class Timer(_core.EvtHandler): """GetId(self) -> int""" return _misc_.Timer_GetId(*args, **kwargs) + def Destroy(): + """NO-OP: Timers must be destroyed by normal refrence counting""" + pass + class TimerPtr(Timer): def __init__(self, this): @@ -1012,6 +1122,7 @@ EVT_TIMER = wx.PyEventBinder( wxEVT_TIMER, 1 ) class TimerEvent(_core.Event): + """Proxy of C++ TimerEvent class""" def __repr__(self): return "<%s.%s; proxy of C++ wxTimerEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -1033,6 +1144,7 @@ class TimerEventPtr(TimerEvent): _misc_.TimerEvent_swigregister(TimerEventPtr) class TimerRunner(object): + """Proxy of C++ TimerRunner class""" def __repr__(self): return "<%s.%s; proxy of C++ wxTimerRunner instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args): @@ -1086,6 +1198,7 @@ TraceResAlloc = _misc_.TraceResAlloc TraceRefCount = _misc_.TraceRefCount TraceOleCalls = _misc_.TraceOleCalls class Log(object): + """Proxy of C++ Log class""" def __repr__(self): return "<%s.%s; proxy of C++ wxLog instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -1095,17 +1208,17 @@ class Log(object): self.thisown = 1 del newobj.thisown def IsEnabled(*args, **kwargs): - """Log.IsEnabled() -> bool""" + """IsEnabled() -> bool""" return _misc_.Log_IsEnabled(*args, **kwargs) IsEnabled = staticmethod(IsEnabled) def EnableLogging(*args, **kwargs): - """Log.EnableLogging(bool doIt=True) -> bool""" + """EnableLogging(bool doIt=True) -> bool""" return _misc_.Log_EnableLogging(*args, **kwargs) EnableLogging = staticmethod(EnableLogging) def OnLog(*args, **kwargs): - """Log.OnLog(wxLogLevel level, wxChar szString, time_t t)""" + """OnLog(wxLogLevel level, wxChar szString, time_t t)""" return _misc_.Log_OnLog(*args, **kwargs) OnLog = staticmethod(OnLog) @@ -1114,102 +1227,102 @@ class Log(object): return _misc_.Log_Flush(*args, **kwargs) def FlushActive(*args, **kwargs): - """Log.FlushActive()""" + """FlushActive()""" return _misc_.Log_FlushActive(*args, **kwargs) FlushActive = staticmethod(FlushActive) def GetActiveTarget(*args, **kwargs): - """Log.GetActiveTarget() -> Log""" + """GetActiveTarget() -> Log""" return _misc_.Log_GetActiveTarget(*args, **kwargs) GetActiveTarget = staticmethod(GetActiveTarget) def SetActiveTarget(*args, **kwargs): - """Log.SetActiveTarget(Log pLogger) -> Log""" + """SetActiveTarget(Log pLogger) -> Log""" return _misc_.Log_SetActiveTarget(*args, **kwargs) SetActiveTarget = staticmethod(SetActiveTarget) def Suspend(*args, **kwargs): - """Log.Suspend()""" + """Suspend()""" return _misc_.Log_Suspend(*args, **kwargs) Suspend = staticmethod(Suspend) def Resume(*args, **kwargs): - """Log.Resume()""" + """Resume()""" return _misc_.Log_Resume(*args, **kwargs) Resume = staticmethod(Resume) def SetVerbose(*args, **kwargs): - """Log.SetVerbose(bool bVerbose=True)""" + """SetVerbose(bool bVerbose=True)""" return _misc_.Log_SetVerbose(*args, **kwargs) SetVerbose = staticmethod(SetVerbose) def SetLogLevel(*args, **kwargs): - """Log.SetLogLevel(wxLogLevel logLevel)""" + """SetLogLevel(wxLogLevel logLevel)""" return _misc_.Log_SetLogLevel(*args, **kwargs) SetLogLevel = staticmethod(SetLogLevel) def DontCreateOnDemand(*args, **kwargs): - """Log.DontCreateOnDemand()""" + """DontCreateOnDemand()""" return _misc_.Log_DontCreateOnDemand(*args, **kwargs) DontCreateOnDemand = staticmethod(DontCreateOnDemand) def SetTraceMask(*args, **kwargs): - """Log.SetTraceMask(wxTraceMask ulMask)""" + """SetTraceMask(wxTraceMask ulMask)""" return _misc_.Log_SetTraceMask(*args, **kwargs) SetTraceMask = staticmethod(SetTraceMask) def AddTraceMask(*args, **kwargs): - """Log.AddTraceMask(String str)""" + """AddTraceMask(String str)""" return _misc_.Log_AddTraceMask(*args, **kwargs) AddTraceMask = staticmethod(AddTraceMask) def RemoveTraceMask(*args, **kwargs): - """Log.RemoveTraceMask(String str)""" + """RemoveTraceMask(String str)""" return _misc_.Log_RemoveTraceMask(*args, **kwargs) RemoveTraceMask = staticmethod(RemoveTraceMask) def ClearTraceMasks(*args, **kwargs): - """Log.ClearTraceMasks()""" + """ClearTraceMasks()""" return _misc_.Log_ClearTraceMasks(*args, **kwargs) ClearTraceMasks = staticmethod(ClearTraceMasks) def GetTraceMasks(*args, **kwargs): - """Log.GetTraceMasks() -> wxArrayString""" + """GetTraceMasks() -> wxArrayString""" return _misc_.Log_GetTraceMasks(*args, **kwargs) GetTraceMasks = staticmethod(GetTraceMasks) def SetTimestamp(*args, **kwargs): - """Log.SetTimestamp(wxChar ts)""" + """SetTimestamp(wxChar ts)""" return _misc_.Log_SetTimestamp(*args, **kwargs) SetTimestamp = staticmethod(SetTimestamp) def GetVerbose(*args, **kwargs): - """Log.GetVerbose() -> bool""" + """GetVerbose() -> bool""" return _misc_.Log_GetVerbose(*args, **kwargs) GetVerbose = staticmethod(GetVerbose) def GetTraceMask(*args, **kwargs): - """Log.GetTraceMask() -> wxTraceMask""" + """GetTraceMask() -> wxTraceMask""" return _misc_.Log_GetTraceMask(*args, **kwargs) GetTraceMask = staticmethod(GetTraceMask) def IsAllowedTraceMask(*args, **kwargs): - """Log.IsAllowedTraceMask(wxChar mask) -> bool""" + """IsAllowedTraceMask(wxChar mask) -> bool""" return _misc_.Log_IsAllowedTraceMask(*args, **kwargs) IsAllowedTraceMask = staticmethod(IsAllowedTraceMask) def GetLogLevel(*args, **kwargs): - """Log.GetLogLevel() -> wxLogLevel""" + """GetLogLevel() -> wxLogLevel""" return _misc_.Log_GetLogLevel(*args, **kwargs) GetLogLevel = staticmethod(GetLogLevel) def GetTimestamp(*args, **kwargs): - """Log.GetTimestamp() -> wxChar""" + """GetTimestamp() -> wxChar""" return _misc_.Log_GetTimestamp(*args, **kwargs) GetTimestamp = staticmethod(GetTimestamp) def TimeStamp(*args, **kwargs): - """Log.TimeStamp() -> String""" + """TimeStamp() -> String""" return _misc_.Log_TimeStamp(*args, **kwargs) TimeStamp = staticmethod(TimeStamp) @@ -1318,6 +1431,7 @@ def Log_TimeStamp(*args, **kwargs): return _misc_.Log_TimeStamp(*args, **kwargs) class LogStderr(Log): + """Proxy of C++ LogStderr class""" def __repr__(self): return "<%s.%s; proxy of C++ wxLogStderr instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -1335,6 +1449,7 @@ class LogStderrPtr(LogStderr): _misc_.LogStderr_swigregister(LogStderrPtr) class LogTextCtrl(Log): + """Proxy of C++ LogTextCtrl class""" def __repr__(self): return "<%s.%s; proxy of C++ wxLogTextCtrl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -1352,6 +1467,7 @@ class LogTextCtrlPtr(LogTextCtrl): _misc_.LogTextCtrl_swigregister(LogTextCtrlPtr) class LogGui(Log): + """Proxy of C++ LogGui class""" def __repr__(self): return "<%s.%s; proxy of C++ wxLogGui instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -1369,6 +1485,7 @@ class LogGuiPtr(LogGui): _misc_.LogGui_swigregister(LogGuiPtr) class LogWindow(Log): + """Proxy of C++ LogWindow class""" def __repr__(self): return "<%s.%s; proxy of C++ wxLogWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -1406,6 +1523,7 @@ class LogWindowPtr(LogWindow): _misc_.LogWindow_swigregister(LogWindowPtr) class LogChain(Log): + """Proxy of C++ LogChain class""" def __repr__(self): return "<%s.%s; proxy of C++ wxLogChain instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -1495,6 +1613,7 @@ def SafeShowMessage(*args, **kwargs): """SafeShowMessage(String title, String text)""" return _misc_.SafeShowMessage(*args, **kwargs) class LogNull(object): + """Proxy of C++ LogNull class""" def __repr__(self): return "<%s.%s; proxy of C++ wxLogNull instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -1525,6 +1644,7 @@ def LogTrace(*args): return _misc_.LogTrace(*args) class PyLog(Log): + """Proxy of C++ PyLog class""" def __repr__(self): return "<%s.%s; proxy of C++ wxPyLog instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -1556,6 +1676,8 @@ KILL_BAD_SIGNAL = _misc_.KILL_BAD_SIGNAL KILL_ACCESS_DENIED = _misc_.KILL_ACCESS_DENIED KILL_NO_PROCESS = _misc_.KILL_NO_PROCESS KILL_ERROR = _misc_.KILL_ERROR +KILL_NOCHILDREN = _misc_.KILL_NOCHILDREN +KILL_CHILDREN = _misc_.KILL_CHILDREN SIGNONE = _misc_.SIGNONE SIGHUP = _misc_.SIGHUP SIGINT = _misc_.SIGINT @@ -1574,20 +1696,21 @@ SIGPIPE = _misc_.SIGPIPE SIGALRM = _misc_.SIGALRM SIGTERM = _misc_.SIGTERM class Process(_core.EvtHandler): + """Proxy of C++ Process class""" def __repr__(self): return "<%s.%s; proxy of C++ wxPyProcess instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def Kill(*args, **kwargs): - """Process.Kill(int pid, int sig=SIGTERM) -> int""" + """Kill(int pid, int sig=SIGTERM, int flags=KILL_NOCHILDREN) -> int""" return _misc_.Process_Kill(*args, **kwargs) Kill = staticmethod(Kill) def Exists(*args, **kwargs): - """Process.Exists(int pid) -> bool""" + """Exists(int pid) -> bool""" return _misc_.Process_Exists(*args, **kwargs) Exists = staticmethod(Exists) def Open(*args, **kwargs): - """Process.Open(String cmd, int flags=EXEC_ASYNC) -> Process""" + """Open(String cmd, int flags=EXEC_ASYNC) -> Process""" return _misc_.Process_Open(*args, **kwargs) Open = staticmethod(Open) @@ -1656,7 +1779,7 @@ class ProcessPtr(Process): _misc_.Process_swigregister(ProcessPtr) def Process_Kill(*args, **kwargs): - """Process_Kill(int pid, int sig=SIGTERM) -> int""" + """Process_Kill(int pid, int sig=SIGTERM, int flags=KILL_NOCHILDREN) -> int""" return _misc_.Process_Kill(*args, **kwargs) def Process_Exists(*args, **kwargs): @@ -1668,6 +1791,7 @@ def Process_Open(*args, **kwargs): return _misc_.Process_Open(*args, **kwargs) class ProcessEvent(_core.Event): + """Proxy of C++ ProcessEvent class""" def __repr__(self): return "<%s.%s; proxy of C++ wxProcessEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -1701,10 +1825,15 @@ EXEC_ASYNC = _misc_.EXEC_ASYNC EXEC_SYNC = _misc_.EXEC_SYNC EXEC_NOHIDE = _misc_.EXEC_NOHIDE EXEC_MAKE_GROUP_LEADER = _misc_.EXEC_MAKE_GROUP_LEADER +EXEC_NODISABLE = _misc_.EXEC_NODISABLE def Execute(*args, **kwargs): """Execute(String command, int flags=EXEC_ASYNC, Process process=None) -> long""" return _misc_.Execute(*args, **kwargs) + +def Kill(*args, **kwargs): + """Kill(long pid, int sig=SIGTERM, int rc, int flags=KILL_NOCHILDREN) -> int""" + return _misc_.Kill(*args, **kwargs) #--------------------------------------------------------------------------- JOYSTICK1 = _misc_.JOYSTICK1 @@ -1715,6 +1844,7 @@ JOY_BUTTON2 = _misc_.JOY_BUTTON2 JOY_BUTTON3 = _misc_.JOY_BUTTON3 JOY_BUTTON4 = _misc_.JOY_BUTTON4 class Joystick(object): + """Proxy of C++ Joystick class""" def __repr__(self): return "<%s.%s; proxy of C++ wxJoystick instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -1911,13 +2041,9 @@ wxEVT_JOY_BUTTON_UP = _misc_.wxEVT_JOY_BUTTON_UP wxEVT_JOY_MOVE = _misc_.wxEVT_JOY_MOVE wxEVT_JOY_ZMOVE = _misc_.wxEVT_JOY_ZMOVE class JoystickEvent(_core.Event): + """Proxy of C++ JoystickEvent class""" def __repr__(self): return "<%s.%s; proxy of C++ wxJoystickEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) - m_pos = property(_misc_.JoystickEvent_m_pos_get, _misc_.JoystickEvent_m_pos_set) - m_zPosition = property(_misc_.JoystickEvent_m_zPosition_get, _misc_.JoystickEvent_m_zPosition_set) - m_buttonChange = property(_misc_.JoystickEvent_m_buttonChange_get, _misc_.JoystickEvent_m_buttonChange_set) - m_buttonState = property(_misc_.JoystickEvent_m_buttonState_get, _misc_.JoystickEvent_m_buttonState_set) - m_joyStick = property(_misc_.JoystickEvent_m_joyStick_get, _misc_.JoystickEvent_m_joyStick_set) def __init__(self, *args, **kwargs): """ __init__(self, wxEventType type=wxEVT_NULL, int state=0, int joystick=JOYSTICK1, @@ -1991,6 +2117,12 @@ class JoystickEvent(_core.Event): """ButtonIsDown(self, int but=JOY_BUTTON_ANY) -> bool""" return _misc_.JoystickEvent_ButtonIsDown(*args, **kwargs) + m_pos = property(GetPosition, SetPosition) + m_zPosition = property(GetZPosition, SetZPosition) + m_buttonChange = property(GetButtonChange, SetButtonChange) + m_buttonState = property(GetButtonState, SetButtonState) + m_joyStick = property(GetJoystick, SetJoystick) + class JoystickEventPtr(JoystickEvent): def __init__(self, this): @@ -2017,15 +2149,12 @@ SOUND_SYNC = _misc_.SOUND_SYNC SOUND_ASYNC = _misc_.SOUND_ASYNC SOUND_LOOP = _misc_.SOUND_LOOP class Sound(object): + """Proxy of C++ Sound class""" def __repr__(self): return "<%s.%s; proxy of C++ wxSound instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) - def __init__(self, *args): - """ - __init__(self) -> Sound - __init__(self, String fileName, bool isResource=false) -> Sound - __init__(self, int size, wxByte data) -> Sound - """ - newobj = _misc_.new_Sound(*args) + def __init__(self, *args, **kwargs): + """__init__(self, String fileName=EmptyString) -> Sound""" + newobj = _misc_.new_Sound(*args, **kwargs) self.this = newobj.this self.thisown = 1 del newobj.thisown @@ -2035,28 +2164,29 @@ class Sound(object): if self.thisown: destroy(self) except: pass - def Create(*args): - """ - Create(self, String fileName, bool isResource=false) -> bool - Create(self, int size, wxByte data) -> bool - """ - return _misc_.Sound_Create(*args) + def Create(*args, **kwargs): + """Create(self, String fileName) -> bool""" + return _misc_.Sound_Create(*args, **kwargs) + + def CreateFromData(*args, **kwargs): + """CreateFromData(self, PyObject data) -> bool""" + return _misc_.Sound_CreateFromData(*args, **kwargs) def IsOk(*args, **kwargs): """IsOk(self) -> bool""" return _misc_.Sound_IsOk(*args, **kwargs) - def Play(*args): + def Play(*args, **kwargs): """Play(self, unsigned int flags=SOUND_ASYNC) -> bool""" - return _misc_.Sound_Play(*args) + return _misc_.Sound_Play(*args, **kwargs) - def PlaySound(*args): - """Sound.PlaySound(String filename, unsigned int flags=SOUND_ASYNC) -> bool""" - return _misc_.Sound_PlaySound(*args) + def PlaySound(*args, **kwargs): + """PlaySound(String filename, unsigned int flags=SOUND_ASYNC) -> bool""" + return _misc_.Sound_PlaySound(*args, **kwargs) PlaySound = staticmethod(PlaySound) def Stop(*args, **kwargs): - """Sound.Stop()""" + """Stop()""" return _misc_.Sound_Stop(*args, **kwargs) Stop = staticmethod(Stop) @@ -2069,9 +2199,15 @@ class SoundPtr(Sound): self.__class__ = Sound _misc_.Sound_swigregister(SoundPtr) -def Sound_PlaySound(*args): +def SoundFromData(*args, **kwargs): + """SoundFromData(PyObject data) -> Sound""" + val = _misc_.new_SoundFromData(*args, **kwargs) + val.thisown = 1 + return val + +def Sound_PlaySound(*args, **kwargs): """Sound_PlaySound(String filename, unsigned int flags=SOUND_ASYNC) -> bool""" - return _misc_.Sound_PlaySound(*args) + return _misc_.Sound_PlaySound(*args, **kwargs) def Sound_Stop(*args, **kwargs): """Sound_Stop()""" @@ -2085,6 +2221,7 @@ MAILCAP_KDE = _misc_.MAILCAP_KDE MAILCAP_GNOME = _misc_.MAILCAP_GNOME MAILCAP_ALL = _misc_.MAILCAP_ALL class FileTypeInfo(object): + """Proxy of C++ FileTypeInfo class""" def __repr__(self): return "<%s.%s; proxy of C++ wxFileTypeInfo instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -2162,6 +2299,7 @@ def NullFileTypeInfo(*args, **kwargs): return val class FileType(object): + """Proxy of C++ FileType class""" def __repr__(self): return "<%s.%s; proxy of C++ wxFileType instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -2225,7 +2363,7 @@ class FileType(object): return _misc_.FileType_Unassociate(*args, **kwargs) def ExpandCommand(*args, **kwargs): - """FileType.ExpandCommand(String command, String filename, String mimetype=EmptyString) -> String""" + """ExpandCommand(String command, String filename, String mimetype=EmptyString) -> String""" return _misc_.FileType_ExpandCommand(*args, **kwargs) ExpandCommand = staticmethod(ExpandCommand) @@ -2242,10 +2380,11 @@ def FileType_ExpandCommand(*args, **kwargs): return _misc_.FileType_ExpandCommand(*args, **kwargs) class MimeTypesManager(object): + """Proxy of C++ MimeTypesManager class""" def __repr__(self): return "<%s.%s; proxy of C++ wxMimeTypesManager instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def IsOfType(*args, **kwargs): - """MimeTypesManager.IsOfType(String mimeType, String wildcard) -> bool""" + """IsOfType(String mimeType, String wildcard) -> bool""" return _misc_.MimeTypesManager_IsOfType(*args, **kwargs) IsOfType = staticmethod(IsOfType) @@ -2317,10 +2456,49 @@ def MimeTypesManager_IsOfType(*args, **kwargs): #--------------------------------------------------------------------------- class ArtProvider(object): + """ + The wx.ArtProvider class is used to customize the look of wxWidgets + application. When wxWidgets needs to display an icon or a bitmap (e.g. + in the standard file dialog), it does not use hard-coded resource but + asks wx.ArtProvider for it instead. This way the users can plug in + their own wx.ArtProvider class and easily replace standard art with + his/her own version. It is easy thing to do: all that is needed is + to derive a class from wx.ArtProvider, override it's CreateBitmap + method and register the provider with wx.ArtProvider.PushProvider:: + + class MyArtProvider(wx.ArtProvider): + def __init__(self): + wx.ArtProvider.__init__(self) + + def CreateBitmap(self, artid, client, size): + ... + return bmp + + """ def __repr__(self): return "<%s.%s; proxy of C++ wxPyArtProvider instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(self) -> ArtProvider""" + """ + __init__(self) -> ArtProvider + + The wx.ArtProvider class is used to customize the look of wxWidgets + application. When wxWidgets needs to display an icon or a bitmap (e.g. + in the standard file dialog), it does not use hard-coded resource but + asks wx.ArtProvider for it instead. This way the users can plug in + their own wx.ArtProvider class and easily replace standard art with + his/her own version. It is easy thing to do: all that is needed is + to derive a class from wx.ArtProvider, override it's CreateBitmap + method and register the provider with wx.ArtProvider.PushProvider:: + + class MyArtProvider(wx.ArtProvider): + def __init__(self): + wx.ArtProvider.__init__(self) + + def CreateBitmap(self, artid, client, size): + ... + return bmp + + """ newobj = _misc_.new_ArtProvider(*args, **kwargs) self.this = newobj.this self.thisown = 1 @@ -2333,7 +2511,7 @@ class ArtProvider(object): def PushProvider(*args, **kwargs): """ - ArtProvider.PushProvider(ArtProvider provider) + PushProvider(ArtProvider provider) Add new provider to the top of providers stack. """ @@ -2342,7 +2520,7 @@ class ArtProvider(object): PushProvider = staticmethod(PushProvider) def PopProvider(*args, **kwargs): """ - ArtProvider.PopProvider() -> bool + PopProvider() -> bool Remove latest added provider and delete it. """ @@ -2351,17 +2529,17 @@ class ArtProvider(object): PopProvider = staticmethod(PopProvider) def RemoveProvider(*args, **kwargs): """ - ArtProvider.RemoveProvider(ArtProvider provider) -> bool + RemoveProvider(ArtProvider provider) -> bool - Remove provider. The provider must have been added previously! - The provider is _not_ deleted. + Remove provider. The provider must have been added previously! The + provider is _not_ deleted. """ return _misc_.ArtProvider_RemoveProvider(*args, **kwargs) RemoveProvider = staticmethod(RemoveProvider) def GetBitmap(*args, **kwargs): """ - ArtProvider.GetBitmap(String id, String client=ART_OTHER, Size size=DefaultSize) -> Bitmap + GetBitmap(String id, String client=ART_OTHER, Size size=DefaultSize) -> Bitmap Query the providers for bitmap with given ID and return it. Return wx.NullBitmap if no provider provides it. @@ -2371,14 +2549,24 @@ class ArtProvider(object): GetBitmap = staticmethod(GetBitmap) def GetIcon(*args, **kwargs): """ - ArtProvider.GetIcon(String id, String client=ART_OTHER, Size size=DefaultSize) -> Icon + GetIcon(String id, String client=ART_OTHER, Size size=DefaultSize) -> Icon - Query the providers for icon with given ID and return it. Return + Query the providers for icon with given ID and return it. Return wx.NullIcon if no provider provides it. """ return _misc_.ArtProvider_GetIcon(*args, **kwargs) GetIcon = staticmethod(GetIcon) + def GetSizeHint(*args, **kwargs): + """ + GetSizeHint(String client, bool platform_dependent=False) -> Size + + Get the size hint of an icon from a specific Art Client, queries the + topmost provider if platform_dependent = false + """ + return _misc_.ArtProvider_GetSizeHint(*args, **kwargs) + + GetSizeHint = staticmethod(GetSizeHint) def Destroy(*args, **kwargs): """Destroy(self)""" return _misc_.ArtProvider_Destroy(*args, **kwargs) @@ -2396,6 +2584,7 @@ ART_FRAME_ICON = cvar.ART_FRAME_ICON ART_CMN_DIALOG = cvar.ART_CMN_DIALOG ART_HELP_BROWSER = cvar.ART_HELP_BROWSER ART_MESSAGE_BOX = cvar.ART_MESSAGE_BOX +ART_BUTTON = cvar.ART_BUTTON ART_OTHER = cvar.ART_OTHER ART_ADD_BOOKMARK = cvar.ART_ADD_BOOKMARK ART_DEL_BOOKMARK = cvar.ART_DEL_BOOKMARK @@ -2411,13 +2600,20 @@ ART_GO_DOWN = cvar.ART_GO_DOWN ART_GO_TO_PARENT = cvar.ART_GO_TO_PARENT ART_GO_HOME = cvar.ART_GO_HOME ART_FILE_OPEN = cvar.ART_FILE_OPEN +ART_FILE_SAVE = cvar.ART_FILE_SAVE +ART_FILE_SAVE_AS = cvar.ART_FILE_SAVE_AS ART_PRINT = cvar.ART_PRINT ART_HELP = cvar.ART_HELP ART_TIP = cvar.ART_TIP ART_REPORT_VIEW = cvar.ART_REPORT_VIEW ART_LIST_VIEW = cvar.ART_LIST_VIEW ART_NEW_DIR = cvar.ART_NEW_DIR +ART_HARDDISK = cvar.ART_HARDDISK +ART_FLOPPY = cvar.ART_FLOPPY +ART_CDROM = cvar.ART_CDROM +ART_REMOVABLE = cvar.ART_REMOVABLE ART_FOLDER = cvar.ART_FOLDER +ART_FOLDER_OPEN = cvar.ART_FOLDER_OPEN ART_GO_DIR_UP = cvar.ART_GO_DIR_UP ART_EXECUTABLE_FILE = cvar.ART_EXECUTABLE_FILE ART_NORMAL_FILE = cvar.ART_NORMAL_FILE @@ -2428,6 +2624,15 @@ ART_QUESTION = cvar.ART_QUESTION ART_WARNING = cvar.ART_WARNING ART_INFORMATION = cvar.ART_INFORMATION ART_MISSING_IMAGE = cvar.ART_MISSING_IMAGE +ART_COPY = cvar.ART_COPY +ART_CUT = cvar.ART_CUT +ART_PASTE = cvar.ART_PASTE +ART_DELETE = cvar.ART_DELETE +ART_UNDO = cvar.ART_UNDO +ART_REDO = cvar.ART_REDO +ART_QUIT = cvar.ART_QUIT +ART_FIND = cvar.ART_FIND +ART_FIND_AND_REPLACE = cvar.ART_FIND_AND_REPLACE def ArtProvider_PushProvider(*args, **kwargs): """ @@ -2449,8 +2654,8 @@ def ArtProvider_RemoveProvider(*args, **kwargs): """ ArtProvider_RemoveProvider(ArtProvider provider) -> bool - Remove provider. The provider must have been added previously! - The provider is _not_ deleted. + Remove provider. The provider must have been added previously! The + provider is _not_ deleted. """ return _misc_.ArtProvider_RemoveProvider(*args, **kwargs) @@ -2467,11 +2672,20 @@ def ArtProvider_GetIcon(*args, **kwargs): """ ArtProvider_GetIcon(String id, String client=ART_OTHER, Size size=DefaultSize) -> Icon - Query the providers for icon with given ID and return it. Return + Query the providers for icon with given ID and return it. Return wx.NullIcon if no provider provides it. """ return _misc_.ArtProvider_GetIcon(*args, **kwargs) +def ArtProvider_GetSizeHint(*args, **kwargs): + """ + ArtProvider_GetSizeHint(String client, bool platform_dependent=False) -> Size + + Get the size hint of an icon from a specific Art Client, queries the + topmost provider if platform_dependent = false + """ + return _misc_.ArtProvider_GetSizeHint(*args, **kwargs) + #--------------------------------------------------------------------------- CONFIG_USE_LOCAL_FILE = _misc_.CONFIG_USE_LOCAL_FILE @@ -2481,23 +2695,22 @@ CONFIG_USE_NO_ESCAPE_CHARACTERS = _misc_.CONFIG_USE_NO_ESCAPE_CHARACTERS class ConfigBase(object): """ wx.ConfigBase class defines the basic interface of all config - classes. It can not be used by itself (it is an abstract base - class) and you will always use one of its derivations: wx.Config - or wx.FileConfig. - - wx.ConfigBase organizes the items in a tree-like structure, - modeled after the Unix/Dos filesystem. There are groups that act - like directories and entries, key/value pairs that act like - files. There is always one current group given by the current - path. As in the file system case, to specify a key in the config - class you must use a path to it. Config classes also support the - notion of the current group, which makes it possible to use - relative paths. + classes. It can not be used by itself (it is an abstract base class) + and you will always use one of its derivations: wx.Config or + wx.FileConfig. + + wx.ConfigBase organizes the items in a tree-like structure, modeled + after the Unix/Dos filesystem. There are groups that act like + directories and entries, key/value pairs that act like files. There + is always one current group given by the current path. As in the file + system case, to specify a key in the config class you must use a path + to it. Config classes also support the notion of the current group, + which makes it possible to use relative paths. Keys are pairs "key_name = value" where value may be of string, integer floating point or boolean, you can not store binary data - without first encoding it as a string. For performance reasons - items should be kept small, no more than a couple kilobytes. + without first encoding it as a string. For performance reasons items + should be kept small, no more than a couple kilobytes. """ def __init__(self): raise RuntimeError, "No constructor defined" @@ -2516,17 +2729,17 @@ class ConfigBase(object): Type_Float = _misc_.ConfigBase_Type_Float def Set(*args, **kwargs): """ - ConfigBase.Set(ConfigBase config) -> ConfigBase + Set(ConfigBase config) -> ConfigBase - Sets the global config object (the one returned by Get) and - returns a reference to the previous global config object. + Sets the global config object (the one returned by Get) and returns a + reference to the previous global config object. """ return _misc_.ConfigBase_Set(*args, **kwargs) Set = staticmethod(Set) def Get(*args, **kwargs): """ - ConfigBase.Get(bool createOnDemand=True) -> ConfigBase + Get(bool createOnDemand=True) -> ConfigBase Returns the current global config object, creating one if neccessary. """ @@ -2535,7 +2748,7 @@ class ConfigBase(object): Get = staticmethod(Get) def Create(*args, **kwargs): """ - ConfigBase.Create() -> ConfigBase + Create() -> ConfigBase Create and return a new global config object. This function will create the "best" implementation of wx.Config available for the @@ -2546,9 +2759,10 @@ class ConfigBase(object): Create = staticmethod(Create) def DontCreateOnDemand(*args, **kwargs): """ - ConfigBase.DontCreateOnDemand() + DontCreateOnDemand() - Should Get() try to create a new log object if there isn't a current one? + Should Get() try to create a new log object if there isn't a current + one? """ return _misc_.ConfigBase_DontCreateOnDemand(*args, **kwargs) @@ -2557,9 +2771,9 @@ class ConfigBase(object): """ SetPath(self, String path) - Set current path: if the first character is '/', it's the absolute path, - otherwise it's a relative path. '..' is supported. If the strPath - doesn't exist it is created. + Set current path: if the first character is '/', it's the absolute + path, otherwise it's a relative path. '..' is supported. If the + strPath doesn't exist it is created. """ return _misc_.ConfigBase_SetPath(*args, **kwargs) @@ -2575,10 +2789,10 @@ class ConfigBase(object): """ GetFirstGroup() -> (more, value, index) - Allows enumerating the subgroups in a config object. Returns - a tuple containing a flag indicating there are more items, the - name of the current item, and an index to pass to GetNextGroup to - fetch the next item. + Allows enumerating the subgroups in a config object. Returns a tuple + containing a flag indicating there are more items, the name of the + current item, and an index to pass to GetNextGroup to fetch the next + item. """ return _misc_.ConfigBase_GetFirstGroup(*args, **kwargs) @@ -2586,10 +2800,10 @@ class ConfigBase(object): """ GetNextGroup(long index) -> (more, value, index) - Allows enumerating the subgroups in a config object. Returns - a tuple containing a flag indicating there are more items, the - name of the current item, and an index to pass to GetNextGroup to - fetch the next item. + Allows enumerating the subgroups in a config object. Returns a tuple + containing a flag indicating there are more items, the name of the + current item, and an index to pass to GetNextGroup to fetch the next + item. """ return _misc_.ConfigBase_GetNextGroup(*args, **kwargs) @@ -2598,8 +2812,8 @@ class ConfigBase(object): GetFirstEntry() -> (more, value, index) Allows enumerating the entries in the current group in a config - object. Returns a tuple containing a flag indicating there are - more items, the name of the current item, and an index to pass to + object. Returns a tuple containing a flag indicating there are more + items, the name of the current item, and an index to pass to GetNextGroup to fetch the next item. """ return _misc_.ConfigBase_GetFirstEntry(*args, **kwargs) @@ -2609,8 +2823,8 @@ class ConfigBase(object): GetNextEntry(long index) -> (more, value, index) Allows enumerating the entries in the current group in a config - object. Returns a tuple containing a flag indicating there are - more items, the name of the current item, and an index to pass to + object. Returns a tuple containing a flag indicating there are more + items, the name of the current item, and an index to pass to GetNextGroup to fetch the next item. """ return _misc_.ConfigBase_GetNextEntry(*args, **kwargs) @@ -2619,8 +2833,8 @@ class ConfigBase(object): """ GetNumberOfEntries(self, bool recursive=False) -> size_t - Get the number of entries in the current group, with or - without its subgroups. + Get the number of entries in the current group, with or without its + subgroups. """ return _misc_.ConfigBase_GetNumberOfEntries(*args, **kwargs) @@ -2628,8 +2842,8 @@ class ConfigBase(object): """ GetNumberOfGroups(self, bool recursive=False) -> size_t - Get the number of subgroups in the current group, with or - without its subgroups. + Get the number of subgroups in the current group, with or without its + subgroups. """ return _misc_.ConfigBase_GetNumberOfGroups(*args, **kwargs) @@ -2750,7 +2964,7 @@ class ConfigBase(object): """ RenameGroup(self, String oldName, String newName) -> bool - Rename aa group. Returns False on failure (probably because the new + Rename a group. Returns False on failure (probably because the new name is already taken by an existing entry) """ return _misc_.ConfigBase_RenameGroup(*args, **kwargs) @@ -2759,8 +2973,8 @@ class ConfigBase(object): """ DeleteEntry(self, String key, bool deleteGroupIfEmpty=True) -> bool - Deletes the specified entry and the group it belongs to if - it was the last key in it and the second parameter is True + Deletes the specified entry and the group it belongs to if it was the + last key in it and the second parameter is True """ return _misc_.ConfigBase_DeleteEntry(*args, **kwargs) @@ -2777,7 +2991,7 @@ class ConfigBase(object): DeleteAll(self) -> bool Delete the whole underlying object (disk file, registry key, ...) - primarly intended for use by desinstallation routine. + primarly intended for use by deinstallation routine. """ return _misc_.ConfigBase_DeleteAll(*args, **kwargs) @@ -2785,8 +2999,9 @@ class ConfigBase(object): """ SetExpandEnvVars(self, bool doIt=True) - We can automatically expand environment variables in the config entries - (this option is on by default, you can turn it on/off at any time) + We can automatically expand environment variables in the config + entries this option is on by default, you can turn it on/off at any + time) """ return _misc_.ConfigBase_SetExpandEnvVars(*args, **kwargs) @@ -2858,8 +3073,8 @@ def ConfigBase_Set(*args, **kwargs): """ ConfigBase_Set(ConfigBase config) -> ConfigBase - Sets the global config object (the one returned by Get) and - returns a reference to the previous global config object. + Sets the global config object (the one returned by Get) and returns a + reference to the previous global config object. """ return _misc_.ConfigBase_Set(*args, **kwargs) @@ -2885,7 +3100,8 @@ def ConfigBase_DontCreateOnDemand(*args, **kwargs): """ ConfigBase_DontCreateOnDemand() - Should Get() try to create a new log object if there isn't a current one? + Should Get() try to create a new log object if there isn't a current + one? """ return _misc_.ConfigBase_DontCreateOnDemand(*args, **kwargs) @@ -2950,10 +3166,10 @@ _misc_.FileConfig_swigregister(FileConfigPtr) class ConfigPathChanger(object): """ - A handy little class which changes current path to the path of - given entry and restores it in the destructoir: so if you declare - a local variable of this type, you work in the entry directory - and the path is automatically restored when the function returns. + A handy little class which changes current path to the path of given + entry and restores it in the destructoir: so if you declare a local + variable of this type, you work in the entry directory and the path is + automatically restored when the function returns. """ def __repr__(self): return "<%s.%s; proxy of C++ wxConfigPathChanger instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) @@ -2991,14 +3207,15 @@ def ExpandEnvVars(*args, **kwargs): ExpandEnvVars(String sz) -> String Replace environment variables ($SOMETHING) with their values. The - format is $VARNAME or ${VARNAME} where VARNAME contains - alphanumeric characters and '_' only. '$' must be escaped ('\$') - in order to be taken literally. + format is $VARNAME or ${VARNAME} where VARNAME contains alphanumeric + characters and '_' only. '$' must be escaped ('\$') in order to be + taken literally. """ return _misc_.ExpandEnvVars(*args, **kwargs) #--------------------------------------------------------------------------- class DateTime(object): + """Proxy of C++ DateTime class""" def __repr__(self): return "<%s.%s; proxy of C++ wxDateTime instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) Local = _misc_.DateTime_Local @@ -3157,62 +3374,62 @@ class DateTime(object): Monday_First = _misc_.DateTime_Monday_First Sunday_First = _misc_.DateTime_Sunday_First def SetCountry(*args, **kwargs): - """DateTime.SetCountry(int country)""" + """SetCountry(int country)""" return _misc_.DateTime_SetCountry(*args, **kwargs) SetCountry = staticmethod(SetCountry) def GetCountry(*args, **kwargs): - """DateTime.GetCountry() -> int""" + """GetCountry() -> int""" return _misc_.DateTime_GetCountry(*args, **kwargs) GetCountry = staticmethod(GetCountry) def IsWestEuropeanCountry(*args, **kwargs): - """DateTime.IsWestEuropeanCountry(int country=Country_Default) -> bool""" + """IsWestEuropeanCountry(int country=Country_Default) -> bool""" return _misc_.DateTime_IsWestEuropeanCountry(*args, **kwargs) IsWestEuropeanCountry = staticmethod(IsWestEuropeanCountry) def GetCurrentYear(*args, **kwargs): - """DateTime.GetCurrentYear(int cal=Gregorian) -> int""" + """GetCurrentYear(int cal=Gregorian) -> int""" return _misc_.DateTime_GetCurrentYear(*args, **kwargs) GetCurrentYear = staticmethod(GetCurrentYear) def ConvertYearToBC(*args, **kwargs): - """DateTime.ConvertYearToBC(int year) -> int""" + """ConvertYearToBC(int year) -> int""" return _misc_.DateTime_ConvertYearToBC(*args, **kwargs) ConvertYearToBC = staticmethod(ConvertYearToBC) def GetCurrentMonth(*args, **kwargs): - """DateTime.GetCurrentMonth(int cal=Gregorian) -> int""" + """GetCurrentMonth(int cal=Gregorian) -> int""" return _misc_.DateTime_GetCurrentMonth(*args, **kwargs) GetCurrentMonth = staticmethod(GetCurrentMonth) def IsLeapYear(*args, **kwargs): - """DateTime.IsLeapYear(int year=Inv_Year, int cal=Gregorian) -> bool""" + """IsLeapYear(int year=Inv_Year, int cal=Gregorian) -> bool""" return _misc_.DateTime_IsLeapYear(*args, **kwargs) IsLeapYear = staticmethod(IsLeapYear) def GetCentury(*args, **kwargs): - """DateTime.GetCentury(int year=Inv_Year) -> int""" + """GetCentury(int year=Inv_Year) -> int""" return _misc_.DateTime_GetCentury(*args, **kwargs) GetCentury = staticmethod(GetCentury) def GetNumberOfDaysinYear(*args, **kwargs): - """DateTime.GetNumberOfDaysinYear(int year, int cal=Gregorian) -> int""" + """GetNumberOfDaysinYear(int year, int cal=Gregorian) -> int""" return _misc_.DateTime_GetNumberOfDaysinYear(*args, **kwargs) GetNumberOfDaysinYear = staticmethod(GetNumberOfDaysinYear) def GetNumberOfDaysInMonth(*args, **kwargs): - """DateTime.GetNumberOfDaysInMonth(int month, int year=Inv_Year, int cal=Gregorian) -> int""" + """GetNumberOfDaysInMonth(int month, int year=Inv_Year, int cal=Gregorian) -> int""" return _misc_.DateTime_GetNumberOfDaysInMonth(*args, **kwargs) GetNumberOfDaysInMonth = staticmethod(GetNumberOfDaysInMonth) def GetMonthName(*args, **kwargs): - """DateTime.GetMonthName(int month, int flags=Name_Full) -> String""" + """GetMonthName(int month, int flags=Name_Full) -> String""" return _misc_.DateTime_GetMonthName(*args, **kwargs) GetMonthName = staticmethod(GetMonthName) def GetWeekDayName(*args, **kwargs): - """DateTime.GetWeekDayName(int weekday, int flags=Name_Full) -> String""" + """GetWeekDayName(int weekday, int flags=Name_Full) -> String""" return _misc_.DateTime_GetWeekDayName(*args, **kwargs) GetWeekDayName = staticmethod(GetWeekDayName) @@ -3226,32 +3443,32 @@ class DateTime(object): GetAmPmStrings = staticmethod(GetAmPmStrings) def IsDSTApplicable(*args, **kwargs): - """DateTime.IsDSTApplicable(int year=Inv_Year, int country=Country_Default) -> bool""" + """IsDSTApplicable(int year=Inv_Year, int country=Country_Default) -> bool""" return _misc_.DateTime_IsDSTApplicable(*args, **kwargs) IsDSTApplicable = staticmethod(IsDSTApplicable) def GetBeginDST(*args, **kwargs): - """DateTime.GetBeginDST(int year=Inv_Year, int country=Country_Default) -> DateTime""" + """GetBeginDST(int year=Inv_Year, int country=Country_Default) -> DateTime""" return _misc_.DateTime_GetBeginDST(*args, **kwargs) GetBeginDST = staticmethod(GetBeginDST) def GetEndDST(*args, **kwargs): - """DateTime.GetEndDST(int year=Inv_Year, int country=Country_Default) -> DateTime""" + """GetEndDST(int year=Inv_Year, int country=Country_Default) -> DateTime""" return _misc_.DateTime_GetEndDST(*args, **kwargs) GetEndDST = staticmethod(GetEndDST) def Now(*args, **kwargs): - """DateTime.Now() -> DateTime""" + """Now() -> DateTime""" return _misc_.DateTime_Now(*args, **kwargs) Now = staticmethod(Now) def UNow(*args, **kwargs): - """DateTime.UNow() -> DateTime""" + """UNow() -> DateTime""" return _misc_.DateTime_UNow(*args, **kwargs) UNow = staticmethod(UNow) def Today(*args, **kwargs): - """DateTime.Today() -> DateTime""" + """Today() -> DateTime""" return _misc_.DateTime_Today(*args, **kwargs) Today = staticmethod(Today) @@ -3366,6 +3583,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) @@ -3561,36 +3786,36 @@ class DateTime(object): """ return _misc_.DateTime___sub__(*args) - def __lt__(*args): + def __lt__(*args, **kwargs): """__lt__(self, DateTime other) -> bool""" - return _misc_.DateTime___lt__(*args) + return _misc_.DateTime___lt__(*args, **kwargs) - def __le__(*args): + def __le__(*args, **kwargs): """__le__(self, DateTime other) -> bool""" - return _misc_.DateTime___le__(*args) + return _misc_.DateTime___le__(*args, **kwargs) - def __gt__(*args): + def __gt__(*args, **kwargs): """__gt__(self, DateTime other) -> bool""" - return _misc_.DateTime___gt__(*args) + return _misc_.DateTime___gt__(*args, **kwargs) - def __ge__(*args): + def __ge__(*args, **kwargs): """__ge__(self, DateTime other) -> bool""" - return _misc_.DateTime___ge__(*args) + return _misc_.DateTime___ge__(*args, **kwargs) - def __eq__(*args): + def __eq__(*args, **kwargs): """__eq__(self, DateTime other) -> bool""" - return _misc_.DateTime___eq__(*args) + return _misc_.DateTime___eq__(*args, **kwargs) - def __ne__(*args): + def __ne__(*args, **kwargs): """__ne__(self, DateTime other) -> bool""" - return _misc_.DateTime___ne__(*args) + return _misc_.DateTime___ne__(*args, **kwargs) def ParseRfc822Date(*args, **kwargs): """ParseRfc822Date(self, String date) -> int""" return _misc_.DateTime_ParseRfc822Date(*args, **kwargs) def ParseFormat(*args, **kwargs): - """ParseFormat(self, String date, String format=DateFormatStr, DateTime dateDef=DefaultDateTime) -> int""" + """ParseFormat(self, String date, String format=DefaultDateTimeFormat, DateTime dateDef=DefaultDateTime) -> int""" return _misc_.DateTime_ParseFormat(*args, **kwargs) def ParseDateTime(*args, **kwargs): @@ -3606,7 +3831,7 @@ class DateTime(object): return _misc_.DateTime_ParseTime(*args, **kwargs) def Format(*args, **kwargs): - """Format(self, String format=DateFormatStr, wxDateTime::TimeZone tz=LOCAL_TZ) -> String""" + """Format(self, String format=DefaultDateTimeFormat, wxDateTime::TimeZone tz=LOCAL_TZ) -> String""" return _misc_.DateTime_Format(*args, **kwargs) def FormatDate(*args, **kwargs): @@ -3643,8 +3868,8 @@ class DateTimePtr(DateTime): if not hasattr(self,"thisown"): self.thisown = 0 self.__class__ = DateTime _misc_.DateTime_swigregister(DateTimePtr) -DateFormatStr = cvar.DateFormatStr -TimeSpanFormatStr = cvar.TimeSpanFormatStr +DefaultDateTimeFormat = cvar.DefaultDateTimeFormat +DefaultTimeSpanFormat = cvar.DefaultTimeSpanFormat def DateTime_SetCountry(*args, **kwargs): """DateTime_SetCountry(int country)""" @@ -3753,56 +3978,61 @@ 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): + """Proxy of C++ TimeSpan class""" def __repr__(self): return "<%s.%s; proxy of C++ wxTimeSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def Seconds(*args, **kwargs): - """TimeSpan.Seconds(long sec) -> TimeSpan""" + """Seconds(long sec) -> TimeSpan""" return _misc_.TimeSpan_Seconds(*args, **kwargs) Seconds = staticmethod(Seconds) def Second(*args, **kwargs): - """TimeSpan.Second() -> TimeSpan""" + """Second() -> TimeSpan""" return _misc_.TimeSpan_Second(*args, **kwargs) Second = staticmethod(Second) def Minutes(*args, **kwargs): - """TimeSpan.Minutes(long min) -> TimeSpan""" + """Minutes(long min) -> TimeSpan""" return _misc_.TimeSpan_Minutes(*args, **kwargs) Minutes = staticmethod(Minutes) def Minute(*args, **kwargs): - """TimeSpan.Minute() -> TimeSpan""" + """Minute() -> TimeSpan""" return _misc_.TimeSpan_Minute(*args, **kwargs) Minute = staticmethod(Minute) def Hours(*args, **kwargs): - """TimeSpan.Hours(long hours) -> TimeSpan""" + """Hours(long hours) -> TimeSpan""" return _misc_.TimeSpan_Hours(*args, **kwargs) Hours = staticmethod(Hours) def Hour(*args, **kwargs): - """TimeSpan.Hour() -> TimeSpan""" + """Hour() -> TimeSpan""" return _misc_.TimeSpan_Hour(*args, **kwargs) Hour = staticmethod(Hour) def Days(*args, **kwargs): - """TimeSpan.Days(long days) -> TimeSpan""" + """Days(long days) -> TimeSpan""" return _misc_.TimeSpan_Days(*args, **kwargs) Days = staticmethod(Days) def Day(*args, **kwargs): - """TimeSpan.Day() -> TimeSpan""" + """Day() -> TimeSpan""" return _misc_.TimeSpan_Day(*args, **kwargs) Day = staticmethod(Day) def Weeks(*args, **kwargs): - """TimeSpan.Weeks(long days) -> TimeSpan""" + """Weeks(long days) -> TimeSpan""" return _misc_.TimeSpan_Weeks(*args, **kwargs) Weeks = staticmethod(Weeks) def Week(*args, **kwargs): - """TimeSpan.Week() -> TimeSpan""" + """Week() -> TimeSpan""" return _misc_.TimeSpan_Week(*args, **kwargs) Week = staticmethod(Week) @@ -3943,7 +4173,7 @@ class TimeSpan(object): return _misc_.TimeSpan_GetMilliseconds(*args, **kwargs) def Format(*args, **kwargs): - """Format(self, String format=TimeSpanFormatStr) -> String""" + """Format(self, String format=DefaultTimeSpanFormat) -> String""" return _misc_.TimeSpan_Format(*args, **kwargs) def __repr__(self): @@ -4000,6 +4230,7 @@ def TimeSpan_Week(*args, **kwargs): return _misc_.TimeSpan_Week(*args, **kwargs) class DateSpan(object): + """Proxy of C++ DateSpan class""" def __repr__(self): return "<%s.%s; proxy of C++ wxDateSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -4015,42 +4246,42 @@ class DateSpan(object): except: pass def Days(*args, **kwargs): - """DateSpan.Days(int days) -> DateSpan""" + """Days(int days) -> DateSpan""" return _misc_.DateSpan_Days(*args, **kwargs) Days = staticmethod(Days) def Day(*args, **kwargs): - """DateSpan.Day() -> DateSpan""" + """Day() -> DateSpan""" return _misc_.DateSpan_Day(*args, **kwargs) Day = staticmethod(Day) def Weeks(*args, **kwargs): - """DateSpan.Weeks(int weeks) -> DateSpan""" + """Weeks(int weeks) -> DateSpan""" return _misc_.DateSpan_Weeks(*args, **kwargs) Weeks = staticmethod(Weeks) def Week(*args, **kwargs): - """DateSpan.Week() -> DateSpan""" + """Week() -> DateSpan""" return _misc_.DateSpan_Week(*args, **kwargs) Week = staticmethod(Week) def Months(*args, **kwargs): - """DateSpan.Months(int mon) -> DateSpan""" + """Months(int mon) -> DateSpan""" return _misc_.DateSpan_Months(*args, **kwargs) Months = staticmethod(Months) def Month(*args, **kwargs): - """DateSpan.Month() -> DateSpan""" + """Month() -> DateSpan""" return _misc_.DateSpan_Month(*args, **kwargs) Month = staticmethod(Month) def Years(*args, **kwargs): - """DateSpan.Years(int years) -> DateSpan""" + """Years(int years) -> DateSpan""" return _misc_.DateSpan_Years(*args, **kwargs) Years = staticmethod(Years) def Year(*args, **kwargs): - """DateSpan.Year() -> DateSpan""" + """Year() -> DateSpan""" return _misc_.DateSpan_Year(*args, **kwargs) Year = staticmethod(Year) @@ -4227,14 +4458,11 @@ DF_MAX = _misc_.DF_MAX class DataFormat(object): """ A wx.DataFormat is an encapsulation of a platform-specific format - handle which is used by the system for the clipboard and drag and - drop operations. The applications are usually only interested in, - for example, pasting data from the clipboard only if the data is - in a format the program understands. A data format is is used to - uniquely identify this format. - - On the system level, a data format is usually just a number - (CLIPFORMAT under Windows or Atom under X11, for example). + handle which is used by the system for the clipboard and drag and drop + operations. The applications are usually only interested in, for + example, pasting data from the clipboard only if the data is in a + format the program understands. A data format is is used to uniquely + identify this format. """ def __repr__(self): return "<%s.%s; proxy of C++ wxDataFormat instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) @@ -4242,9 +4470,8 @@ class DataFormat(object): """ __init__(self, int type) -> DataFormat - Constructs a data format object for one of the standard data - formats or an empty data object (use SetType or SetId later in - this case) + Constructs a data format object for one of the standard data formats + or an empty data object (use SetType or SetId later in this case) """ newobj = _misc_.new_DataFormat(*args, **kwargs) self.this = newobj.this @@ -4274,7 +4501,8 @@ class DataFormat(object): """ SetType(self, int format) - Sets the format to the given value, which should be one of wx.DF_XXX constants. + Sets the format to the given value, which should be one of wx.DF_XXX + constants. """ return _misc_.DataFormat_SetType(*args, **kwargs) @@ -4290,7 +4518,8 @@ class DataFormat(object): """ GetId(self) -> String - Returns the name of a custom format (this function will fail for a standard format). + Returns the name of a custom format (this function will fail for a + standard format). """ return _misc_.DataFormat_GetId(*args, **kwargs) @@ -4315,13 +4544,28 @@ def CustomDataFormat(*args, **kwargs): """ CustomDataFormat(String format) -> DataFormat - Constructs a data format object for a custom format identified by its name. + Constructs a data format object for a custom format identified by its + name. """ val = _misc_.new_CustomDataFormat(*args, **kwargs) val.thisown = 1 return val class DataObject(object): + """ + A wx.DataObject represents data that can be copied to or from the + clipboard, or dragged and dropped. The important thing about + wx.DataObject is that this is a 'smart' piece of data unlike usual + 'dumb' data containers such as memory buffers or files. Being 'smart' + here means that the data object itself should know what data formats + it supports and how to render itself in each of supported formats. + + **NOTE**: This class is an abstract base class and can not be used + directly from Python. If you need a custom type of data object then + you should instead derive from `wx.PyDataObjectSimple` or use + `wx.CustomDataObject`. + + """ def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ wxDataObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) @@ -4335,31 +4579,65 @@ class DataObject(object): except: pass def GetPreferredFormat(*args, **kwargs): - """GetPreferredFormat(self, int dir=Get) -> DataFormat""" + """ + GetPreferredFormat(self, int dir=Get) -> DataFormat + + Returns the preferred format for either rendering the data (if dir is + Get, its default value) or for setting it. Usually this will be the + native format of the wx.DataObject. + """ return _misc_.DataObject_GetPreferredFormat(*args, **kwargs) def GetFormatCount(*args, **kwargs): - """GetFormatCount(self, int dir=Get) -> size_t""" + """ + GetFormatCount(self, int dir=Get) -> size_t + + Returns the number of available formats for rendering or setting the + data. + """ return _misc_.DataObject_GetFormatCount(*args, **kwargs) def IsSupported(*args, **kwargs): - """IsSupported(self, DataFormat format, int dir=Get) -> bool""" + """ + IsSupported(self, DataFormat format, int dir=Get) -> bool + + Returns True if this format is supported. + """ return _misc_.DataObject_IsSupported(*args, **kwargs) def GetDataSize(*args, **kwargs): - """GetDataSize(self, DataFormat format) -> size_t""" + """ + GetDataSize(self, DataFormat format) -> size_t + + Get the (total) size of data for the given format + """ return _misc_.DataObject_GetDataSize(*args, **kwargs) def GetAllFormats(*args, **kwargs): - """GetAllFormats(self, DataFormat formats, int dir=Get)""" + """ + GetAllFormats(self, int dir=Get) -> [formats] + + Returns a list of all the wx.DataFormats that this dataobject supports + in the given direction. + """ return _misc_.DataObject_GetAllFormats(*args, **kwargs) def GetDataHere(*args, **kwargs): - """GetDataHere(self, DataFormat format, void buf) -> bool""" + """ + GetDataHere(self, DataFormat format) -> String + + Get the data bytes in the specified format, returns None on failure. + + """ return _misc_.DataObject_GetDataHere(*args, **kwargs) def SetData(*args, **kwargs): - """SetData(self, DataFormat format, size_t len, void buf) -> bool""" + """ + SetData(self, DataFormat format, String data) -> bool + + Set the data in the specified format from the bytes in the the data string. + + """ return _misc_.DataObject_SetData(*args, **kwargs) @@ -4372,22 +4650,73 @@ _misc_.DataObject_swigregister(DataObjectPtr) FormatInvalid = cvar.FormatInvalid class DataObjectSimple(DataObject): + """ + wx.DataObjectSimple is a `wx.DataObject` which only supports one + format. This is the simplest possible `wx.DataObject` implementation. + + This is still an "abstract base class" meaning that you can't use it + directly. You either need to use one of the predefined base classes, + or derive your own class from `wx.PyDataObjectSimple`. + + """ def __repr__(self): return "<%s.%s; proxy of C++ wxDataObjectSimple instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(self, DataFormat format=FormatInvalid) -> DataObjectSimple""" + """ + __init__(self, DataFormat format=FormatInvalid) -> DataObjectSimple + + Constructor accepts the supported format (none by default) which may + also be set later with `SetFormat`. + """ newobj = _misc_.new_DataObjectSimple(*args, **kwargs) self.this = newobj.this self.thisown = 1 del newobj.thisown def GetFormat(*args, **kwargs): - """GetFormat(self) -> DataFormat""" + """ + GetFormat(self) -> DataFormat + + Returns the (one and only one) format supported by this object. It is + assumed that the format is supported in both directions. + """ return _misc_.DataObjectSimple_GetFormat(*args, **kwargs) def SetFormat(*args, **kwargs): - """SetFormat(self, DataFormat format)""" + """ + SetFormat(self, DataFormat format) + + Sets the supported format. + """ return _misc_.DataObjectSimple_SetFormat(*args, **kwargs) + def GetDataSize(*args, **kwargs): + """ + GetDataSize(self) -> size_t + + Get the size of our data. + """ + return _misc_.DataObjectSimple_GetDataSize(*args, **kwargs) + + def GetDataHere(*args, **kwargs): + """ + GetDataHere(self) -> String + + Returns the data bytes from the data object as a string, returns None + on failure. Must be implemented in the derived class if the object + supports rendering its data. + """ + return _misc_.DataObjectSimple_GetDataHere(*args, **kwargs) + + def SetData(*args, **kwargs): + """ + SetData(self, String data) -> bool + + Copy the data value to the data object. Must be implemented in the + derived class if the object supports setting its data. + + """ + return _misc_.DataObjectSimple_SetData(*args, **kwargs) + class DataObjectSimplePtr(DataObjectSimple): def __init__(self, this): @@ -4397,10 +4726,27 @@ class DataObjectSimplePtr(DataObjectSimple): _misc_.DataObjectSimple_swigregister(DataObjectSimplePtr) class PyDataObjectSimple(DataObjectSimple): + """ + wx.PyDataObjectSimple is a version of `wx.DataObjectSimple` that is + Python-aware and knows how to reflect calls to its C++ virtual methods + to methods in the Python derived class. You should derive from this + class and overload `GetDataSize`, `GetDataHere` and `SetData` when you + need to create your own simple single-format type of `wx.DataObject`. + + """ def __repr__(self): return "<%s.%s; proxy of C++ wxPyDataObjectSimple instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(self, DataFormat format=FormatInvalid) -> PyDataObjectSimple""" + """ + __init__(self, DataFormat format=FormatInvalid) -> PyDataObjectSimple + + wx.PyDataObjectSimple is a version of `wx.DataObjectSimple` that is + Python-aware and knows how to reflect calls to its C++ virtual methods + to methods in the Python derived class. You should derive from this + class and overload `GetDataSize`, `GetDataHere` and `SetData` when you + need to create your own simple single-format type of `wx.DataObject`. + + """ newobj = _misc_.new_PyDataObjectSimple(*args, **kwargs) self.this = newobj.this self.thisown = 1 @@ -4420,16 +4766,50 @@ class PyDataObjectSimplePtr(PyDataObjectSimple): _misc_.PyDataObjectSimple_swigregister(PyDataObjectSimplePtr) class DataObjectComposite(DataObject): + """ + wx.DataObjectComposite is the simplest `wx.DataObject` derivation + which may be sued to support multiple formats. It contains several + 'wx.DataObjectSimple` objects and supports any format supported by at + least one of them. Only one of these data objects is *preferred* (the + first one if not explicitly changed by using the second parameter of + `Add`) and its format determines the preferred format of the composite + data object as well. + + See `wx.DataObject` documentation for the reasons why you might prefer + to use wx.DataObject directly instead of wx.DataObjectComposite for + efficiency reasons. + + """ def __repr__(self): return "<%s.%s; proxy of C++ wxDataObjectComposite instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(self) -> DataObjectComposite""" + """ + __init__(self) -> DataObjectComposite + + wx.DataObjectComposite is the simplest `wx.DataObject` derivation + which may be sued to support multiple formats. It contains several + 'wx.DataObjectSimple` objects and supports any format supported by at + least one of them. Only one of these data objects is *preferred* (the + first one if not explicitly changed by using the second parameter of + `Add`) and its format determines the preferred format of the composite + data object as well. + + See `wx.DataObject` documentation for the reasons why you might prefer + to use wx.DataObject directly instead of wx.DataObjectComposite for + efficiency reasons. + + """ newobj = _misc_.new_DataObjectComposite(*args, **kwargs) self.this = newobj.this self.thisown = 1 del newobj.thisown def Add(*args, **kwargs): - """Add(self, DataObjectSimple dataObject, int preferred=False)""" + """ + Add(self, DataObjectSimple dataObject, bool preferred=False) + + Adds the dataObject to the list of supported objects and it becomes + the preferred object if preferred is True. + """ return _misc_.DataObjectComposite_Add(*args, **kwargs) @@ -4441,24 +4821,62 @@ class DataObjectCompositePtr(DataObjectComposite): _misc_.DataObjectComposite_swigregister(DataObjectCompositePtr) class TextDataObject(DataObjectSimple): + """ + wx.TextDataObject is a specialization of `wx.DataObject` for text + data. It can be used without change to paste data into the `wx.Clipboard` + or a `wx.DropSource`. + + Alternativly, you may wish to derive a new class from the + `wx.PyTextDataObject` class for providing text on-demand in order to + minimize memory consumption when offering data in several formats, + such as plain text and RTF, because by default the text is stored in a + string in this class, but it might as well be generated on demand when + requested. For this, `GetTextLength` and `GetText` will have to be + overridden. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxTextDataObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(self, String text=EmptyString) -> TextDataObject""" + """ + __init__(self, String text=EmptyString) -> TextDataObject + + Constructor, may be used to initialise the text (otherwise `SetText` + should be used later). + """ newobj = _misc_.new_TextDataObject(*args, **kwargs) self.this = newobj.this self.thisown = 1 del newobj.thisown def GetTextLength(*args, **kwargs): - """GetTextLength(self) -> size_t""" + """ + GetTextLength(self) -> size_t + + Returns the data size. By default, returns the size of the text data + set in the constructor or using `SetText`. This can be overridden (via + `wx.PyTextDataObject`) to provide text size data on-demand. It is + recommended to return the text length plus 1 for a trailing zero, but + this is not strictly required. + """ return _misc_.TextDataObject_GetTextLength(*args, **kwargs) def GetText(*args, **kwargs): - """GetText(self) -> String""" + """ + GetText(self) -> String + + Returns the text associated with the data object. + """ return _misc_.TextDataObject_GetText(*args, **kwargs) def SetText(*args, **kwargs): - """SetText(self, String text)""" + """ + SetText(self, String text) + + Sets the text associated with the data object. This method is called + when the data object receives the data and, by default, copies the + text into the member variable. If you want to process the text on the + fly you may wish to override this function (via + `wx.PyTextDataObject`.) + """ return _misc_.TextDataObject_SetText(*args, **kwargs) @@ -4470,10 +4888,27 @@ class TextDataObjectPtr(TextDataObject): _misc_.TextDataObject_swigregister(TextDataObjectPtr) class PyTextDataObject(TextDataObject): + """ + wx.PyTextDataObject is a version of `wx.TextDataObject` that is + Python-aware and knows how to reflect calls to its C++ virtual methods + to methods in the Python derived class. You should derive from this + class and overload `GetTextLength`, `GetText`, and `SetText` when you + want to be able to provide text on demand instead of preloading it + into the data object. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxPyTextDataObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(self, String text=EmptyString) -> PyTextDataObject""" + """ + __init__(self, String text=EmptyString) -> PyTextDataObject + + wx.PyTextDataObject is a version of `wx.TextDataObject` that is + Python-aware and knows how to reflect calls to its C++ virtual methods + to methods in the Python derived class. You should derive from this + class and overload `GetTextLength`, `GetText`, and `SetText` when you + want to be able to provide text on demand instead of preloading it + into the data object. + """ newobj = _misc_.new_PyTextDataObject(*args, **kwargs) self.this = newobj.this self.thisown = 1 @@ -4493,20 +4928,45 @@ class PyTextDataObjectPtr(PyTextDataObject): _misc_.PyTextDataObject_swigregister(PyTextDataObjectPtr) class BitmapDataObject(DataObjectSimple): + """ + wx.BitmapDataObject is a specialization of wxDataObject for bitmap + data. It can be used without change to paste data into the `wx.Clipboard` + or a `wx.DropSource`. + + """ def __repr__(self): return "<%s.%s; proxy of C++ wxBitmapDataObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(self, Bitmap bitmap=wxNullBitmap) -> BitmapDataObject""" + """ + __init__(self, Bitmap bitmap=wxNullBitmap) -> BitmapDataObject + + Constructor, optionally passing a bitmap (otherwise use `SetBitmap` + later). + """ newobj = _misc_.new_BitmapDataObject(*args, **kwargs) self.this = newobj.this self.thisown = 1 del newobj.thisown def GetBitmap(*args, **kwargs): - """GetBitmap(self) -> Bitmap""" + """ + GetBitmap(self) -> Bitmap + + Returns the bitmap associated with the data object. You may wish to + override this method (by deriving from `wx.PyBitmapDataObject`) when + offering data on-demand, but this is not required by wxWidgets' + internals. Use this method to get data in bitmap form from the + `wx.Clipboard`. + """ return _misc_.BitmapDataObject_GetBitmap(*args, **kwargs) def SetBitmap(*args, **kwargs): - """SetBitmap(self, Bitmap bitmap)""" + """ + SetBitmap(self, Bitmap bitmap) + + Sets the bitmap associated with the data object. This method is called + when the data object receives data. Usually there will be no reason to + override this function. + """ return _misc_.BitmapDataObject_SetBitmap(*args, **kwargs) @@ -4518,10 +4978,23 @@ class BitmapDataObjectPtr(BitmapDataObject): _misc_.BitmapDataObject_swigregister(BitmapDataObjectPtr) class PyBitmapDataObject(BitmapDataObject): + """ + wx.PyBitmapDataObject is a version of `wx.BitmapDataObject` that is + Python-aware and knows how to reflect calls to its C++ virtual methods + to methods in the Python derived class. To be able to provide bitmap + data on demand derive from this class and overload `GetBitmap`. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxPyBitmapDataObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(self, Bitmap bitmap=wxNullBitmap) -> PyBitmapDataObject""" + """ + __init__(self, Bitmap bitmap=wxNullBitmap) -> PyBitmapDataObject + + wx.PyBitmapDataObject is a version of `wx.BitmapDataObject` that is + Python-aware and knows how to reflect calls to its C++ virtual methods + to methods in the Python derived class. To be able to provide bitmap + data on demand derive from this class and overload `GetBitmap`. + """ newobj = _misc_.new_PyBitmapDataObject(*args, **kwargs) self.this = newobj.this self.thisown = 1 @@ -4541,6 +5014,14 @@ class PyBitmapDataObjectPtr(PyBitmapDataObject): _misc_.PyBitmapDataObject_swigregister(PyBitmapDataObjectPtr) class FileDataObject(DataObjectSimple): + """ + wx.FileDataObject is a specialization of `wx.DataObjectSimple` for + file names. The program works with it just as if it were a list of + absolute file names, but internally it uses the same format as + Explorer and other compatible programs under Windows or GNOME/KDE + filemanager under Unix which makes it possible to receive files from + them using this class. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxFileDataObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -4550,11 +5031,19 @@ class FileDataObject(DataObjectSimple): self.thisown = 1 del newobj.thisown def GetFilenames(*args, **kwargs): - """GetFilenames(self) -> wxArrayString""" + """ + GetFilenames(self) -> [names] + + Returns a list of file names. + """ return _misc_.FileDataObject_GetFilenames(*args, **kwargs) def AddFile(*args, **kwargs): - """AddFile(self, String filename)""" + """ + AddFile(self, String filename) + + Adds a file to the list of files represented by this data object. + """ return _misc_.FileDataObject_AddFile(*args, **kwargs) @@ -4566,28 +5055,54 @@ class FileDataObjectPtr(FileDataObject): _misc_.FileDataObject_swigregister(FileDataObjectPtr) class CustomDataObject(DataObjectSimple): + """ + wx.CustomDataObject is a specialization of `wx.DataObjectSimple` for + some application-specific data in arbitrary format. Python strings + are used for getting and setting data, but any picklable object can + easily be transfered via strings. A copy of the data is stored in the + data object. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxCustomDataObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) - def __init__(self, *args, **kwargs): - """__init__(self, DataFormat format=FormatInvalid) -> CustomDataObject""" - newobj = _misc_.new_CustomDataObject(*args, **kwargs) + def __init__(self, *args): + """ + __init__(self, DataFormat format) -> CustomDataObject + __init__(self, String formatName) -> CustomDataObject + __init__(self) -> CustomDataObject + + wx.CustomDataObject is a specialization of `wx.DataObjectSimple` for + some application-specific data in arbitrary format. Python strings + are used for getting and setting data, but any picklable object can + easily be transfered via strings. A copy of the data is stored in the + data object. + """ + newobj = _misc_.new_CustomDataObject(*args) self.this = newobj.this self.thisown = 1 del newobj.thisown - def TakeData(*args, **kwargs): - """TakeData(self, PyObject data)""" - return _misc_.CustomDataObject_TakeData(*args, **kwargs) - def SetData(*args, **kwargs): - """SetData(self, PyObject data) -> bool""" + """ + SetData(self, String data) -> bool + + Copy the data value to the data object. + """ return _misc_.CustomDataObject_SetData(*args, **kwargs) + TakeData = SetData def GetSize(*args, **kwargs): - """GetSize(self) -> size_t""" + """ + GetSize(self) -> size_t + + Get the size of the data. + """ return _misc_.CustomDataObject_GetSize(*args, **kwargs) def GetData(*args, **kwargs): - """GetData(self) -> PyObject""" + """ + GetData(self) -> String + + Returns the data bytes from the data object as a string. + """ return _misc_.CustomDataObject_GetData(*args, **kwargs) @@ -4599,20 +5114,37 @@ class CustomDataObjectPtr(CustomDataObject): _misc_.CustomDataObject_swigregister(CustomDataObjectPtr) class URLDataObject(DataObjectComposite): + """ + This data object holds a URL in a format that is compatible with some + browsers such that it is able to be dragged to or from them. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxURLDataObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(self) -> URLDataObject""" + """ + __init__(self) -> URLDataObject + + This data object holds a URL in a format that is compatible with some + browsers such that it is able to be dragged to or from them. + """ newobj = _misc_.new_URLDataObject(*args, **kwargs) self.this = newobj.this self.thisown = 1 del newobj.thisown def GetURL(*args, **kwargs): - """GetURL(self) -> String""" + """ + GetURL(self) -> String + + Returns a string containing the current URL. + """ return _misc_.URLDataObject_GetURL(*args, **kwargs) def SetURL(*args, **kwargs): - """SetURL(self, String url)""" + """ + SetURL(self, String url) + + Set the URL. + """ return _misc_.URLDataObject_SetURL(*args, **kwargs) @@ -4624,6 +5156,7 @@ class URLDataObjectPtr(URLDataObject): _misc_.URLDataObject_swigregister(URLDataObjectPtr) class MetafileDataObject(DataObjectSimple): + """Proxy of C++ MetafileDataObject class""" def __repr__(self): return "<%s.%s; proxy of C++ wxMetafileDataObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -4664,6 +5197,7 @@ def IsDragResultOk(*args, **kwargs): """IsDragResultOk(int res) -> bool""" return _misc_.IsDragResultOk(*args, **kwargs) class DropSource(object): + """Proxy of C++ DropSource class""" def __repr__(self): return "<%s.%s; proxy of C++ wxPyDropSource instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -4675,6 +5209,8 @@ class DropSource(object): self.this = newobj.this self.thisown = 1 del newobj.thisown + self._setCallbackInfo(self, DropSource, 0) + def _setCallbackInfo(*args, **kwargs): """_setCallbackInfo(self, PyObject self, PyObject _class, int incref)""" return _misc_.DropSource__setCallbackInfo(*args, **kwargs) @@ -4714,6 +5250,7 @@ class DropSourcePtr(DropSource): _misc_.DropSource_swigregister(DropSourcePtr) class DropTarget(object): + """Proxy of C++ DropTarget class""" def __repr__(self): return "<%s.%s; proxy of C++ wxPyDropTarget instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -4762,6 +5299,14 @@ class DropTarget(object): """GetData(self) -> bool""" return _misc_.DropTarget_GetData(*args, **kwargs) + def SetDefaultAction(*args, **kwargs): + """SetDefaultAction(self, int action)""" + return _misc_.DropTarget_SetDefaultAction(*args, **kwargs) + + def GetDefaultAction(*args, **kwargs): + """GetDefaultAction(self) -> int""" + return _misc_.DropTarget_GetDefaultAction(*args, **kwargs) + class DropTargetPtr(DropTarget): def __init__(self, this): @@ -4772,6 +5317,7 @@ _misc_.DropTarget_swigregister(DropTargetPtr) PyDropTarget = DropTarget class TextDropTarget(DropTarget): + """Proxy of C++ TextDropTarget class""" def __repr__(self): return "<%s.%s; proxy of C++ wxPyTextDropTarget instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -4815,6 +5361,7 @@ class TextDropTargetPtr(TextDropTarget): _misc_.TextDropTarget_swigregister(TextDropTargetPtr) class FileDropTarget(DropTarget): + """Proxy of C++ FileDropTarget class""" def __repr__(self): return "<%s.%s; proxy of C++ wxPyFileDropTarget instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -4861,15 +5408,19 @@ _misc_.FileDropTarget_swigregister(FileDropTargetPtr) class Clipboard(_core.Object): """ - wx.Clipboard represents the system clipboard and provides methods to copy data - to or paste data from it. Normally, you should only use wx.TheClipboard which - is a reference to a global wx.Clipboard instance. + wx.Clipboard represents the system clipboard and provides methods to + copy data to it or paste data from it. Normally, you should only use + ``wx.TheClipboard`` which is a reference to a global wx.Clipboard + instance. + + Call ``wx.TheClipboard``'s `Open` method to get ownership of the + clipboard. If this operation returns True, you now own the + clipboard. Call `SetData` to put data on the clipboard, or `GetData` + to retrieve data from the clipboard. Call `Close` to close the + clipboard and relinquish ownership. You should keep the clipboard open + only momentarily. - Call wx.TheClipboard.Open to get ownership of the clipboard. If this operation - returns True, you now own the clipboard. Call wx.TheClipboard.SetData to put - data on the clipboard, or wx.TheClipboard.GetData to retrieve data from the - clipboard. Call wx.TheClipboard.Close to close the clipboard and relinquish - ownership. You should keep the clipboard open only momentarily. + :see: `wx.DataObject` """ def __repr__(self): @@ -4890,10 +5441,10 @@ class Clipboard(_core.Object): """ Open(self) -> bool - Call this function to open the clipboard before calling SetData - and GetData. Call Close when you have finished with the clipboard. - You should keep the clipboard open for only a very short time. - Returns true on success. + Call this function to open the clipboard before calling SetData and + GetData. Call Close when you have finished with the clipboard. You + should keep the clipboard open for only a very short time. Returns + True on success. """ return _misc_.Clipboard_Open(*args, **kwargs) @@ -4917,10 +5468,12 @@ class Clipboard(_core.Object): """ AddData(self, DataObject data) -> bool - Call this function to add the data object to the clipboard. You - may call this function repeatedly after having cleared the clipboard. + Call this function to add the data object to the clipboard. You may + call this function repeatedly after having cleared the clipboard. After this function has been called, the clipboard owns the data, so do not delete the data explicitly. + + :see: `wx.DataObject` """ return _misc_.Clipboard_AddData(*args, **kwargs) @@ -4928,7 +5481,10 @@ class Clipboard(_core.Object): """ SetData(self, DataObject data) -> bool - Set the clipboard data, this is the same as Clear followed by AddData. + Set the clipboard data, this is the same as `Clear` followed by + `AddData`. + + :see: `wx.DataObject` """ return _misc_.Clipboard_SetData(*args, **kwargs) @@ -4945,8 +5501,8 @@ class Clipboard(_core.Object): """ GetData(self, DataObject data) -> bool - Call this function to fill data with data on the clipboard, if available - in the required format. Returns true on success. + Call this function to fill data with data on the clipboard, if + available in the required format. Returns true on success. """ return _misc_.Clipboard_GetData(*args, **kwargs) @@ -4954,7 +5510,7 @@ class Clipboard(_core.Object): """ Clear(self) - Clears data from the clipboard object and also the system's clipboard + Clears data from the clipboard object and also the system's clipboard if possible. """ return _misc_.Clipboard_Clear(*args, **kwargs) @@ -4964,9 +5520,9 @@ class Clipboard(_core.Object): Flush(self) -> bool Flushes the clipboard: this means that the data which is currently on - clipboard will stay available even after the application exits (possibly - eating memory), otherwise the clipboard will be emptied on exit. - Returns False if the operation is unsuccesful for any reason. + clipboard will stay available even after the application exits, + possibly eating memory, otherwise the clipboard will be emptied on + exit. Returns False if the operation is unsuccesful for any reason. """ return _misc_.Clipboard_Flush(*args, **kwargs) @@ -4974,12 +5530,21 @@ class Clipboard(_core.Object): """ UsePrimarySelection(self, bool primary=True) - On platforms supporting it (the X11 based platforms), selects the so - called PRIMARY SELECTION as the clipboard as opposed to the normal - clipboard, if primary is True. + On platforms supporting it (the X11 based platforms), selects the + so called PRIMARY SELECTION as the clipboard as opposed to the + normal clipboard, if primary is True. """ return _misc_.Clipboard_UsePrimarySelection(*args, **kwargs) + def Get(*args, **kwargs): + """ + Get() -> Clipboard + + Returns global instance (wxTheClipboard) of the object. + """ + return _misc_.Clipboard_Get(*args, **kwargs) + + Get = staticmethod(Get) class ClipboardPtr(Clipboard): def __init__(self, this): @@ -4988,10 +5553,35 @@ class ClipboardPtr(Clipboard): self.__class__ = Clipboard _misc_.Clipboard_swigregister(ClipboardPtr) +def Clipboard_Get(*args, **kwargs): + """ + Clipboard_Get() -> Clipboard + + Returns global instance (wxTheClipboard) of the object. + """ + return _misc_.Clipboard_Get(*args, **kwargs) + +class _wxPyDelayedInitWrapper(object): + def __init__(self, initfunc, *args, **kwargs): + self._initfunc = initfunc + self._args = args + self._kwargs = kwargs + self._instance = None + def _checkInstance(self): + if self._instance is None: + self._instance = self._initfunc(*self._args, **self._kwargs) + def __getattr__(self, name): + self._checkInstance() + return getattr(self._instance, name) + def __repr__(self): + self._checkInstance() + return repr(self._instance) +TheClipboard = _wxPyDelayedInitWrapper(Clipboard.Get) + class ClipboardLocker(object): """ - A helpful class for opening the clipboard and automatically closing it when - the locker is destroyed. + A helpful class for opening the clipboard and automatically + closing it when the locker is destroyed. """ def __repr__(self): return "<%s.%s; proxy of C++ wxClipboardLocker instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) @@ -4999,8 +5589,8 @@ class ClipboardLocker(object): """ __init__(self, Clipboard clipboard=None) -> ClipboardLocker - A helpful class for opening the clipboard and automatically closing it when - the locker is destroyed. + A helpful class for opening the clipboard and automatically + closing it when the locker is destroyed. """ newobj = _misc_.new_ClipboardLocker(*args, **kwargs) self.this = newobj.this @@ -5028,7 +5618,6 @@ class ClipboardLockerPtr(ClipboardLocker): if not hasattr(self,"thisown"): self.thisown = 0 self.__class__ = ClipboardLocker _misc_.ClipboardLocker_swigregister(ClipboardLockerPtr) -TheClipboard = cvar.TheClipboard #--------------------------------------------------------------------------- @@ -5056,8 +5645,8 @@ class VideoMode(object): """ Matches(self, VideoMode other) -> bool - Returns true if this mode matches the other one in the sense that - all non zero fields of the other mode have the same value in this + Returns true if this mode matches the other one in the sense that all + non zero fields of the other mode have the same value in this one (except for refresh which is allowed to have a greater value) """ return _misc_.VideoMode_Matches(*args, **kwargs) @@ -5066,8 +5655,7 @@ class VideoMode(object): """ GetWidth(self) -> int - Returns the screen width in pixels (e.g. 640*480), 0 means - unspecified + Returns the screen width in pixels (e.g. 640*480), 0 means unspecified """ return _misc_.VideoMode_GetWidth(*args, **kwargs) @@ -5084,8 +5672,8 @@ class VideoMode(object): """ GetDepth(self) -> int - Returns the screen's bits per pixel (e.g. 32), 1 is monochrome - and 0 means unspecified/known + Returns the screen's bits per pixel (e.g. 32), 1 is monochrome and 0 + means unspecified/known """ return _misc_.VideoMode_GetDepth(*args, **kwargs) @@ -5126,9 +5714,9 @@ class Display(object): """ __init__(self, size_t index=0) -> Display - Set up a Display instance with the specified display. The - displays are numbered from 0 to GetCount() - 1, 0 is always the - primary display and the only one which is always supported + Set up a Display instance with the specified display. The displays + are numbered from 0 to GetCount() - 1, 0 is always the primary display + and the only one which is always supported """ newobj = _misc_.new_Display(*args, **kwargs) self.this = newobj.this @@ -5142,7 +5730,7 @@ class Display(object): def GetCount(*args, **kwargs): """ - Display.GetCount() -> size_t + GetCount() -> size_t Return the number of available displays. """ @@ -5151,20 +5739,20 @@ class Display(object): GetCount = staticmethod(GetCount) def GetFromPoint(*args, **kwargs): """ - Display.GetFromPoint(Point pt) -> int + GetFromPoint(Point pt) -> int - Find the display where the given point lies, return wx.NOT_FOUND - if it doesn't belong to any display + Find the display where the given point lies, return wx.NOT_FOUND if it + doesn't belong to any display """ return _misc_.Display_GetFromPoint(*args, **kwargs) GetFromPoint = staticmethod(GetFromPoint) def GetFromWindow(*args, **kwargs): """ - Display.GetFromWindow(Window window) -> int + GetFromWindow(Window window) -> int - Find the display where the given window lies, return wx.NOT_FOUND - if it is not shown at all. + Find the display where the given window lies, return wx.NOT_FOUND if + it is not shown at all. """ return _misc_.Display_GetFromWindow(*args, **kwargs) @@ -5182,8 +5770,8 @@ class Display(object): """ GetGeometry(self) -> Rect - Returns the bounding rectangle of the display whose index was - passed to the constructor. + Returns the bounding rectangle of the display whose index was passed + to the constructor. """ return _misc_.Display_GetGeometry(*args, **kwargs) @@ -5208,14 +5796,13 @@ class Display(object): """ GetModes(VideoMode mode=DefaultVideoMode) -> [videoMode...] - Enumerate all video modes supported by this display matching the - given one (in the sense of VideoMode.Match()). + Enumerate all video modes supported by this display matching the given + one (in the sense of VideoMode.Match()). - As any mode matches the default value of the argument and there - is always at least one video mode supported by display, the - returned array is only empty for the default value of the - argument if this function is not supported at all on this - platform. + As any mode matches the default value of the argument and there is + always at least one video mode supported by display, the returned + array is only empty for the default value of the argument if this + function is not supported at all on this platform. """ return _misc_.Display_GetModes(*args, **kwargs) @@ -5231,7 +5818,22 @@ class Display(object): """ ChangeMode(self, VideoMode mode=DefaultVideoMode) -> bool - Change current mode, return true if succeeded, false otherwise + Changes the video mode of this display to the mode specified in the + mode parameter. + + If wx.DefaultVideoMode is passed in as the mode parameter, the defined + behaviour is that wx.Display will reset the video mode to the default + mode used by the display. On Windows, the behavior is normal. + However, there are differences on other platforms. On Unix variations + using X11 extensions it should behave as defined, but some + irregularities may occur. + + On wxMac passing in wx.DefaultVideoMode as the mode parameter does + nothing. This happens because Carbon no longer has access to + DMUseScreenPrefs, an undocumented function that changed the video mode + to the system default by using the system's 'scrn' resource. + + Returns True if succeeded, False otherwise """ return _misc_.Display_ChangeMode(*args, **kwargs) @@ -5264,8 +5866,8 @@ def Display_GetFromPoint(*args, **kwargs): """ Display_GetFromPoint(Point pt) -> int - Find the display where the given point lies, return wx.NOT_FOUND - if it doesn't belong to any display + Find the display where the given point lies, return wx.NOT_FOUND if it + doesn't belong to any display """ return _misc_.Display_GetFromPoint(*args, **kwargs) @@ -5273,9 +5875,164 @@ def Display_GetFromWindow(*args, **kwargs): """ Display_GetFromWindow(Window window) -> int - Find the display where the given window lies, return wx.NOT_FOUND - if it is not shown at all. + Find the display where the given window lies, return wx.NOT_FOUND if + it is not shown at all. """ return _misc_.Display_GetFromWindow(*args, **kwargs) +#--------------------------------------------------------------------------- + +class StandardPaths(object): + """ + wx.StandardPaths returns the standard locations in the file system and + should be used by the programs to find their data files in a portable + way. + + In the description of the methods below, the example return values are + given for the Unix, Windows and Mac OS X systems, however please note + that these are just the examples and the actual values may differ. For + example, under Windows: the system administrator may change the + standard directories locations, i.e. the Windows directory may be + named W:\Win2003 instead of the default C:\Windows. + + The strings appname and username should be replaced with the value + returned by `wx.App.GetAppName` and the name of the currently logged + in user, respectively. The string prefix is only used under Unix and + is /usr/local by default but may be changed using `SetInstallPrefix`. + + The directories returned by the methods of this class may or may not + exist. If they don't exist, it's up to the caller to create them, + wxStandardPaths doesn't do it. + + Finally note that these functions only work with standardly packaged + applications. I.e. under Unix you should follow the standard + installation conventions and under Mac you should create your + application bundle according to the Apple guidelines. Again, this + class doesn't help you to do it. + """ + def __init__(self): raise RuntimeError, "No constructor defined" + def __repr__(self): + return "<%s.%s; proxy of C++ wxStandardPaths instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def Get(*args, **kwargs): + """ + Get() -> StandardPaths + + Return the global standard paths singleton + """ + return _misc_.StandardPaths_Get(*args, **kwargs) + + Get = staticmethod(Get) + def GetConfigDir(*args, **kwargs): + """ + GetConfigDir(self) -> String + + Return the directory with system config files: /etc under Unix, + 'c:\Documents and Settings\All Users\Application Data' under Windows, + /Library/Preferences for Mac + """ + return _misc_.StandardPaths_GetConfigDir(*args, **kwargs) + + def GetUserConfigDir(*args, **kwargs): + """ + GetUserConfigDir(self) -> String + + Return the directory for the user config files: $HOME under Unix, + 'c:\Documents and Settings\username' under Windows, and + ~/Library/Preferences under Mac + + Only use this if you have a single file to put there, otherwise + `GetUserDataDir` is more appropriate + """ + return _misc_.StandardPaths_GetUserConfigDir(*args, **kwargs) + + def GetDataDir(*args, **kwargs): + """ + GetDataDir(self) -> String + + Return the location of the application's global, (i.e. not + user-specific,) data files: prefix/share/appname under Unix, + 'c:\Program Files\appname' under Windows, + appname.app/Contents/SharedSupport app bundle directory under Mac. + """ + return _misc_.StandardPaths_GetDataDir(*args, **kwargs) + + def GetLocalDataDir(*args, **kwargs): + """ + GetLocalDataDir(self) -> String + + Return the location for application data files which are + host-specific. Same as `GetDataDir` except under Unix where it is + /etc/appname + """ + return _misc_.StandardPaths_GetLocalDataDir(*args, **kwargs) + + def GetUserDataDir(*args, **kwargs): + """ + GetUserDataDir(self) -> String + + Return the directory for the user-dependent application data files: + $HOME/.appname under Unix, c:\Documents and + Settings\username\Application Data\appname under Windows and + ~/Library/Application Support/appname under Mac + """ + return _misc_.StandardPaths_GetUserDataDir(*args, **kwargs) + + def GetUserLocalDataDir(*args, **kwargs): + """ + GetUserLocalDataDir(self) -> String + + Return the directory for user data files which shouldn't be shared + with the other machines + + Same as `GetUserDataDir` for all platforms except Windows where it is + the 'Local Settings\Application Data\appname' directory. + """ + return _misc_.StandardPaths_GetUserLocalDataDir(*args, **kwargs) + + def GetPluginsDir(*args, **kwargs): + """ + GetPluginsDir(self) -> String + + Return the directory where the loadable modules (plugins) live: + prefix/lib/appname under Unix, program directory under Windows and + Contents/Plugins app bundle subdirectory under Mac + """ + return _misc_.StandardPaths_GetPluginsDir(*args, **kwargs) + + def SetInstallPrefix(*args, **kwargs): + """ + SetInstallPrefix(self, String prefix) + + Set the program installation directory which is /usr/local by default. + This value will be used by other methods such as `GetDataDir` and + `GetPluginsDir` as the prefix for what they return. (This function + only has meaning on Unix systems.) + """ + return _misc_.StandardPaths_SetInstallPrefix(*args, **kwargs) + + def GetInstallPrefix(*args, **kwargs): + """ + GetInstallPrefix(self) -> String + + Get the program installation prefix. The default is the prefix where + Python is installed. (This function only has meaning on Unix systems.) + """ + return _misc_.StandardPaths_GetInstallPrefix(*args, **kwargs) + + +class StandardPathsPtr(StandardPaths): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = StandardPaths +_misc_.StandardPaths_swigregister(StandardPathsPtr) + +def StandardPaths_Get(*args, **kwargs): + """ + StandardPaths_Get() -> StandardPaths + + Return the global standard paths singleton + """ + return _misc_.StandardPaths_Get(*args, **kwargs) +