]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/_gdi.py
Try using locale.getpreferredencoding
[wxWidgets.git] / wxPython / src / msw / _gdi.py
index 9e0e22fa413bd7761f9a84804161e6546f326b42..a9b9745df182f742004b7f9e4017f9a06adb05e6 100644 (file)
@@ -2406,12 +2406,12 @@ class FontEnumerator(object):
     def __init__(self, *args, **kwargs): 
         """__init__(self) -> FontEnumerator"""
         _gdi_.FontEnumerator_swiginit(self,_gdi_.new_FontEnumerator(*args, **kwargs))
     def __init__(self, *args, **kwargs): 
         """__init__(self) -> FontEnumerator"""
         _gdi_.FontEnumerator_swiginit(self,_gdi_.new_FontEnumerator(*args, **kwargs))
-        self._setCallbackInfo(self, FontEnumerator, 0)
+        FontEnumerator._setCallbackInfo(self, self, FontEnumerator)
 
     __swig_destroy__ = _gdi_.delete_FontEnumerator
     __del__ = lambda self : None;
     def _setCallbackInfo(*args, **kwargs):
 
     __swig_destroy__ = _gdi_.delete_FontEnumerator
     __del__ = lambda self : None;
     def _setCallbackInfo(*args, **kwargs):
-        """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
+        """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=0)"""
         return _gdi_.FontEnumerator__setCallbackInfo(*args, **kwargs)
 
     def EnumerateFacenames(*args, **kwargs):
         return _gdi_.FontEnumerator__setCallbackInfo(*args, **kwargs)
 
     def EnumerateFacenames(*args, **kwargs):
@@ -2873,7 +2873,7 @@ class PyLocale(Locale):
     def __init__(self, *args, **kwargs): 
         """__init__(self, int language=-1, int flags=wxLOCALE_LOAD_DEFAULT|wxLOCALE_CONV_ENCODING) -> PyLocale"""
         _gdi_.PyLocale_swiginit(self,_gdi_.new_PyLocale(*args, **kwargs))
     def __init__(self, *args, **kwargs): 
         """__init__(self, int language=-1, int flags=wxLOCALE_LOAD_DEFAULT|wxLOCALE_CONV_ENCODING) -> PyLocale"""
         _gdi_.PyLocale_swiginit(self,_gdi_.new_PyLocale(*args, **kwargs))
-        self._setCallbackInfo(self, PyLocale)
+        PyLocale._setCallbackInfo(self, self, PyLocale)
 
     __swig_destroy__ = _gdi_.delete_PyLocale
     __del__ = lambda self : None;
 
     __swig_destroy__ = _gdi_.delete_PyLocale
     __del__ = lambda self : None;
@@ -4823,7 +4823,11 @@ class BufferedDC(MemoryDC):
         Constructs a buffered DC.
         """
         _gdi_.BufferedDC_swiginit(self,_gdi_.new_BufferedDC(*args))
         Constructs a buffered DC.
         """
         _gdi_.BufferedDC_swiginit(self,_gdi_.new_BufferedDC(*args))
-        self.__dc = args[0] # save a ref so the other dc will not be deleted before self
+        # save a ref so the other dc will not be deleted before self
+        self.__dc = args[0] 
+        # also save a ref to the bitmap
+        if len(args) > 1: self.__bmp = args[1]
+
 
     __swig_destroy__ = _gdi_.delete_BufferedDC
     __del__ = lambda self : None;
 
     __swig_destroy__ = _gdi_.delete_BufferedDC
     __del__ = lambda self : None;
@@ -4880,6 +4884,8 @@ class BufferedPaintDC(BufferedDC):
         window is automatically used).
         """
         _gdi_.BufferedPaintDC_swiginit(self,_gdi_.new_BufferedPaintDC(*args, **kwargs))
         window is automatically used).
         """
         _gdi_.BufferedPaintDC_swiginit(self,_gdi_.new_BufferedPaintDC(*args, **kwargs))
+        if len(args) > 1: self.__bmp = args[1]
+
 _gdi_.BufferedPaintDC_swigregister(BufferedPaintDC)
 
 #---------------------------------------------------------------------------
 _gdi_.BufferedPaintDC_swigregister(BufferedPaintDC)
 
 #---------------------------------------------------------------------------
@@ -5494,6 +5500,17 @@ class GraphicsContext(GraphicsObject):
         return val
 
     Create = staticmethod(Create)
         return val
 
     Create = staticmethod(Create)
+    def CreateMeasuringContext(*args):
+        """
+        CreateMeasuringContext() -> GraphicsContext
+
+        Create a lightwieght context that can be used for measuring text only.
+        """
+        val = _gdi_.GraphicsContext_CreateMeasuringContext(*args)
+        val.__dc = args[0] # save a ref so the dc will not be deleted before self
+        return val
+
+    CreateMeasuringContext = staticmethod(CreateMeasuringContext)
     def CreateFromNative(*args, **kwargs):
         """
         CreateFromNative(void context) -> GraphicsContext
     def CreateFromNative(*args, **kwargs):
         """
         CreateFromNative(void context) -> GraphicsContext
@@ -5626,6 +5643,22 @@ class GraphicsContext(GraphicsObject):
         """
         return _gdi_.GraphicsContext_GetNativeContext(*args, **kwargs)
 
         """
         return _gdi_.GraphicsContext_GetNativeContext(*args, **kwargs)
 
+    def GetLogicalFunction(*args, **kwargs):
+        """
+        GetLogicalFunction(self) -> int
+
+        Returns the current logical function.
+        """
+        return _gdi_.GraphicsContext_GetLogicalFunction(*args, **kwargs)
+
+    def SetLogicalFunction(*args, **kwargs):
+        """
+        SetLogicalFunction(self, int function) -> bool
+
+        Sets the current logical function, returns ``True`` if it supported
+        """
+        return _gdi_.GraphicsContext_SetLogicalFunction(*args, **kwargs)
+
     def Translate(*args, **kwargs):
         """
         Translate(self, Double dx, Double dy)
     def Translate(*args, **kwargs):
         """
         Translate(self, Double dx, Double dy)
@@ -5729,17 +5762,18 @@ class GraphicsContext(GraphicsObject):
 
     def DrawText(*args, **kwargs):
         """
 
     def DrawText(*args, **kwargs):
         """
-        DrawText(self, String str, Double x, Double y)
+        DrawText(self, String str, Double x, Double y, GraphicsBrush backgroundBrush=NullGraphicsBrush)
 
 
-        Draws a text at the defined position.
+        Draws a text string at the defined position.
         """
         return _gdi_.GraphicsContext_DrawText(*args, **kwargs)
 
     def DrawRotatedText(*args, **kwargs):
         """
         """
         return _gdi_.GraphicsContext_DrawText(*args, **kwargs)
 
     def DrawRotatedText(*args, **kwargs):
         """
-        DrawRotatedText(self, String str, Double x, Double y, Double angle)
+        DrawRotatedText(self, String str, Double x, Double y, Double angle, GraphicsBrush backgroundBrush=NullGraphicsBrush)
 
 
-        Draws a text at the defined position, at the given angle.
+        Draws a text string at the defined position, at the specified angle,
+        which is given in radians.
         """
         return _gdi_.GraphicsContext_DrawRotatedText(*args, **kwargs)
 
         """
         return _gdi_.GraphicsContext_DrawRotatedText(*args, **kwargs)
 
@@ -5875,6 +5909,16 @@ def GraphicsContext_Create(*args):
   val.__dc = args[0] # save a ref so the dc will not be deleted before self
   return val
 
   val.__dc = args[0] # save a ref so the dc will not be deleted before self
   return val
 
+def GraphicsContext_CreateMeasuringContext(*args):
+  """
+    GraphicsContext_CreateMeasuringContext() -> GraphicsContext
+
+    Create a lightwieght context that can be used for measuring text only.
+    """
+  val = _gdi_.GraphicsContext_CreateMeasuringContext(*args)
+  val.__dc = args[0] # save a ref so the dc will not be deleted before self
+  return val
+
 def GraphicsContext_CreateFromNative(*args, **kwargs):
   """
     GraphicsContext_CreateFromNative(void context) -> GraphicsContext
 def GraphicsContext_CreateFromNative(*args, **kwargs):
   """
     GraphicsContext_CreateFromNative(void context) -> GraphicsContext
@@ -5912,6 +5956,10 @@ class GraphicsRenderer(_core.Object):
         """
         return _gdi_.GraphicsRenderer_CreateContext(*args)
 
         """
         return _gdi_.GraphicsRenderer_CreateContext(*args)
 
+    def CreateMeasuringContext(*args, **kwargs):
+        """CreateMeasuringContext(self) -> GraphicsContext"""
+        return _gdi_.GraphicsRenderer_CreateMeasuringContext(*args, **kwargs)
+
     def CreateContextFromNativeContext(*args, **kwargs):
         """CreateContextFromNativeContext(self, void context) -> GraphicsContext"""
         return _gdi_.GraphicsRenderer_CreateContextFromNativeContext(*args, **kwargs)
     def CreateContextFromNativeContext(*args, **kwargs):
         """CreateContextFromNativeContext(self, void context) -> GraphicsContext"""
         return _gdi_.GraphicsRenderer_CreateContextFromNativeContext(*args, **kwargs)
@@ -5967,9 +6015,12 @@ class GCDC(DC):
     """Proxy of C++ GCDC class"""
     thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
     __repr__ = _swig_repr
     """Proxy of C++ GCDC class"""
     thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
     __repr__ = _swig_repr
-    def __init__(self, *args, **kwargs): 
-        """__init__(self, WindowDC dc) -> GCDC"""
-        _gdi_.GCDC_swiginit(self,_gdi_.new_GCDC(*args, **kwargs))
+    def __init__(self, *args): 
+        """
+        __init__(self, WindowDC dc) -> GCDC
+        __init__(self, Window window) -> GCDC
+        """
+        _gdi_.GCDC_swiginit(self,_gdi_.new_GCDC(*args))
         self.__dc = args[0] # save a ref so the other dc will not be deleted before self
 
     __swig_destroy__ = _gdi_.delete_GCDC
         self.__dc = args[0] # save a ref so the other dc will not be deleted before self
 
     __swig_destroy__ = _gdi_.delete_GCDC
@@ -6638,17 +6689,17 @@ class RendererNative(object):
     def DrawHeaderButton(*args, **kwargs):
         """
         DrawHeaderButton(self, Window win, DC dc, Rect rect, int flags=0, int sortArrow=HDR_SORT_ICON_NONE, 
     def DrawHeaderButton(*args, **kwargs):
         """
         DrawHeaderButton(self, Window win, DC dc, Rect rect, int flags=0, int sortArrow=HDR_SORT_ICON_NONE, 
-            HeaderButtonParams params=None)
+            HeaderButtonParams params=None) -> int
 
 
-        Draw the header control button (such as what is used by `wx.ListCtrl`
-        in report mode.)
+        Draw a header control button (such as what is used by `wx.ListCtrl` in report
+        mode.)  The optimal size of the label (text and icons) is returned.
         """
         return _gdi_.RendererNative_DrawHeaderButton(*args, **kwargs)
 
     def DrawHeaderButtonContents(*args, **kwargs):
         """
         DrawHeaderButtonContents(self, Window win, DC dc, Rect rect, int flags=0, int sortArrow=HDR_SORT_ICON_NONE, 
         """
         return _gdi_.RendererNative_DrawHeaderButton(*args, **kwargs)
 
     def DrawHeaderButtonContents(*args, **kwargs):
         """
         DrawHeaderButtonContents(self, Window win, DC dc, Rect rect, int flags=0, int sortArrow=HDR_SORT_ICON_NONE, 
-            HeaderButtonParams params=None)
+            HeaderButtonParams params=None) -> int
 
         Draw the contents of a header control button, (label, sort
         arrows, etc.)  Normally this is only called by `DrawHeaderButton`.
 
         Draw the contents of a header control button, (label, sort
         arrows, etc.)  Normally this is only called by `DrawHeaderButton`.