]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/_core.py
the #ifdef around BROWSEINFO.lpszTitle assignment is bogus; should be c_str() everywhere
[wxWidgets.git] / wxPython / src / msw / _core.py
index cb05e66b3c0d907d5a867eb27514502fe19ee5fc..9f6243ecb57e844785e58223ec459ff0327007f8 100644 (file)
@@ -1771,6 +1771,11 @@ class FileSystem(Object):
         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):
@@ -1791,10 +1796,10 @@ def 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)
+
 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 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):
@@ -2304,7 +2317,7 @@ class Image(Object):
 
     GetImageExtWildcard = staticmethod(GetImageExtWildcard)
     def ConvertToBitmap(*args, **kwargs):
-        """ConvertToBitmap(self) -> Bitmap"""
+        """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
         return _core_.Image_ConvertToBitmap(*args, **kwargs)
 
     def ConvertToMonoBitmap(*args, **kwargs):
@@ -5398,6 +5411,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
@@ -7260,6 +7336,22 @@ class Window(EvtHandler):
         """
         return _core_.Window_GetHandle(*args, **kwargs)
 
+    def AssociateHandle(*args, **kwargs):
+        """
+        AssociateHandle(self, long handle)
+
+        Associate the window with a new native handle
+        """
+        return _core_.Window_AssociateHandle(*args, **kwargs)
+
+    def DissociateHandle(*args, **kwargs):
+        """
+        DissociateHandle(self)
+
+        Dissociate the current native handle from the window
+        """
+        return _core_.Window_DissociateHandle(*args, **kwargs)
+
     def OnPaint(*args, **kwargs):
         """OnPaint(self, PaintEvent event)"""
         return _core_.Window_OnPaint(*args, **kwargs)
@@ -7522,7 +7614,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
-        non-NoneL and False otherwise.
+        non-None, and False otherwise.
         """
         return _core_.Window_SetSizer(*args, **kwargs)
 
@@ -9377,12 +9469,13 @@ class Sizer(Object):
 
     def Show(*args, **kwargs):
         """
-        Show(self, item, bool show=True)
+        Show(self, item, bool show=True, bool recursive=false) -> bool
 
         Shows or hides an item managed by the sizer.  To make a sizer item
         disappear or reappear, use Show followed by `Layout`.  The *item*
         parameter can be either a window, a sizer, or the zero-based index of
-        the item.
+        the item.  Use the recursive parameter to show or hide an item in a
+        subsizer.  Returns True if the item was found.
         """
         return _core_.Sizer_Show(*args, **kwargs)
 
@@ -9397,11 +9490,11 @@ class Sizer(Object):
         """
         return _core_.Sizer_IsShown(*args, **kwargs)
 
-    def Hide(self, item):
+    def Hide(self, item, recursive=False):
         """
-        A convenience method for Show(item, False).
+        A convenience method for Show(item, False, recursive).
         """
-        self.Show(item, False)
+        return self.Show(item, false, recursive)
 
     def ShowItems(*args, **kwargs):
         """