X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fef4c27a1c5467c2ad291d2cff14eabd9c5b1d3b..9037d43c673a67d7b6b77b139f8ee8f3c278e3a4:/wxPython/src/mac/_gdi.py?ds=sidebyside diff --git a/wxPython/src/mac/_gdi.py b/wxPython/src/mac/_gdi.py index e0095bcd09..cecd234e41 100644 --- a/wxPython/src/mac/_gdi.py +++ b/wxPython/src/mac/_gdi.py @@ -1,4 +1,4 @@ -# This file was created automatically by SWIG. +# This file was created automatically by SWIG 1.3.27. # Don't modify this file, modify the SWIG interface instead. import _gdi_ @@ -93,13 +93,15 @@ class Colour(_core.Object): window colours, etc. Valid RGB values are in the range 0 to 255. In wxPython there are typemaps that will automatically convert from a - colour name, or from a '#RRGGBB' colour hex value string to a - wx.Colour object when calling C++ methods that expect a wxColour. - This means that the following are all equivallent:: + colour name, from a '#RRGGBB' colour hex value string, or from a 3 + integer tuple to a wx.Colour object when calling C++ methods that + expect a wxColour. This means that the following are all + equivallent:: win.SetBackgroundColour(wxColour(0,0,255)) win.SetBackgroundColour('BLUE') win.SetBackgroundColour('#0000FF') + win.SetBackgroundColour((0,0,255)) Additional colour names and their coresponding values can be added using `wx.ColourDatabase`. Various system colours (as set in the @@ -516,6 +518,16 @@ class BrushPtr(Brush): self.__class__ = Brush _gdi_.Brush_swigregister(BrushPtr) +def BrushFromBitmap(*args, **kwargs): + """ + BrushFromBitmap(Bitmap stippleBitmap) -> Brush + + Constructs a stippled brush using a bitmap. + """ + val = _gdi_.new_BrushFromBitmap(*args, **kwargs) + val.thisown = 1 + return val + class Bitmap(GDIObject): """ The wx.Bitmap class encapsulates the concept of a platform-dependent @@ -1039,7 +1051,7 @@ def CursorFromImage(*args, **kwargs): CursorFromImage(Image image) -> Cursor Constructs a cursor from a `wx.Image`. The mask (if any) will be used - as transparent. + for setting the transparent portions of the cursor. """ val = _gdi_.new_CursorFromImage(*args, **kwargs) val.thisown = 1 @@ -1587,10 +1599,6 @@ class FontMapper(object): return _gdi_.FontMapper_GetEncodingFromName(*args, **kwargs) GetEncodingFromName = staticmethod(GetEncodingFromName) - def SetConfig(*args, **kwargs): - """SetConfig(self, ConfigBase config)""" - return _gdi_.FontMapper_SetConfig(*args, **kwargs) - def SetConfigPath(*args, **kwargs): """SetConfigPath(self, String prefix)""" return _gdi_.FontMapper_SetConfigPath(*args, **kwargs) @@ -1659,7 +1667,13 @@ def FontMapper_GetDefaultConfigPath(*args, **kwargs): #--------------------------------------------------------------------------- class Font(GDIObject): - """Proxy of C++ Font class""" + """ + A font is an object which determines the appearance of text. Fonts are + used for drawing text to a device context, and setting the appearance + of a window's text. + + You can retrieve the current system font settings with `wx.SystemSettings`. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxFont instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -1667,6 +1681,35 @@ class Font(GDIObject): __init__(self, int pointSize, int family, int style, int weight, bool underline=False, String face=EmptyString, int encoding=FONTENCODING_DEFAULT) -> Font + + Creates a font object with the specified attributes. + + :param pointSize: The size of the font in points. + + :param family: Font family. A generic way of referring to fonts + without specifying actual facename. It can be One of + the ``wx.FONTFAMILY_xxx`` constants. + + :param style: One of the ``wx.FONTSTYLE_xxx`` constants. + + :param weight: Font weight, sometimes also referred to as font + boldness. One of the ``wx.FONTWEIGHT_xxx`` constants. + + :param underline: The value can be ``True`` or ``False`` and + indicates whether the font will include an underline. This + may not be supported on all platforms. + + :param face: An optional string specifying the actual typeface to + be used. If it is an empty string, a default typeface will be + chosen based on the family. + + :param encoding: An encoding which may be one of the + ``wx.FONTENCODING_xxx`` constants. If the specified encoding isn't + available, no font is created. + + :see: `wx.FFont`, `wx.FontFromPixelSize`, `wx.FFontFromPixelSize`, + `wx.FontFromNativeInfoString`, `wx.FontFromNativeInfo` + """ if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName'] newobj = _gdi_.new_Font(*args, **kwargs) @@ -1680,7 +1723,11 @@ class Font(GDIObject): except: pass def Ok(*args, **kwargs): - """Ok(self) -> bool""" + """ + Ok(self) -> bool + + Returns ``True`` if this font was successfully created. + """ return _gdi_.Font_Ok(*args, **kwargs) def __nonzero__(self): return self.Ok() @@ -1693,111 +1740,234 @@ class Font(GDIObject): return _gdi_.Font___ne__(*args, **kwargs) def GetPointSize(*args, **kwargs): - """GetPointSize(self) -> int""" + """ + GetPointSize(self) -> int + + Gets the point size. + """ return _gdi_.Font_GetPointSize(*args, **kwargs) def GetPixelSize(*args, **kwargs): - """GetPixelSize(self) -> Size""" + """ + GetPixelSize(self) -> Size + + Returns the size in pixels if the font was constructed with a pixel + size. + """ return _gdi_.Font_GetPixelSize(*args, **kwargs) def IsUsingSizeInPixels(*args, **kwargs): - """IsUsingSizeInPixels(self) -> bool""" + """ + IsUsingSizeInPixels(self) -> bool + + Returns ``True`` if the font is using a pixelSize. + """ return _gdi_.Font_IsUsingSizeInPixels(*args, **kwargs) def GetFamily(*args, **kwargs): - """GetFamily(self) -> int""" + """ + GetFamily(self) -> int + + Gets the font family. + """ return _gdi_.Font_GetFamily(*args, **kwargs) def GetStyle(*args, **kwargs): - """GetStyle(self) -> int""" + """ + GetStyle(self) -> int + + Gets the font style. + """ return _gdi_.Font_GetStyle(*args, **kwargs) def GetWeight(*args, **kwargs): - """GetWeight(self) -> int""" + """ + GetWeight(self) -> int + + Gets the font weight. + """ return _gdi_.Font_GetWeight(*args, **kwargs) def GetUnderlined(*args, **kwargs): - """GetUnderlined(self) -> bool""" + """ + GetUnderlined(self) -> bool + + Returns ``True`` if the font is underlined, ``False`` otherwise. + """ return _gdi_.Font_GetUnderlined(*args, **kwargs) def GetFaceName(*args, **kwargs): - """GetFaceName(self) -> String""" + """ + GetFaceName(self) -> String + + Returns the typeface name associated with the font, or the empty + string if there is no typeface information. + """ return _gdi_.Font_GetFaceName(*args, **kwargs) def GetEncoding(*args, **kwargs): - """GetEncoding(self) -> int""" + """ + GetEncoding(self) -> int + + Get the font's encoding. + """ return _gdi_.Font_GetEncoding(*args, **kwargs) def GetNativeFontInfo(*args, **kwargs): - """GetNativeFontInfo(self) -> NativeFontInfo""" + """ + GetNativeFontInfo(self) -> NativeFontInfo + + Constructs a `wx.NativeFontInfo` object from this font. + """ return _gdi_.Font_GetNativeFontInfo(*args, **kwargs) def IsFixedWidth(*args, **kwargs): - """IsFixedWidth(self) -> bool""" + """ + IsFixedWidth(self) -> bool + + Returns true if the font is a fixed width (or monospaced) font, false + if it is a proportional one or font is invalid. + """ return _gdi_.Font_IsFixedWidth(*args, **kwargs) def GetNativeFontInfoDesc(*args, **kwargs): - """GetNativeFontInfoDesc(self) -> String""" + """ + GetNativeFontInfoDesc(self) -> String + + Returns the platform-dependent string completely describing this font + or an empty string if the font isn't valid. + """ return _gdi_.Font_GetNativeFontInfoDesc(*args, **kwargs) def GetNativeFontInfoUserDesc(*args, **kwargs): - """GetNativeFontInfoUserDesc(self) -> String""" + """ + GetNativeFontInfoUserDesc(self) -> String + + Returns a human readable version of `GetNativeFontInfoDesc`. + """ return _gdi_.Font_GetNativeFontInfoUserDesc(*args, **kwargs) def SetPointSize(*args, **kwargs): - """SetPointSize(self, int pointSize)""" + """ + SetPointSize(self, int pointSize) + + Sets the point size. + """ return _gdi_.Font_SetPointSize(*args, **kwargs) def SetPixelSize(*args, **kwargs): - """SetPixelSize(self, Size pixelSize)""" + """ + SetPixelSize(self, Size pixelSize) + + Sets the size in pixels rather than points. If there is platform API + support for this then it is used, otherwise a font with the closest + size is found using a binary search. + """ return _gdi_.Font_SetPixelSize(*args, **kwargs) def SetFamily(*args, **kwargs): - """SetFamily(self, int family)""" + """ + SetFamily(self, int family) + + Sets the font family. + """ return _gdi_.Font_SetFamily(*args, **kwargs) def SetStyle(*args, **kwargs): - """SetStyle(self, int style)""" + """ + SetStyle(self, int style) + + Sets the font style. + """ return _gdi_.Font_SetStyle(*args, **kwargs) def SetWeight(*args, **kwargs): - """SetWeight(self, int weight)""" + """ + SetWeight(self, int weight) + + Sets the font weight. + """ return _gdi_.Font_SetWeight(*args, **kwargs) def SetFaceName(*args, **kwargs): - """SetFaceName(self, String faceName)""" + """ + SetFaceName(self, String faceName) + + Sets the facename for the font. The facename, which should be a valid + font installed on the end-user's system. + + To avoid portability problems, don't rely on a specific face, but + specify the font family instead or as well. A suitable font will be + found on the end-user's system. If both the family and the facename + are specified, wxWidgets will first search for the specific face, and + then for a font belonging to the same family. + """ return _gdi_.Font_SetFaceName(*args, **kwargs) def SetUnderlined(*args, **kwargs): - """SetUnderlined(self, bool underlined)""" + """ + SetUnderlined(self, bool underlined) + + Sets underlining. + """ return _gdi_.Font_SetUnderlined(*args, **kwargs) def SetEncoding(*args, **kwargs): - """SetEncoding(self, int encoding)""" + """ + SetEncoding(self, int encoding) + + Set the font encoding. + """ return _gdi_.Font_SetEncoding(*args, **kwargs) def SetNativeFontInfo(*args, **kwargs): - """SetNativeFontInfo(self, NativeFontInfo info)""" + """ + SetNativeFontInfo(self, NativeFontInfo info) + + Set the font's attributes from a `wx.NativeFontInfo` object. + """ return _gdi_.Font_SetNativeFontInfo(*args, **kwargs) def SetNativeFontInfoFromString(*args, **kwargs): - """SetNativeFontInfoFromString(self, String info)""" + """ + SetNativeFontInfoFromString(self, String info) + + Set the font's attributes from string representation of a + `wx.NativeFontInfo` object. + """ return _gdi_.Font_SetNativeFontInfoFromString(*args, **kwargs) def SetNativeFontInfoUserDesc(*args, **kwargs): - """SetNativeFontInfoUserDesc(self, String info)""" + """ + SetNativeFontInfoUserDesc(self, String info) + + Set the font's attributes from a string formerly returned from + `GetNativeFontInfoDesc`. + """ return _gdi_.Font_SetNativeFontInfoUserDesc(*args, **kwargs) def GetFamilyString(*args, **kwargs): - """GetFamilyString(self) -> String""" + """ + GetFamilyString(self) -> String + + Returns a string representation of the font family. + """ return _gdi_.Font_GetFamilyString(*args, **kwargs) def GetStyleString(*args, **kwargs): - """GetStyleString(self) -> String""" + """ + GetStyleString(self) -> String + + Returns a string representation of the font style. + """ return _gdi_.Font_GetStyleString(*args, **kwargs) def GetWeightString(*args, **kwargs): - """GetWeightString(self) -> String""" + """ + GetWeightString(self) -> String + + Return a string representation of the font weight. + """ return _gdi_.Font_GetWeightString(*args, **kwargs) def SetNoAntiAliasing(*args, **kwargs): @@ -1809,12 +1979,21 @@ class Font(GDIObject): return _gdi_.Font_GetNoAntiAliasing(*args, **kwargs) def GetDefaultEncoding(*args, **kwargs): - """GetDefaultEncoding() -> int""" + """ + GetDefaultEncoding() -> int + + Returns the encoding used for all fonts created with an encoding of + ``wx.FONTENCODING_DEFAULT``. + """ return _gdi_.Font_GetDefaultEncoding(*args, **kwargs) GetDefaultEncoding = staticmethod(GetDefaultEncoding) def SetDefaultEncoding(*args, **kwargs): - """SetDefaultEncoding(int encoding)""" + """ + SetDefaultEncoding(int encoding) + + Sets the default font encoding. + """ return _gdi_.Font_SetDefaultEncoding(*args, **kwargs) SetDefaultEncoding = staticmethod(SetDefaultEncoding) @@ -1827,26 +2006,53 @@ class FontPtr(Font): _gdi_.Font_swigregister(FontPtr) def FontFromNativeInfo(*args, **kwargs): - """FontFromNativeInfo(NativeFontInfo info) -> Font""" + """ + FontFromNativeInfo(NativeFontInfo info) -> Font + + Construct a `wx.Font` from a `wx.NativeFontInfo` object. + """ if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName'] val = _gdi_.new_FontFromNativeInfo(*args, **kwargs) val.thisown = 1 return val def FontFromNativeInfoString(*args, **kwargs): - """FontFromNativeInfoString(String info) -> Font""" + """ + FontFromNativeInfoString(String info) -> Font + + Construct a `wx.Font` from the string representation of a + `wx.NativeFontInfo` object. + """ if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName'] val = _gdi_.new_FontFromNativeInfoString(*args, **kwargs) val.thisown = 1 return val -def Font2(*args, **kwargs): +def FFont(*args, **kwargs): """ - Font2(int pointSize, int family, int flags=FONTFLAG_DEFAULT, + FFont(int pointSize, int family, int flags=FONTFLAG_DEFAULT, String face=EmptyString, int encoding=FONTENCODING_DEFAULT) -> Font + + A bit of a simpler way to create a `wx.Font` using flags instead of + individual attribute settings. The value of flags can be a + combination of the following: + + ============================ == + wx.FONTFLAG_DEFAULT + wx.FONTFLAG_ITALIC + wx.FONTFLAG_SLANT + wx.FONTFLAG_LIGHT + wx.FONTFLAG_BOLD + wx.FONTFLAG_ANTIALIASED + wx.FONTFLAG_NOT_ANTIALIASED + wx.FONTFLAG_UNDERLINED + wx.FONTFLAG_STRIKETHROUGH + ============================ == + + :see: `wx.Font.__init__` """ if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName'] - val = _gdi_.new_Font2(*args, **kwargs) + val = _gdi_.new_FFont(*args, **kwargs) val.thisown = 1 return val @@ -1855,20 +2061,52 @@ def FontFromPixelSize(*args, **kwargs): FontFromPixelSize(Size pixelSize, int family, int style, int weight, bool underlined=False, String face=wxEmptyString, int encoding=FONTENCODING_DEFAULT) -> Font + + Creates a font using a size in pixels rather than points. If there is + platform API support for this then it is used, otherwise a font with + the closest size is found using a binary search. + + :see: `wx.Font.__init__` """ if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName'] val = _gdi_.new_FontFromPixelSize(*args, **kwargs) val.thisown = 1 return val +def FFontFromPixelSize(*args, **kwargs): + """ + FFontFromPixelSize(Size pixelSize, int family, int flags=FONTFLAG_DEFAULT, + String face=wxEmptyString, int encoding=FONTENCODING_DEFAULT) -> Font + + Creates a font using a size in pixels rather than points. If there is + platform API support for this then it is used, otherwise a font with + the closest size is found using a binary search. + + :see: `wx.Font.__init__`, `wx.FFont` + """ + if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName'] + val = _gdi_.new_FFontFromPixelSize(*args, **kwargs) + val.thisown = 1 + return val + def Font_GetDefaultEncoding(*args, **kwargs): - """Font_GetDefaultEncoding() -> int""" + """ + Font_GetDefaultEncoding() -> int + + Returns the encoding used for all fonts created with an encoding of + ``wx.FONTENCODING_DEFAULT``. + """ return _gdi_.Font_GetDefaultEncoding(*args, **kwargs) def Font_SetDefaultEncoding(*args, **kwargs): - """Font_SetDefaultEncoding(int encoding)""" + """ + Font_SetDefaultEncoding(int encoding) + + Sets the default font encoding. + """ return _gdi_.Font_SetDefaultEncoding(*args, **kwargs) +Font2 = wx._deprecated(FFont, "Use `wx.FFont` instead.") #--------------------------------------------------------------------------- class FontEnumerator(object): @@ -3219,7 +3457,7 @@ class DC(_core.Object): *text*. The generic version simply builds a running total of the widths of each character using GetTextExtent, however if the various platforms have a native API function that is faster or more accurate - than the generic implementaiton then it will be used instead. + than the generic implementation then it will be used instead. """ return _gdi_.DC_GetPartialTextExtents(*args, **kwargs) @@ -3949,6 +4187,8 @@ def MemoryDCFromDC(*args, **kwargs): #--------------------------------------------------------------------------- +BUFFER_VIRTUAL_AREA = _gdi_.BUFFER_VIRTUAL_AREA +BUFFER_CLIENT_AREA = _gdi_.BUFFER_CLIENT_AREA class BufferedDC(MemoryDC): """ This simple class provides a simple way to avoid flicker: when drawing @@ -3966,7 +4206,10 @@ class BufferedDC(MemoryDC): return "<%s.%s; proxy of C++ wxBufferedDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args): """ - __init__(self, DC dc, Bitmap buffer) -> BufferedDC + __init__(self, DC dc, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedDC + __init__(self, DC dc, Bitmap buffer=NullBitmap) -> BufferedDC + __init__(self, DC dc) -> BufferedDC + __init__(self, DC dc, Size area, int style=BUFFER_CLIENT_AREA) -> BufferedDC __init__(self, DC dc, Size area) -> BufferedDC Constructs a buffered DC. @@ -4026,12 +4269,14 @@ class BufferedPaintDC(BufferedDC): + + """ def __repr__(self): return "<%s.%s; proxy of C++ wxBufferedPaintDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ - __init__(self, Window window, Bitmap buffer=NullBitmap) -> BufferedPaintDC + __init__(self, Window window, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedPaintDC Create a buffered paint DC. As with `wx.BufferedDC`, you may either provide the bitmap to be used for buffering or let this object create @@ -4458,6 +4703,14 @@ class ImageList(_core.Object): """AddIcon(self, Icon icon) -> int""" return _gdi_.ImageList_AddIcon(*args, **kwargs) + def GetBitmap(*args, **kwargs): + """GetBitmap(self, int index) -> Bitmap""" + return _gdi_.ImageList_GetBitmap(*args, **kwargs) + + def GetIcon(*args, **kwargs): + """GetIcon(self, int index) -> Icon""" + return _gdi_.ImageList_GetIcon(*args, **kwargs) + def Replace(*args, **kwargs): """Replace(self, int index, Bitmap bitmap) -> bool""" return _gdi_.ImageList_Replace(*args, **kwargs) @@ -4577,7 +4830,7 @@ class BrushList(_core.Object): return _gdi_.BrushList_AddBrush(*args, **kwargs) def FindOrCreateBrush(*args, **kwargs): - """FindOrCreateBrush(self, Colour colour, int style) -> Brush""" + """FindOrCreateBrush(self, Colour colour, int style=SOLID) -> Brush""" return _gdi_.BrushList_FindOrCreateBrush(*args, **kwargs) def RemoveBrush(*args, **kwargs): @@ -4752,4 +5005,304 @@ ThePenList = cvar.ThePenList TheBrushList = cvar.TheBrushList TheColourDatabase = cvar.TheColourDatabase +#--------------------------------------------------------------------------- + +CONTROL_DISABLED = _gdi_.CONTROL_DISABLED +CONTROL_FOCUSED = _gdi_.CONTROL_FOCUSED +CONTROL_PRESSED = _gdi_.CONTROL_PRESSED +CONTROL_ISDEFAULT = _gdi_.CONTROL_ISDEFAULT +CONTROL_ISSUBMENU = _gdi_.CONTROL_ISSUBMENU +CONTROL_EXPANDED = _gdi_.CONTROL_EXPANDED +CONTROL_CURRENT = _gdi_.CONTROL_CURRENT +CONTROL_SELECTED = _gdi_.CONTROL_SELECTED +CONTROL_CHECKED = _gdi_.CONTROL_CHECKED +CONTROL_CHECKABLE = _gdi_.CONTROL_CHECKABLE +CONTROL_UNDETERMINED = _gdi_.CONTROL_UNDETERMINED +CONTROL_FLAGS_MASK = _gdi_.CONTROL_FLAGS_MASK +CONTROL_DIRTY = _gdi_.CONTROL_DIRTY +class SplitterRenderParams(object): + """ + This is just a simple struct used as a return value of + `wx.RendererNative.GetSplitterParams` and contains some platform + specific metrics about splitters. + + * widthSash: the width of the splitter sash. + * border: the width of the border of the splitter window. + * isHotSensitive: ``True`` if the splitter changes its + appearance when the mouse is over it. + + + """ + def __repr__(self): + return "<%s.%s; proxy of C++ wxSplitterRenderParams instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __init__(self, *args, **kwargs): + """ + __init__(self, int widthSash_, int border_, bool isSens_) -> SplitterRenderParams + + This is just a simple struct used as a return value of + `wx.RendererNative.GetSplitterParams` and contains some platform + specific metrics about splitters. + + * widthSash: the width of the splitter sash. + * border: the width of the border of the splitter window. + * isHotSensitive: ``True`` if the splitter changes its + appearance when the mouse is over it. + + + """ + newobj = _gdi_.new_SplitterRenderParams(*args, **kwargs) + self.this = newobj.this + self.thisown = 1 + del newobj.thisown + def __del__(self, destroy=_gdi_.delete_SplitterRenderParams): + """__del__(self)""" + try: + if self.thisown: destroy(self) + except: pass + + widthSash = property(_gdi_.SplitterRenderParams_widthSash_get) + border = property(_gdi_.SplitterRenderParams_border_get) + isHotSensitive = property(_gdi_.SplitterRenderParams_isHotSensitive_get) + +class SplitterRenderParamsPtr(SplitterRenderParams): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = SplitterRenderParams +_gdi_.SplitterRenderParams_swigregister(SplitterRenderParamsPtr) + +class RendererVersion(object): + """ + This simple struct represents the `wx.RendererNative` interface + version and is only used as the return value of + `wx.RendererNative.GetVersion`. + """ + def __repr__(self): + return "<%s.%s; proxy of C++ wxRendererVersion instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __init__(self, *args, **kwargs): + """ + __init__(self, int version_, int age_) -> RendererVersion + + This simple struct represents the `wx.RendererNative` interface + version and is only used as the return value of + `wx.RendererNative.GetVersion`. + """ + newobj = _gdi_.new_RendererVersion(*args, **kwargs) + self.this = newobj.this + self.thisown = 1 + del newobj.thisown + def __del__(self, destroy=_gdi_.delete_RendererVersion): + """__del__(self)""" + try: + if self.thisown: destroy(self) + except: pass + + Current_Version = _gdi_.RendererVersion_Current_Version + Current_Age = _gdi_.RendererVersion_Current_Age + def IsCompatible(*args, **kwargs): + """IsCompatible(RendererVersion ver) -> bool""" + return _gdi_.RendererVersion_IsCompatible(*args, **kwargs) + + IsCompatible = staticmethod(IsCompatible) + version = property(_gdi_.RendererVersion_version_get) + age = property(_gdi_.RendererVersion_age_get) + +class RendererVersionPtr(RendererVersion): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = RendererVersion +_gdi_.RendererVersion_swigregister(RendererVersionPtr) + +def RendererVersion_IsCompatible(*args, **kwargs): + """RendererVersion_IsCompatible(RendererVersion ver) -> bool""" + return _gdi_.RendererVersion_IsCompatible(*args, **kwargs) + +class RendererNative(object): + """ + One of the design principles of wxWidgets is to use the native widgets + on every platform in order to be as close to the native look and feel + on every platform. However there are still cases when some generic + widgets are needed for various reasons, but it can sometimes take a + lot of messy work to make them conform to the native LnF. + + The wx.RendererNative class is a collection of functions that have + platform-specific implementations for drawing certain parts of + genereic controls in ways that are as close to the native look as + possible. + + """ + def __init__(self): raise RuntimeError, "No constructor defined" + def __repr__(self): + return "<%s.%s; proxy of C++ wxRendererNative instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def DrawHeaderButton(*args, **kwargs): + """ + DrawHeaderButton(self, Window win, DC dc, Rect rect, int flags=0) + + Draw the header control button (such as whar is used by `wx.ListCtrl` + in report mode.) + """ + return _gdi_.RendererNative_DrawHeaderButton(*args, **kwargs) + + def DrawTreeItemButton(*args, **kwargs): + """ + DrawTreeItemButton(self, Window win, DC dc, Rect rect, int flags=0) + + Draw the expanded/collapsed icon for a tree control item. + """ + return _gdi_.RendererNative_DrawTreeItemButton(*args, **kwargs) + + def DrawSplitterBorder(*args, **kwargs): + """ + DrawSplitterBorder(self, Window win, DC dc, Rect rect, int flags=0) + + Draw the border for a sash window: this border must be such that the + sash drawn by `DrawSplitterSash` blends into it well. + """ + return _gdi_.RendererNative_DrawSplitterBorder(*args, **kwargs) + + def DrawSplitterSash(*args, **kwargs): + """ + DrawSplitterSash(self, Window win, DC dc, Size size, int position, int orient, + int flags=0) + + Draw a sash. The orient parameter defines whether the sash should be + vertical or horizontal and how the position should be interpreted. + """ + return _gdi_.RendererNative_DrawSplitterSash(*args, **kwargs) + + def DrawComboBoxDropButton(*args, **kwargs): + """ + DrawComboBoxDropButton(self, Window win, DC dc, Rect rect, int flags=0) + + Draw a button like the one used by `wx.ComboBox` to show a drop down + window. The usual appearance is a downwards pointing arrow. + + The ``flags`` parameter may have the ``wx.CONTROL_PRESSED`` or + ``wx.CONTROL_CURRENT`` bits set. + """ + return _gdi_.RendererNative_DrawComboBoxDropButton(*args, **kwargs) + + def DrawDropArrow(*args, **kwargs): + """ + DrawDropArrow(self, Window win, DC dc, Rect rect, int flags=0) + + Draw a drop down arrow that is suitable for use outside a combo + box. Arrow will have a transparent background. + + ``rect`` is not entirely filled by the arrow. Instead, you should use + bounding rectangle of a drop down button which arrow matches the size + you need. ``flags`` may have the ``wx.CONTROL_PRESSED`` or + ``wx.CONTROL_CURRENT`` bit set. + """ + return _gdi_.RendererNative_DrawDropArrow(*args, **kwargs) + + def GetSplitterParams(*args, **kwargs): + """ + GetSplitterParams(self, Window win) -> SplitterRenderParams + + Get the splitter parameters, see `wx.SplitterRenderParams`. + """ + return _gdi_.RendererNative_GetSplitterParams(*args, **kwargs) + + def Get(*args, **kwargs): + """ + Get() -> RendererNative + + Return the currently used renderer + """ + return _gdi_.RendererNative_Get(*args, **kwargs) + + Get = staticmethod(Get) + def GetGeneric(*args, **kwargs): + """ + GetGeneric() -> RendererNative + + Return the generic implementation of the renderer. Under some + platforms, this is the default renderer implementation, others have + platform-specific default renderer which can be retrieved by calling + `GetDefault`. + """ + return _gdi_.RendererNative_GetGeneric(*args, **kwargs) + + GetGeneric = staticmethod(GetGeneric) + def GetDefault(*args, **kwargs): + """ + GetDefault() -> RendererNative + + Return the default (native) implementation for this platform -- this + is also the one used by default but this may be changed by calling `Set` + in which case the return value of this method may be different from + the return value of `Get`. + """ + return _gdi_.RendererNative_GetDefault(*args, **kwargs) + + GetDefault = staticmethod(GetDefault) + def Set(*args, **kwargs): + """ + Set(RendererNative renderer) -> RendererNative + + Set the renderer to use, passing None reverts to using the default + renderer. Returns the previous renderer used with Set or None. + """ + return _gdi_.RendererNative_Set(*args, **kwargs) + + Set = staticmethod(Set) + def GetVersion(*args, **kwargs): + """ + GetVersion(self) -> RendererVersion + + Returns the version of the renderer. Will be used for ensuring + compatibility of dynamically loaded renderers. + """ + return _gdi_.RendererNative_GetVersion(*args, **kwargs) + + +class RendererNativePtr(RendererNative): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = RendererNative +_gdi_.RendererNative_swigregister(RendererNativePtr) + +def RendererNative_Get(*args, **kwargs): + """ + RendererNative_Get() -> RendererNative + + Return the currently used renderer + """ + return _gdi_.RendererNative_Get(*args, **kwargs) + +def RendererNative_GetGeneric(*args, **kwargs): + """ + RendererNative_GetGeneric() -> RendererNative + + Return the generic implementation of the renderer. Under some + platforms, this is the default renderer implementation, others have + platform-specific default renderer which can be retrieved by calling + `GetDefault`. + """ + return _gdi_.RendererNative_GetGeneric(*args, **kwargs) + +def RendererNative_GetDefault(*args, **kwargs): + """ + RendererNative_GetDefault() -> RendererNative + + Return the default (native) implementation for this platform -- this + is also the one used by default but this may be changed by calling `Set` + in which case the return value of this method may be different from + the return value of `Get`. + """ + return _gdi_.RendererNative_GetDefault(*args, **kwargs) + +def RendererNative_Set(*args, **kwargs): + """ + RendererNative_Set(RendererNative renderer) -> RendererNative + + Set the renderer to use, passing None reverts to using the default + renderer. Returns the previous renderer used with Set or None. + """ + return _gdi_.RendererNative_Set(*args, **kwargs) + +