]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/_gdi.py
Added wxEXEC_NODISABLE flag
[wxWidgets.git] / wxPython / src / msw / _gdi.py
index 52bab55394c565b193293e6fda6d372ee8e34471..82eaab8ef1a7a6ff64d4498625863ca6e4679ce0 100644 (file)
@@ -246,9 +246,13 @@ class Palette(GDIObject):
         return _gdi_.Palette_GetPixel(*args, **kwargs)
 
     def GetRGB(*args, **kwargs):
-        """GetRGB(int pixel) -> (R,G,B)"""
+        """GetRGB(self, int pixel) -> (R,G,B)"""
         return _gdi_.Palette_GetRGB(*args, **kwargs)
 
+    def GetColoursCount(*args, **kwargs):
+        """GetColoursCount(self) -> int"""
+        return _gdi_.Palette_GetColoursCount(*args, **kwargs)
+
     def Ok(*args, **kwargs):
         """Ok(self) -> bool"""
         return _gdi_.Palette_Ok(*args, **kwargs)
@@ -447,6 +451,14 @@ class Brush(GDIObject):
         """
         return _gdi_.Brush_GetStipple(*args, **kwargs)
 
+    def IsHatch(*args, **kwargs):
+        """
+        IsHatch(self) -> bool
+
+        Is the current style a hatch type?
+        """
+        return _gdi_.Brush_IsHatch(*args, **kwargs)
+
     def Ok(*args, **kwargs):
         """
         Ok(self) -> bool
@@ -491,10 +503,6 @@ class Bitmap(GDIObject):
             if self.thisown: destroy(self)
         except: pass
 
-    def SetPalette(*args, **kwargs):
-        """SetPalette(self, Palette palette)"""
-        return _gdi_.Bitmap_SetPalette(*args, **kwargs)
-
     def GetHandle(*args, **kwargs):
         """GetHandle(self) -> long"""
         return _gdi_.Bitmap_GetHandle(*args, **kwargs)
@@ -609,6 +617,14 @@ class Bitmap(GDIObject):
         """
         return _gdi_.Bitmap_LoadFile(*args, **kwargs)
 
+    def GetPalette(*args, **kwargs):
+        """GetPalette(self) -> Palette"""
+        return _gdi_.Bitmap_GetPalette(*args, **kwargs)
+
+    def SetPalette(*args, **kwargs):
+        """SetPalette(self, Palette palette)"""
+        return _gdi_.Bitmap_SetPalette(*args, **kwargs)
+
     def CopyFromIcon(*args, **kwargs):
         """CopyFromIcon(self, Icon icon) -> bool"""
         return _gdi_.Bitmap_CopyFromIcon(*args, **kwargs)
@@ -1435,6 +1451,10 @@ class NativeFontInfo(object):
         """GetPointSize(self) -> int"""
         return _gdi_.NativeFontInfo_GetPointSize(*args, **kwargs)
 
+    def GetPixelSize(*args, **kwargs):
+        """GetPixelSize(self) -> Size"""
+        return _gdi_.NativeFontInfo_GetPixelSize(*args, **kwargs)
+
     def GetStyle(*args, **kwargs):
         """GetStyle(self) -> int"""
         return _gdi_.NativeFontInfo_GetStyle(*args, **kwargs)
@@ -1463,6 +1483,10 @@ class NativeFontInfo(object):
         """SetPointSize(self, int pointsize)"""
         return _gdi_.NativeFontInfo_SetPointSize(*args, **kwargs)
 
+    def SetPixelSize(*args, **kwargs):
+        """SetPixelSize(self, Size pixelSize)"""
+        return _gdi_.NativeFontInfo_SetPixelSize(*args, **kwargs)
+
     def SetStyle(*args, **kwargs):
         """SetStyle(self, int style)"""
         return _gdi_.NativeFontInfo_SetStyle(*args, **kwargs)
@@ -1720,6 +1744,14 @@ class Font(GDIObject):
         """GetPointSize(self) -> int"""
         return _gdi_.Font_GetPointSize(*args, **kwargs)
 
+    def GetPixelSize(*args, **kwargs):
+        """GetPixelSize(self) -> Size"""
+        return _gdi_.Font_GetPixelSize(*args, **kwargs)
+
+    def IsUsingSizeInPixels(*args, **kwargs):
+        """IsUsingSizeInPixels(self) -> bool"""
+        return _gdi_.Font_IsUsingSizeInPixels(*args, **kwargs)
+
     def GetFamily(*args, **kwargs):
         """GetFamily(self) -> int"""
         return _gdi_.Font_GetFamily(*args, **kwargs)
@@ -1764,6 +1796,10 @@ class Font(GDIObject):
         """SetPointSize(self, int pointSize)"""
         return _gdi_.Font_SetPointSize(*args, **kwargs)
 
+    def SetPixelSize(*args, **kwargs):
+        """SetPixelSize(self, Size pixelSize)"""
+        return _gdi_.Font_SetPixelSize(*args, **kwargs)
+
     def SetFamily(*args, **kwargs):
         """SetFamily(self, int family)"""
         return _gdi_.Font_SetFamily(*args, **kwargs)
@@ -1862,6 +1898,17 @@ def Font2(*args, **kwargs):
     val.thisown = 1
     return val
 
+def FontFromPixelSize(*args, **kwargs):
+    """
+    FontFromPixelSize(Size pixelSize, int family, int style, int weight, 
+        bool underlined=False, String face=wxEmptyString, 
+        int encoding=FONTENCODING_DEFAULT) -> Font
+    """
+    if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']
+    val = _gdi_.new_FontFromPixelSize(*args, **kwargs)
+    val.thisown = 1
+    return val
+
 def Font_GetDefaultEncoding(*args, **kwargs):
     """Font_GetDefaultEncoding() -> int"""
     return _gdi_.Font_GetDefaultEncoding(*args, **kwargs)
@@ -2408,8 +2455,8 @@ def EncodingConverter_CanConvert(*args, **kwargs):
 # to the default catalog path.
 if wx.Platform == "__WXMSW__":
     import os
-    localedir = os.path.join(os.path.split(__file__)[0], "locale")
-    Locale_AddCatalogLookupPathPrefix(localedir)
+    _localedir = os.path.join(os.path.split(__file__)[0], "locale")
+    Locale.AddCatalogLookupPathPrefix(_localedir)
     del os
 
 #----------------------------------------------------------------------------
@@ -3596,31 +3643,24 @@ class DC(_core.Object):
         """
         return _gdi_.DC_SetLogicalFunction(*args, **kwargs)
 
-    def SetOptimization(*args, **kwargs):
+    def ComputeScaleAndOrigin(*args, **kwargs):
         """
-        SetOptimization(self, bool optimize)
+        ComputeScaleAndOrigin(self)
 
-        If *optimize* is true this function sets optimization mode on. This
-        currently means that under X, the device context will not try to set a
-        pen or brush property if it is known to be set already. This approach
-        can fall down if non-wxWidgets code is using the same device context
-        or window, for example when the window is a panel on which the
-        windowing system draws panel items. The wxWidgets device context
-        'memory' will now be out of step with reality.
+        Performs all necessary computations for given platform and context
+        type after each change of scale and origin parameters. Usually called
+        automatically internally after such changes.
 
-        Setting optimization off, drawing, then setting it back on again, is a
-        trick that must occasionally be employed.
         """
-        return _gdi_.DC_SetOptimization(*args, **kwargs)
+        return _gdi_.DC_ComputeScaleAndOrigin(*args, **kwargs)
 
-    def GetOptimization(*args, **kwargs):
-        """
-        GetOptimization(self) -> bool
+    def SetOptimization(self, optimize):
+        pass
+    def GetOptimization(self):
+        return False
 
-        Returns true if device context optimization is on. See
-        `SetOptimization` for .
-        """
-        return _gdi_.DC_GetOptimization(*args, **kwargs)
+    SetOptimization = wx._deprecated(SetOptimization)
+    GetOptimization = wx._deprecated(GetOptimization)
 
     def CalcBoundingBox(*args, **kwargs):
         """