]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/mac/_core.py
Added wxFRAME_DRAWER
[wxWidgets.git] / wxPython / src / mac / _core.py
index 1008ccf9ebfb280d5ac8a87cd33440bcc6271fb9..5ff26d96e1cc4a9e4d7752c2b305e75c1bdfd9a7 100644 (file)
@@ -206,6 +206,29 @@ ID_NOTOALL = _core_.ID_NOTOALL
 ID_ABORT = _core_.ID_ABORT
 ID_RETRY = _core_.ID_RETRY
 ID_IGNORE = _core_.ID_IGNORE
 ID_ABORT = _core_.ID_ABORT
 ID_RETRY = _core_.ID_RETRY
 ID_IGNORE = _core_.ID_IGNORE
+ID_ADD = _core_.ID_ADD
+ID_REMOVE = _core_.ID_REMOVE
+ID_UP = _core_.ID_UP
+ID_DOWN = _core_.ID_DOWN
+ID_HOME = _core_.ID_HOME
+ID_REFRESH = _core_.ID_REFRESH
+ID_STOP = _core_.ID_STOP
+ID_INDEX = _core_.ID_INDEX
+ID_BOLD = _core_.ID_BOLD
+ID_ITALIC = _core_.ID_ITALIC
+ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
+ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
+ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
+ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
+ID_UNDERLINE = _core_.ID_UNDERLINE
+ID_INDENT = _core_.ID_INDENT
+ID_UNINDENT = _core_.ID_UNINDENT
+ID_ZOOM_100 = _core_.ID_ZOOM_100
+ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
+ID_ZOOM_IN = _core_.ID_ZOOM_IN
+ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
+ID_UNDELETE = _core_.ID_UNDELETE
+ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
 ID_HIGHEST = _core_.ID_HIGHEST
 OPEN = _core_.OPEN
 SAVE = _core_.SAVE
 ID_HIGHEST = _core_.ID_HIGHEST
 OPEN = _core_.OPEN
 SAVE = _core_.SAVE
@@ -292,6 +315,9 @@ BORDER_RAISED = _core_.BORDER_RAISED
 BORDER_SUNKEN = _core_.BORDER_SUNKEN
 BORDER_DOUBLE = _core_.BORDER_DOUBLE
 BORDER_MASK = _core_.BORDER_MASK
 BORDER_SUNKEN = _core_.BORDER_SUNKEN
 BORDER_DOUBLE = _core_.BORDER_DOUBLE
 BORDER_MASK = _core_.BORDER_MASK
+BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
+BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
+BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
 DEFAULT = _core_.DEFAULT
 DECORATIVE = _core_.DECORATIVE
 ROMAN = _core_.ROMAN
 DEFAULT = _core_.DEFAULT
 DECORATIVE = _core_.DECORATIVE
 ROMAN = _core_.ROMAN
@@ -1588,6 +1614,8 @@ class FSFile(Object):
         self.this = newobj.this
         self.thisown = 1
         del newobj.thisown
         self.this = newobj.this
         self.thisown = 1
         del newobj.thisown
+        self.thisown = 0   # It will normally be deleted by the user of the wxFileSystem
+
     def __del__(self, destroy=_core_.delete_FSFile):
         """__del__(self)"""
         try:
     def __del__(self, destroy=_core_.delete_FSFile):
         """__del__(self)"""
         try:
@@ -2060,6 +2088,20 @@ class Image(Object):
         """
         return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
 
         """
         return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
 
+    def ConvertAlphaToMask(*args, **kwargs):
+        """
+        ConvertAlphaToMask(self, byte threshold=128) -> bool
+
+        If the image has alpha channel, this method converts it to mask. All pixels
+        with alpha value less than ``threshold`` are replaced with mask colour and the
+        alpha channel is removed. Mask colour is chosen automatically using
+        `FindFirstUnusedColour`.
+
+        If the image image doesn't have alpha channel, ConvertAlphaToMask does
+        nothing.
+        """
+        return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
+
     def SetMaskFromImage(*args, **kwargs):
         """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
         return _core_.Image_SetMaskFromImage(*args, **kwargs)
     def SetMaskFromImage(*args, **kwargs):
         """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
         return _core_.Image_SetMaskFromImage(*args, **kwargs)
@@ -2262,7 +2304,7 @@ class Image(Object):
 
     GetImageExtWildcard = staticmethod(GetImageExtWildcard)
     def ConvertToBitmap(*args, **kwargs):
 
     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):
         return _core_.Image_ConvertToBitmap(*args, **kwargs)
 
     def ConvertToMonoBitmap(*args, **kwargs):
@@ -2553,6 +2595,42 @@ class TIFFHandlerPtr(TIFFHandler):
         self.__class__ = TIFFHandler
 _core_.TIFFHandler_swigregister(TIFFHandlerPtr)
 
         self.__class__ = TIFFHandler
 _core_.TIFFHandler_swigregister(TIFFHandlerPtr)
 
+QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
+QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
+class Quantize(object):
+    """Performs quantization, or colour reduction, on a wxImage."""
+    def __init__(self): raise RuntimeError, "No constructor defined"
+    def __repr__(self):
+        return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
+    def Quantize(*args, **kwargs):
+        """
+        Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
+
+        Reduce the colours in the source image and put the result into the
+        destination image, setting the palette in the destination if
+        needed. Both images may be the same, to overwrite the source image.
+        """
+        return _core_.Quantize_Quantize(*args, **kwargs)
+
+    Quantize = staticmethod(Quantize)
+
+class QuantizePtr(Quantize):
+    def __init__(self, this):
+        self.this = this
+        if not hasattr(self,"thisown"): self.thisown = 0
+        self.__class__ = Quantize
+_core_.Quantize_swigregister(QuantizePtr)
+
+def Quantize_Quantize(*args, **kwargs):
+    """
+    Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
+
+    Reduce the colours in the source image and put the result into the
+    destination image, setting the palette in the destination if
+    needed. Both images may be the same, to overwrite the source image.
+    """
+    return _core_.Quantize_Quantize(*args, **kwargs)
+
 #---------------------------------------------------------------------------
 
 class EvtHandler(Object):
 #---------------------------------------------------------------------------
 
 class EvtHandler(Object):
@@ -5227,7 +5305,8 @@ your Mac."""
     def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
         """
         Set the title, position and/or size of the output window if
     def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
         """
         Set the title, position and/or size of the output window if
-        the stdio has been redirected.
+        the stdio has been redirected.  This should be called before
+        any output would cause the output window to be created.
         """
         if self.stdioWin:
             if title is not None:
         """
         if self.stdioWin:
             if title is not None:
@@ -5979,9 +6058,8 @@ class Window(EvtHandler):
         """
         return _core_.Window_FitInside(*args, **kwargs)
 
         """
         return _core_.Window_FitInside(*args, **kwargs)
 
-    def SetSizeHints(*args):
+    def SetSizeHints(*args, **kwargs):
         """
         """
-        SetSizeHints(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
         SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, 
             int incH=-1)
 
         SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, 
             int incH=-1)
 
@@ -5994,11 +6072,25 @@ class Window(EvtHandler):
 
         The resizing increments are only significant under Motif or Xt.
         """
 
         The resizing increments are only significant under Motif or Xt.
         """
-        return _core_.Window_SetSizeHints(*args)
+        return _core_.Window_SetSizeHints(*args, **kwargs)
+
+    def SetSizeHintsSz(*args, **kwargs):
+        """
+        SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
+
+        Allows specification of minimum and maximum window sizes, and window
+        size increments. If a pair of values is not set (or set to -1), the
+        default values will be used.  If this function is called, the user
+        will not be able to size the window outside the given bounds (if it is
+        a top-level window.)  Sizers will also inspect the minimum window size
+        and will use that value if set when calculating layout.
+
+        The resizing increments are only significant under Motif or Xt.
+        """
+        return _core_.Window_SetSizeHintsSz(*args, **kwargs)
 
 
-    def SetVirtualSizeHints(*args):
+    def SetVirtualSizeHints(*args, **kwargs):
         """
         """
-        SetVirtualSizeHints(self, Size minSize, Size maxSize=DefaultSize)
         SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
 
         Allows specification of minimum and maximum virtual window sizes. If a
         SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
 
         Allows specification of minimum and maximum virtual window sizes. If a
@@ -6006,7 +6098,18 @@ class Window(EvtHandler):
         used.  If this function is called, the user will not be able to size
         the virtual area of the window outside the given bounds.
         """
         used.  If this function is called, the user will not be able to size
         the virtual area of the window outside the given bounds.
         """
-        return _core_.Window_SetVirtualSizeHints(*args)
+        return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
+
+    def SetVirtualSizeHintsSz(*args, **kwargs):
+        """
+        SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
+
+        Allows specification of minimum and maximum virtual window sizes. If a
+        pair of values is not set (or set to -1), the default values will be
+        used.  If this function is called, the user will not be able to size
+        the virtual area of the window outside the given bounds.
+        """
+        return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
 
     def GetMaxSize(*args, **kwargs):
         """GetMaxSize(self) -> Size"""
 
     def GetMaxSize(*args, **kwargs):
         """GetMaxSize(self) -> Size"""
@@ -6926,6 +7029,39 @@ class Window(EvtHandler):
         """
         return _core_.Window_GetForegroundColour(*args, **kwargs)
 
         """
         return _core_.Window_GetForegroundColour(*args, **kwargs)
 
+    def SetBackgroundStyle(*args, **kwargs):
+        """
+        SetBackgroundStyle(self, int style) -> bool
+
+        Returns the background style of the window. The background style
+        indicates how the background of the window is drawn.
+
+            ======================  ========================================
+            wx.BG_STYLE_SYSTEM      The background colour or pattern should
+                                    be determined by the system
+            wx.BG_STYLE_COLOUR      The background should be a solid colour
+            wx.BG_STYLE_CUSTOM      The background will be implemented by the
+                                    application.
+            ======================  ========================================
+
+        On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
+        a custom background, such as a tiled bitmap. Currently the style has
+        no effect on other platforms.
+
+        :see: `GetBackgroundStyle`, `SetBackgroundColour`
+        """
+        return _core_.Window_SetBackgroundStyle(*args, **kwargs)
+
+    def GetBackgroundStyle(*args, **kwargs):
+        """
+        GetBackgroundStyle(self) -> int
+
+        Returns the background style of the window.
+
+        :see: `SetBackgroundStyle`
+        """
+        return _core_.Window_GetBackgroundStyle(*args, **kwargs)
+
     def SetCursor(*args, **kwargs):
         """
         SetCursor(self, Cursor cursor) -> bool
     def SetCursor(*args, **kwargs):
         """
         SetCursor(self, Cursor cursor) -> bool
@@ -7124,6 +7260,22 @@ class Window(EvtHandler):
         """
         return _core_.Window_GetHandle(*args, **kwargs)
 
         """
         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 HasScrollbar(*args, **kwargs):
         """
         HasScrollbar(self, int orient) -> bool
     def HasScrollbar(*args, **kwargs):
         """
         HasScrollbar(self, int orient) -> bool
@@ -8363,7 +8515,7 @@ class ItemContainer(object):
 
     def AppendItems(*args, **kwargs):
         """
 
     def AppendItems(*args, **kwargs):
         """
-        AppendItems(self, wxArrayString strings)
+        AppendItems(self, List strings)
 
         Apend several items at once to the control.  Notice that calling this
         method may be much faster than appending the items one by one if you
 
         Apend several items at once to the control.  Notice that calling this
         method may be much faster than appending the items one by one if you
@@ -9172,12 +9324,13 @@ class Sizer(Object):
 
     def Show(*args, **kwargs):
         """
 
     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
 
         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)
 
         """
         return _core_.Sizer_Show(*args, **kwargs)
 
@@ -9192,11 +9345,11 @@ class Sizer(Object):
         """
         return _core_.Sizer_IsShown(*args, **kwargs)
 
         """
         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):
         """
 
     def ShowItems(*args, **kwargs):
         """
@@ -10435,16 +10588,16 @@ __wxPyPtrTypeMap['wxStatusBar95']   = 'wxStatusBar'
 
 #----------------------------------------------------------------------------
 # Load version numbers from __version__...  Ensure that major and minor
 
 #----------------------------------------------------------------------------
 # Load version numbers from __version__...  Ensure that major and minor
-# versions are the same for both wxPython and wxWindows.
+# versions are the same for both wxPython and wxWidgets.
 
 from __version__ import *
 __version__ = VERSION_STRING
 
 
 from __version__ import *
 __version__ = VERSION_STRING
 
-assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWindows version mismatch"
-assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWindows version mismatch"
+assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
+assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
 if RELEASE_VERSION != _core_.RELEASE_VERSION:
     import warnings
 if RELEASE_VERSION != _core_.RELEASE_VERSION:
     import warnings
-    warnings.warn("wxPython/wxWindows release number mismatch")
+    warnings.warn("wxPython/wxWidgets release number mismatch")
 
 #----------------------------------------------------------------------------
 
 
 #----------------------------------------------------------------------------