X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c874b4822add9f739cefacd3ede650311bda005..46ae103b9f08fc4e447d16a6a92b03cf55ee3189:/wxPython/src/mac/_misc.py diff --git a/wxPython/src/mac/_misc.py b/wxPython/src/mac/_misc.py index 558d6d6c04..edf76dee9e 100644 --- a/wxPython/src/mac/_misc.py +++ b/wxPython/src/mac/_misc.py @@ -155,7 +155,7 @@ class SystemSettings(object): GetFont = staticmethod(GetFont) def GetMetric(*args, **kwargs): - """GetMetric(int index) -> int""" + """GetMetric(int index, Window win=None) -> int""" return _misc_.SystemSettings_GetMetric(*args, **kwargs) GetMetric = staticmethod(GetMetric) @@ -191,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): @@ -241,6 +241,11 @@ class SystemOptions(_core.Object): 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): @@ -271,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) + #--------------------------------------------------------------------------- @@ -525,6 +534,15 @@ def SetCursor(*args, **kwargs): """SetCursor(Cursor cursor)""" return _misc_.SetCursor(*args, **kwargs) +def GetXDisplay(*args, **kwargs): + """ + GetXDisplay() -> void + + Returns a swigified pointer to the X11 display. Returns None on + other platforms. + """ + return _misc_.GetXDisplay(*args, **kwargs) + def BeginBusyCursor(*args, **kwargs): """BeginBusyCursor(Cursor cursor=wxHOURGLASS_CURSOR)""" return _misc_.BeginBusyCursor(*args, **kwargs) @@ -545,6 +563,16 @@ def GetTopLevelParent(*args, **kwargs): """GetTopLevelParent(Window win) -> Window""" return _misc_.GetTopLevelParent(*args, **kwargs) +def LaunchDefaultBrowser(*args, **kwargs): + """ + LaunchDefaultBrowser(String url) -> bool + + Launches the user's default browser and tells it to open the location + at ``url``. Returns ``True`` if the application was successfully + launched. + """ + return _misc_.LaunchDefaultBrowser(*args, **kwargs) + def GetKeyState(*args, **kwargs): """ GetKeyState(int key) -> bool @@ -1086,7 +1114,7 @@ class Timer(_core.EvtHandler): """GetId(self) -> int""" return _misc_.Timer_GetId(*args, **kwargs) - def Destroy(): + def Destroy(self): """NO-OP: Timers must be destroyed by normal refrence counting""" pass @@ -1547,6 +1575,32 @@ class LogChainPtr(LogChain): self.__class__ = LogChain _misc_.LogChain_swigregister(LogChainPtr) +class LogBuffer(Log): + """Proxy of C++ LogBuffer class""" + def __repr__(self): + return "<%s.%s; proxy of C++ wxLogBuffer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __init__(self, *args, **kwargs): + """__init__(self) -> LogBuffer""" + newobj = _misc_.new_LogBuffer(*args, **kwargs) + self.this = newobj.this + self.thisown = 1 + del newobj.thisown + def GetBuffer(*args, **kwargs): + """GetBuffer(self) -> String""" + return _misc_.LogBuffer_GetBuffer(*args, **kwargs) + + def Flush(*args, **kwargs): + """Flush(self)""" + return _misc_.LogBuffer_Flush(*args, **kwargs) + + +class LogBufferPtr(LogBuffer): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = LogBuffer +_misc_.LogBuffer_swigregister(LogBufferPtr) + def SysErrorCode(*args, **kwargs): """SysErrorCode() -> unsigned long""" @@ -2548,16 +2602,16 @@ class ArtProvider(object): return _misc_.ArtProvider_GetIcon(*args, **kwargs) GetIcon = staticmethod(GetIcon) - def GetSize(*args, **kwargs): + def GetSizeHint(*args, **kwargs): """ - GetSize(String client, bool platform_dependent=False) -> Size + GetSizeHint(String client, bool platform_dependent=False) -> Size - Get the size of an icon from a specific Art Client, queries the + Get the size hint of an icon from a specific Art Client, queries the topmost provider if platform_dependent = false """ - return _misc_.ArtProvider_GetSize(*args, **kwargs) + return _misc_.ArtProvider_GetSizeHint(*args, **kwargs) - GetSize = staticmethod(GetSize) + GetSizeHint = staticmethod(GetSizeHint) def Destroy(*args, **kwargs): """Destroy(self)""" return _misc_.ArtProvider_Destroy(*args, **kwargs) @@ -2619,6 +2673,7 @@ ART_COPY = cvar.ART_COPY ART_CUT = cvar.ART_CUT ART_PASTE = cvar.ART_PASTE ART_DELETE = cvar.ART_DELETE +ART_NEW = cvar.ART_NEW ART_UNDO = cvar.ART_UNDO ART_REDO = cvar.ART_REDO ART_QUIT = cvar.ART_QUIT @@ -2668,14 +2723,14 @@ def ArtProvider_GetIcon(*args, **kwargs): """ return _misc_.ArtProvider_GetIcon(*args, **kwargs) -def ArtProvider_GetSize(*args, **kwargs): +def ArtProvider_GetSizeHint(*args, **kwargs): """ - ArtProvider_GetSize(String client, bool platform_dependent=False) -> Size + ArtProvider_GetSizeHint(String client, bool platform_dependent=False) -> Size - Get the size of an icon from a specific Art Client, queries the + Get the size hint of an icon from a specific Art Client, queries the topmost provider if platform_dependent = false """ - return _misc_.ArtProvider_GetSize(*args, **kwargs) + return _misc_.ArtProvider_GetSizeHint(*args, **kwargs) #--------------------------------------------------------------------------- @@ -3843,12 +3898,13 @@ class DateTime(object): def __repr__(self): if self.IsValid(): - return '' % ( self.Format(), self.this) + f = self.Format().encode(wx.GetDefaultPyEncoding()) + return '' % ( f, self.this) else: return '' % self.this def __str__(self): if self.IsValid(): - return self.Format() + return self.Format().encode(wx.GetDefaultPyEncoding()) else: return "INVALID DateTime" @@ -4168,9 +4224,10 @@ class TimeSpan(object): return _misc_.TimeSpan_Format(*args, **kwargs) def __repr__(self): - return '' % ( self.Format(), self.this) + f = self.Format().encode(wx.GetDefaultPyEncoding()) + return '' % ( f, self.this) def __str__(self): - return self.Format() + return self.Format().encode(wx.GetDefaultPyEncoding()) class TimeSpanPtr(TimeSpan): @@ -5240,6 +5297,18 @@ class DropSourcePtr(DropSource): self.__class__ = DropSource _misc_.DropSource_swigregister(DropSourcePtr) +def DROP_ICON(filename): + """ + Returns either a `wx.Cursor` or `wx.Icon` created from the image file + ``filename``. This function is useful with the `wx.DropSource` class + which, depending on platform accepts either a icon or a cursor. + """ + img = wx.Image(filename) + if wx.Platform == '__WXGTK__': + return wx.IconFromBitmap(wx.BitmapFromImage(img)) + else: + return wx.CursorFromImage(img) + class DropTarget(object): """Proxy of C++ DropTarget class""" def __repr__(self): @@ -5290,6 +5359,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):