]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/mac/_core.py
Fix to use old AutoWidthMixin API
[wxWidgets.git] / wxPython / src / mac / _core.py
index 5ff26d96e1cc4a9e4d7752c2b305e75c1bdfd9a7..079b9107691a281ddbaad3b1a724b5a42ad9de6c 100644 (file)
@@ -1771,6 +1771,11 @@ class FileSystem(Object):
         return _core_.FileSystem_FileNameToURL(*args, **kwargs)
 
     FileNameToURL = staticmethod(FileNameToURL)
         return _core_.FileSystem_FileNameToURL(*args, **kwargs)
 
     FileNameToURL = staticmethod(FileNameToURL)
+    def URLToFileName(*args, **kwargs):
+        """URLToFileName(String url) -> String"""
+        return _core_.FileSystem_URLToFileName(*args, **kwargs)
+
+    URLToFileName = staticmethod(URLToFileName)
 
 class FileSystemPtr(FileSystem):
     def __init__(self, this):
 
 class FileSystemPtr(FileSystem):
     def __init__(self, this):
@@ -1791,10 +1796,10 @@ def FileSystem_FileNameToURL(*args, **kwargs):
     """FileSystem_FileNameToURL(String filename) -> String"""
     return _core_.FileSystem_FileNameToURL(*args, **kwargs)
 
     """FileSystem_FileNameToURL(String filename) -> String"""
     return _core_.FileSystem_FileNameToURL(*args, **kwargs)
 
-
 def FileSystem_URLToFileName(*args, **kwargs):
     """FileSystem_URLToFileName(String url) -> String"""
     return _core_.FileSystem_URLToFileName(*args, **kwargs)
 def FileSystem_URLToFileName(*args, **kwargs):
     """FileSystem_URLToFileName(String url) -> String"""
     return _core_.FileSystem_URLToFileName(*args, **kwargs)
+
 class InternetFSHandler(CPPFileSystemHandler):
     def __repr__(self):
         return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
 class InternetFSHandler(CPPFileSystemHandler):
     def __repr__(self):
         return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
@@ -1865,14 +1870,22 @@ def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
     """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
     return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
     """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
     return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
-def MemoryFSHandler_AddFile(filename, a, b=''):
-    if isinstance(a, wx.Image):
-        __wxMemoryFSHandler_AddFile_wxImage(filename, a, b)
-    elif isinstance(a, wx.Bitmap):
-        __wxMemoryFSHandler_AddFile_wxBitmap(filename, a, b)
-    elif type(a) == str:
-        __wxMemoryFSHandler_AddFile_Data(filename, a)
-    else: raise TypeError, 'wx.Image, wx.Bitmap or string expected'
+def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
+    """
+    Add 'file' to the memory filesystem.  The dataItem parameter can
+    either be a `wx.Bitmap`, `wx.Image` or a string that can contain
+    arbitrary data.  If a bitmap or image is used then the imgType
+    parameter should specify what kind of image file it should be
+    written as, wx.BITMAP_TYPE_PNG, etc.
+    """
+    if isinstance(dataItem, wx.Image):
+        __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
+    elif isinstance(dataItem, wx.Bitmap):
+        __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
+    elif type(dataItem) == str:
+        __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
+    else:
+        raise TypeError, 'wx.Image, wx.Bitmap or string expected'
 
 class MemoryFSHandler(CPPFileSystemHandler):
     def __repr__(self):
 
 class MemoryFSHandler(CPPFileSystemHandler):
     def __repr__(self):
@@ -4748,6 +4761,16 @@ class PyApp(EvtHandler):
         """
         return _core_.PyApp_WakeUpIdle(*args, **kwargs)
 
         """
         return _core_.PyApp_WakeUpIdle(*args, **kwargs)
 
+    def IsMainLoopRunning(*args, **kwargs):
+        """
+        IsMainLoopRunning() -> bool
+
+        Returns True if we're running the main loop, i.e. if the events can
+        currently be dispatched.
+        """
+        return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
+
+    IsMainLoopRunning = staticmethod(IsMainLoopRunning)
     def MainLoop(*args, **kwargs):
         """
         MainLoop(self) -> int
     def MainLoop(*args, **kwargs):
         """
         MainLoop(self) -> int
@@ -4974,6 +4997,15 @@ class PyAppPtr(PyApp):
         self.__class__ = PyApp
 _core_.PyApp_swigregister(PyAppPtr)
 
         self.__class__ = PyApp
 _core_.PyApp_swigregister(PyAppPtr)
 
+def PyApp_IsMainLoopRunning(*args, **kwargs):
+    """
+    PyApp_IsMainLoopRunning() -> bool
+
+    Returns True if we're running the main loop, i.e. if the events can
+    currently be dispatched.
+    """
+    return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
+
 def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
     """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
     return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
 def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
     """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
     return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
@@ -5398,6 +5430,69 @@ _sys.__wxPythonCleanup = __wxPyCleanup()
 
 #---------------------------------------------------------------------------
 
 
 #---------------------------------------------------------------------------
 
+class EventLoop(object):
+    def __repr__(self):
+        return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
+    def __init__(self, *args, **kwargs):
+        """__init__(self) -> EventLoop"""
+        newobj = _core_.new_EventLoop(*args, **kwargs)
+        self.this = newobj.this
+        self.thisown = 1
+        del newobj.thisown
+    def __del__(self, destroy=_core_.delete_EventLoop):
+        """__del__(self)"""
+        try:
+            if self.thisown: destroy(self)
+        except: pass
+
+    def Run(*args, **kwargs):
+        """Run(self) -> int"""
+        return _core_.EventLoop_Run(*args, **kwargs)
+
+    def Exit(*args, **kwargs):
+        """Exit(self, int rc=0)"""
+        return _core_.EventLoop_Exit(*args, **kwargs)
+
+    def Pending(*args, **kwargs):
+        """Pending(self) -> bool"""
+        return _core_.EventLoop_Pending(*args, **kwargs)
+
+    def Dispatch(*args, **kwargs):
+        """Dispatch(self) -> bool"""
+        return _core_.EventLoop_Dispatch(*args, **kwargs)
+
+    def IsRunning(*args, **kwargs):
+        """IsRunning(self) -> bool"""
+        return _core_.EventLoop_IsRunning(*args, **kwargs)
+
+    def GetActive(*args, **kwargs):
+        """GetActive() -> EventLoop"""
+        return _core_.EventLoop_GetActive(*args, **kwargs)
+
+    GetActive = staticmethod(GetActive)
+    def SetActive(*args, **kwargs):
+        """SetActive(EventLoop loop)"""
+        return _core_.EventLoop_SetActive(*args, **kwargs)
+
+    SetActive = staticmethod(SetActive)
+
+class EventLoopPtr(EventLoop):
+    def __init__(self, this):
+        self.this = this
+        if not hasattr(self,"thisown"): self.thisown = 0
+        self.__class__ = EventLoop
+_core_.EventLoop_swigregister(EventLoopPtr)
+
+def EventLoop_GetActive(*args, **kwargs):
+    """EventLoop_GetActive() -> EventLoop"""
+    return _core_.EventLoop_GetActive(*args, **kwargs)
+
+def EventLoop_SetActive(*args, **kwargs):
+    """EventLoop_SetActive(EventLoop loop)"""
+    return _core_.EventLoop_SetActive(*args, **kwargs)
+
+#---------------------------------------------------------------------------
+
 class AcceleratorEntry(object):
     """
     A class used to define items in an `wx.AcceleratorTable`.  wxPython
 class AcceleratorEntry(object):
     """
     A class used to define items in an `wx.AcceleratorTable`.  wxPython
@@ -7525,7 +7620,7 @@ class Window(EvtHandler):
         layout sizer object is already owned by the window, it will be deleted
         if the deleteOld parameter is true. Note that this function will also
         call SetAutoLayout implicitly with a True parameter if the sizer is
         layout sizer object is already owned by the window, it will be deleted
         if the deleteOld parameter is true. Note that this function will also
         call SetAutoLayout implicitly with a True parameter if the sizer is
-        non-NoneL and False otherwise.
+        non-None, and False otherwise.
         """
         return _core_.Window_SetSizer(*args, **kwargs)
 
         """
         return _core_.Window_SetSizer(*args, **kwargs)
 
@@ -9324,7 +9419,7 @@ class Sizer(Object):
 
     def Show(*args, **kwargs):
         """
 
     def Show(*args, **kwargs):
         """
-        Show(self, item, bool show=True, bool recursive=False) -> bool
+        Show(self, item, bool show=True, bool recursive=false) -> bool
 
         Shows or hides an item managed by the sizer.  To make a sizer item
         disappear or reappear, use Show followed by `Layout`.  The *item*
 
         Shows or hides an item managed by the sizer.  To make a sizer item
         disappear or reappear, use Show followed by `Layout`.  The *item*
@@ -9349,13 +9444,13 @@ class Sizer(Object):
         """
         A convenience method for Show(item, False, recursive).
         """
         """
         A convenience method for Show(item, False, recursive).
         """
-        return self.Show(item, False, recursive)
+        return self.Show(item, false, recursive)
 
     def ShowItems(*args, **kwargs):
         """
         ShowItems(self, bool show)
 
 
     def ShowItems(*args, **kwargs):
         """
         ShowItems(self, bool show)
 
-        Recursively call `wx.Window.Show` on all sizer items.
+        Recursively call `wx.SizerItem.Show` on all sizer items.
         """
         return _core_.Sizer_ShowItems(*args, **kwargs)
 
         """
         return _core_.Sizer_ShowItems(*args, **kwargs)
 
@@ -10167,6 +10262,15 @@ class GridBagSizer(FlexGridSizer):
         """
         return _core_.GridBagSizer_AddItem(*args, **kwargs)
 
         """
         return _core_.GridBagSizer_AddItem(*args, **kwargs)
 
+    def GetCellSize(*args, **kwargs):
+        """
+        GetCellSize(self, int row, int col) -> Size
+
+        Get the size of the specified cell, including hgap and
+        vgap.  Only valid after a Layout.
+        """
+        return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
+
     def GetEmptyCellSize(*args, **kwargs):
         """
         GetEmptyCellSize(self) -> Size
     def GetEmptyCellSize(*args, **kwargs):
         """
         GetEmptyCellSize(self) -> Size