X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50efceee4e8b2e3c26f6a2b0d2bdecc36de7b61b..9165401fbedc620814401be5e6d6729dfa59c311:/wxPython/src/gtk/_gdi.py diff --git a/wxPython/src/gtk/_gdi.py b/wxPython/src/gtk/_gdi.py index cae4471a8a..24753ce4ae 100644 --- a/wxPython/src/gtk/_gdi.py +++ b/wxPython/src/gtk/_gdi.py @@ -68,11 +68,13 @@ class GDIObject(_core.Object): """IsNull(self) -> bool""" return _gdi_.GDIObject_IsNull(*args, **kwargs) -GDIObject_swigregister = _gdi_.GDIObject_swigregister -GDIObject_swigregister(GDIObject) +_gdi_.GDIObject_swigregister(GDIObject) #--------------------------------------------------------------------------- +C2S_NAME = _gdi_.C2S_NAME +C2S_CSS_SYNTAX = _gdi_.C2S_CSS_SYNTAX +C2S_HTML_SYNTAX = _gdi_.C2S_HTML_SYNTAX class Colour(_core.Object): """ A colour is an object representing a combination of Red, Green, and @@ -168,6 +170,20 @@ class Colour(_core.Object): """ return _gdi_.Colour_SetFromName(*args, **kwargs) + def GetAsString(*args, **kwargs): + """ + GetAsString(self, long flags=wxC2S_NAME|wxC2S_CSS_SYNTAX) -> String + + Return the colour as a string. Acceptable flags are: + + =================== ================================== + wx.C2S_NAME return colour name, when possible + wx.C2S_CSS_SYNTAX return colour in rgb(r,g,b) syntax + wx.C2S_HTML_SYNTAX return colour in #rrggbb syntax + =================== ================================== + """ + return _gdi_.Colour_GetAsString(*args, **kwargs) + def GetPixel(*args, **kwargs): """ GetPixel(self) -> long @@ -217,8 +233,7 @@ class Colour(_core.Object): __safe_for_unpickling__ = True def __reduce__(self): return (Colour, self.Get()) -Colour_swigregister = _gdi_.Colour_swigregister -Colour_swigregister(Colour) +_gdi_.Colour_swigregister(Colour) def NamedColour(*args, **kwargs): """ @@ -269,8 +284,7 @@ class Palette(GDIObject): return _gdi_.Palette_Ok(*args, **kwargs) def __nonzero__(self): return self.Ok() -Palette_swigregister = _gdi_.Palette_swigregister -Palette_swigregister(Palette) +_gdi_.Palette_swigregister(Palette) #--------------------------------------------------------------------------- @@ -358,8 +372,7 @@ class Pen(GDIObject): return _gdi_.Pen___ne__(*args, **kwargs) def __nonzero__(self): return self.Ok() -Pen_swigregister = _gdi_.Pen_swigregister -Pen_swigregister(Pen) +_gdi_.Pen_swigregister(Pen) #--------------------------------------------------------------------------- @@ -448,8 +461,7 @@ class Brush(GDIObject): return _gdi_.Brush_Ok(*args, **kwargs) def __nonzero__(self): return self.Ok() -Brush_swigregister = _gdi_.Brush_swigregister -Brush_swigregister(Brush) +_gdi_.Brush_swigregister(Brush) def BrushFromBitmap(*args, **kwargs): """ @@ -635,8 +647,7 @@ class Bitmap(GDIObject): """__ne__(self, Bitmap other) -> bool""" return _gdi_.Bitmap___ne__(*args, **kwargs) -Bitmap_swigregister = _gdi_.Bitmap_swigregister -Bitmap_swigregister(Bitmap) +_gdi_.Bitmap_swigregister(Bitmap) def EmptyBitmap(*args, **kwargs): """ @@ -721,8 +732,7 @@ class Mask(_core.Object): _gdi_.Mask_swiginit(self,_gdi_.new_Mask(*args, **kwargs)) __swig_destroy__ = _gdi_.delete_Mask __del__ = lambda self : None; -Mask_swigregister = _gdi_.Mask_swigregister -Mask_swigregister(Mask) +_gdi_.Mask_swigregister(Mask) MaskColour = wx._deprecated(Mask, "wx.MaskColour is deprecated, use `wx.Mask` instead.") class Icon(GDIObject): @@ -771,8 +781,7 @@ class Icon(GDIObject): return _gdi_.Icon_CopyFromBitmap(*args, **kwargs) def __nonzero__(self): return self.Ok() -Icon_swigregister = _gdi_.Icon_swigregister -Icon_swigregister(Icon) +_gdi_.Icon_swigregister(Icon) def EmptyIcon(*args, **kwargs): """EmptyIcon() -> Icon""" @@ -824,8 +833,7 @@ class IconLocation(object): """GetIndex(self) -> int""" return _gdi_.IconLocation_GetIndex(*args, **kwargs) -IconLocation_swigregister = _gdi_.IconLocation_swigregister -IconLocation_swigregister(IconLocation) +_gdi_.IconLocation_swigregister(IconLocation) class IconBundle(object): """Proxy of C++ IconBundle class""" @@ -848,8 +856,7 @@ class IconBundle(object): """GetIcon(self, Size size) -> Icon""" return _gdi_.IconBundle_GetIcon(*args, **kwargs) -IconBundle_swigregister = _gdi_.IconBundle_swigregister -IconBundle_swigregister(IconBundle) +_gdi_.IconBundle_swigregister(IconBundle) def IconBundleFromFile(*args, **kwargs): """IconBundleFromFile(String file, long type) -> IconBundle""" @@ -891,8 +898,7 @@ class Cursor(GDIObject): return _gdi_.Cursor_Ok(*args, **kwargs) def __nonzero__(self): return self.Ok() -Cursor_swigregister = _gdi_.Cursor_swigregister -Cursor_swigregister(Cursor) +_gdi_.Cursor_swigregister(Cursor) def StockCursor(*args, **kwargs): """ @@ -1020,8 +1026,7 @@ class Region(GDIObject): """UnionBitmapColour(self, Bitmap bmp, Colour transColour, int tolerance=0) -> bool""" return _gdi_.Region_UnionBitmapColour(*args, **kwargs) -Region_swigregister = _gdi_.Region_swigregister -Region_swigregister(Region) +_gdi_.Region_swigregister(Region) def RegionFromBitmap(*args, **kwargs): """RegionFromBitmap(Bitmap bmp) -> Region""" @@ -1091,8 +1096,7 @@ class RegionIterator(_core.Object): """__nonzero__(self) -> bool""" return _gdi_.RegionIterator___nonzero__(*args, **kwargs) -RegionIterator_swigregister = _gdi_.RegionIterator_swigregister -RegionIterator_swigregister(RegionIterator) +_gdi_.RegionIterator_swigregister(RegionIterator) #--------------------------------------------------------------------------- @@ -1284,7 +1288,7 @@ class NativeFontInfo(object): return _gdi_.NativeFontInfo_SetUnderlined(*args, **kwargs) def SetFaceName(*args, **kwargs): - """SetFaceName(self, String facename)""" + """SetFaceName(self, String facename) -> bool""" return _gdi_.NativeFontInfo_SetFaceName(*args, **kwargs) def SetFamily(*args, **kwargs): @@ -1315,8 +1319,7 @@ class NativeFontInfo(object): """ToUserString(self) -> String""" return _gdi_.NativeFontInfo_ToUserString(*args, **kwargs) -NativeFontInfo_swigregister = _gdi_.NativeFontInfo_swigregister -NativeFontInfo_swigregister(NativeFontInfo) +_gdi_.NativeFontInfo_swigregister(NativeFontInfo) class NativeEncodingInfo(object): """Proxy of C++ NativeEncodingInfo class""" @@ -1337,8 +1340,7 @@ class NativeEncodingInfo(object): """ToString(self) -> String""" return _gdi_.NativeEncodingInfo_ToString(*args, **kwargs) -NativeEncodingInfo_swigregister = _gdi_.NativeEncodingInfo_swigregister -NativeEncodingInfo_swigregister(NativeEncodingInfo) +_gdi_.NativeEncodingInfo_swigregister(NativeEncodingInfo) def GetNativeFontEncoding(*args, **kwargs): @@ -1423,8 +1425,7 @@ class FontMapper(object): """SetDialogTitle(self, String title)""" return _gdi_.FontMapper_SetDialogTitle(*args, **kwargs) -FontMapper_swigregister = _gdi_.FontMapper_swigregister -FontMapper_swigregister(FontMapper) +_gdi_.FontMapper_swigregister(FontMapper) def FontMapper_Get(*args): """FontMapper_Get() -> FontMapper""" @@ -1678,7 +1679,7 @@ class Font(GDIObject): def SetFaceName(*args, **kwargs): """ - SetFaceName(self, String faceName) + SetFaceName(self, String faceName) -> bool Sets the facename for the font. The facename, which should be a valid font installed on the end-user's system. @@ -1717,7 +1718,7 @@ class Font(GDIObject): def SetNativeFontInfoFromString(*args, **kwargs): """ - SetNativeFontInfoFromString(self, String info) + SetNativeFontInfoFromString(self, String info) -> bool Set the font's attributes from string representation of a `wx.NativeFontInfo` object. @@ -1726,7 +1727,7 @@ class Font(GDIObject): def SetNativeFontInfoUserDesc(*args, **kwargs): """ - SetNativeFontInfoUserDesc(self, String info) + SetNativeFontInfoUserDesc(self, String info) -> bool Set the font's attributes from a string formerly returned from `GetNativeFontInfoDesc`. @@ -1784,8 +1785,7 @@ class Font(GDIObject): return _gdi_.Font_SetDefaultEncoding(*args, **kwargs) SetDefaultEncoding = staticmethod(SetDefaultEncoding) -Font_swigregister = _gdi_.Font_swigregister -Font_swigregister(Font) +_gdi_.Font_swigregister(Font) def FontFromNativeInfo(*args, **kwargs): """ @@ -1910,15 +1910,43 @@ class FontEnumerator(object): return _gdi_.FontEnumerator_EnumerateEncodings(*args, **kwargs) def GetEncodings(*args, **kwargs): - """GetEncodings(self) -> PyObject""" + """GetEncodings() -> PyObject""" return _gdi_.FontEnumerator_GetEncodings(*args, **kwargs) + GetEncodings = staticmethod(GetEncodings) def GetFacenames(*args, **kwargs): - """GetFacenames(self) -> PyObject""" + """GetFacenames() -> PyObject""" return _gdi_.FontEnumerator_GetFacenames(*args, **kwargs) -FontEnumerator_swigregister = _gdi_.FontEnumerator_swigregister -FontEnumerator_swigregister(FontEnumerator) + GetFacenames = staticmethod(GetFacenames) + def IsValidFacename(*args, **kwargs): + """ + IsValidFacename(String str) -> bool + + Convenience function that returns true if the given face name exist in + the user's system + """ + return _gdi_.FontEnumerator_IsValidFacename(*args, **kwargs) + + IsValidFacename = staticmethod(IsValidFacename) +_gdi_.FontEnumerator_swigregister(FontEnumerator) + +def FontEnumerator_GetEncodings(*args): + """FontEnumerator_GetEncodings() -> PyObject""" + return _gdi_.FontEnumerator_GetEncodings(*args) + +def FontEnumerator_GetFacenames(*args): + """FontEnumerator_GetFacenames() -> PyObject""" + return _gdi_.FontEnumerator_GetFacenames(*args) + +def FontEnumerator_IsValidFacename(*args, **kwargs): + """ + FontEnumerator_IsValidFacename(String str) -> bool + + Convenience function that returns true if the given face name exist in + the user's system + """ + return _gdi_.FontEnumerator_IsValidFacename(*args, **kwargs) #--------------------------------------------------------------------------- @@ -2161,8 +2189,7 @@ class LanguageInfo(object): Language = property(_gdi_.LanguageInfo_Language_get, _gdi_.LanguageInfo_Language_set) CanonicalName = property(_gdi_.LanguageInfo_CanonicalName_get, _gdi_.LanguageInfo_CanonicalName_set) Description = property(_gdi_.LanguageInfo_Description_get, _gdi_.LanguageInfo_Description_set) -LanguageInfo_swigregister = _gdi_.LanguageInfo_swigregister -LanguageInfo_swigregister(LanguageInfo) +_gdi_.LanguageInfo_swigregister(LanguageInfo) LOCALE_CAT_NUMBER = _gdi_.LOCALE_CAT_NUMBER LOCALE_CAT_DATE = _gdi_.LOCALE_CAT_DATE @@ -2277,8 +2304,7 @@ class Locale(object): """GetName(self) -> String""" return _gdi_.Locale_GetName(*args, **kwargs) -Locale_swigregister = _gdi_.Locale_swigregister -Locale_swigregister(Locale) +_gdi_.Locale_swigregister(Locale) def Locale_GetSystemLanguage(*args): """Locale_GetSystemLanguage() -> int""" @@ -2358,8 +2384,7 @@ class EncodingConverter(_core.Object): CanConvert = staticmethod(CanConvert) def __nonzero__(self): return self.IsOk() -EncodingConverter_swigregister = _gdi_.EncodingConverter_swigregister -EncodingConverter_swigregister(EncodingConverter) +_gdi_.EncodingConverter_swigregister(EncodingConverter) def GetTranslation(*args): """ @@ -3352,7 +3377,7 @@ class DC(_core.Object): """ GetPPI(self) -> Size - Resolution in Pixels per inch + Resolution in pixels per inch """ return _gdi_.DC_GetPPI(*args, **kwargs) @@ -3852,8 +3877,7 @@ class DC(_core.Object): raise ValueError('backgrounds and coords must have same length') return self._DrawTextList(textList, coords, foregrounds, backgrounds) -DC_swigregister = _gdi_.DC_swigregister -DC_swigregister(DC) +_gdi_.DC_swigregister(DC) #--------------------------------------------------------------------------- @@ -3902,8 +3926,7 @@ class MemoryDC(DC): """ return _gdi_.MemoryDC_SelectObject(*args, **kwargs) -MemoryDC_swigregister = _gdi_.MemoryDC_swigregister -MemoryDC_swigregister(MemoryDC) +_gdi_.MemoryDC_swigregister(MemoryDC) def MemoryDCFromDC(*args, **kwargs): """ @@ -3955,8 +3978,7 @@ class BufferedDC(MemoryDC): """ return _gdi_.BufferedDC_UnMask(*args, **kwargs) -BufferedDC_swigregister = _gdi_.BufferedDC_swigregister -BufferedDC_swigregister(BufferedDC) +_gdi_.BufferedDC_swigregister(BufferedDC) class BufferedPaintDC(BufferedDC): """ @@ -3995,8 +4017,7 @@ class BufferedPaintDC(BufferedDC): """ _gdi_.BufferedPaintDC_swiginit(self,_gdi_.new_BufferedPaintDC(*args, **kwargs)) -BufferedPaintDC_swigregister = _gdi_.BufferedPaintDC_swigregister -BufferedPaintDC_swigregister(BufferedPaintDC) +_gdi_.BufferedPaintDC_swigregister(BufferedPaintDC) #--------------------------------------------------------------------------- @@ -4060,8 +4081,7 @@ class ScreenDC(DC): """ return _gdi_.ScreenDC_EndDrawingOnTop(*args, **kwargs) -ScreenDC_swigregister = _gdi_.ScreenDC_swigregister -ScreenDC_swigregister(ScreenDC) +_gdi_.ScreenDC_swigregister(ScreenDC) #--------------------------------------------------------------------------- @@ -4088,8 +4108,7 @@ class ClientDC(DC): Constructor. Pass the window on which you wish to paint. """ _gdi_.ClientDC_swiginit(self,_gdi_.new_ClientDC(*args, **kwargs)) -ClientDC_swigregister = _gdi_.ClientDC_swigregister -ClientDC_swigregister(ClientDC) +_gdi_.ClientDC_swigregister(ClientDC) #--------------------------------------------------------------------------- @@ -4119,8 +4138,7 @@ class PaintDC(DC): Constructor. Pass the window on which you wish to paint. """ _gdi_.PaintDC_swiginit(self,_gdi_.new_PaintDC(*args, **kwargs)) -PaintDC_swigregister = _gdi_.PaintDC_swigregister -PaintDC_swigregister(PaintDC) +_gdi_.PaintDC_swigregister(PaintDC) #--------------------------------------------------------------------------- @@ -4140,8 +4158,7 @@ class WindowDC(DC): Constructor. Pass the window on which you wish to paint. """ _gdi_.WindowDC_swiginit(self,_gdi_.new_WindowDC(*args, **kwargs)) -WindowDC_swigregister = _gdi_.WindowDC_swigregister -WindowDC_swigregister(WindowDC) +_gdi_.WindowDC_swigregister(WindowDC) #--------------------------------------------------------------------------- @@ -4165,8 +4182,7 @@ class MirrorDC(DC): *mirror* is True. """ _gdi_.MirrorDC_swiginit(self,_gdi_.new_MirrorDC(*args, **kwargs)) -MirrorDC_swigregister = _gdi_.MirrorDC_swigregister -MirrorDC_swigregister(MirrorDC) +_gdi_.MirrorDC_swigregister(MirrorDC) #--------------------------------------------------------------------------- @@ -4209,8 +4225,7 @@ class PostScriptDC(DC): return _gdi_.PostScriptDC_GetResolution(*args, **kwargs) GetResolution = staticmethod(GetResolution) -PostScriptDC_swigregister = _gdi_.PostScriptDC_swigregister -PostScriptDC_swigregister(PostScriptDC) +_gdi_.PostScriptDC_swigregister(PostScriptDC) def PostScriptDC_SetResolution(*args, **kwargs): """ @@ -4238,8 +4253,7 @@ class MetaFile(_core.Object): def __init__(self, *args, **kwargs): """__init__(self, String filename=EmptyString) -> MetaFile""" _gdi_.MetaFile_swiginit(self,_gdi_.new_MetaFile(*args, **kwargs)) -MetaFile_swigregister = _gdi_.MetaFile_swigregister -MetaFile_swigregister(MetaFile) +_gdi_.MetaFile_swigregister(MetaFile) class MetaFileDC(DC): """Proxy of C++ MetaFileDC class""" @@ -4251,8 +4265,7 @@ class MetaFileDC(DC): String description=EmptyString) -> MetaFileDC """ _gdi_.MetaFileDC_swiginit(self,_gdi_.new_MetaFileDC(*args, **kwargs)) -MetaFileDC_swigregister = _gdi_.MetaFileDC_swigregister -MetaFileDC_swigregister(MetaFileDC) +_gdi_.MetaFileDC_swigregister(MetaFileDC) class PrinterDC(DC): """Proxy of C++ PrinterDC class""" @@ -4261,8 +4274,7 @@ class PrinterDC(DC): def __init__(self, *args, **kwargs): """__init__(self, wxPrintData printData) -> PrinterDC""" _gdi_.PrinterDC_swiginit(self,_gdi_.new_PrinterDC(*args, **kwargs)) -PrinterDC_swigregister = _gdi_.PrinterDC_swigregister -PrinterDC_swigregister(PrinterDC) +_gdi_.PrinterDC_swigregister(PrinterDC) #--------------------------------------------------------------------------- @@ -4303,7 +4315,7 @@ class ImageList(_core.Object): return _gdi_.ImageList_GetIcon(*args, **kwargs) def Replace(*args, **kwargs): - """Replace(self, int index, Bitmap bitmap) -> bool""" + """Replace(self, int index, Bitmap bitmap, Bitmap mask=NullBitmap) -> bool""" return _gdi_.ImageList_Replace(*args, **kwargs) def Draw(*args, **kwargs): @@ -4326,11 +4338,10 @@ class ImageList(_core.Object): return _gdi_.ImageList_RemoveAll(*args, **kwargs) def GetSize(*args, **kwargs): - """GetSize() -> (width,height)""" + """GetSize(index) -> (width,height)""" return _gdi_.ImageList_GetSize(*args, **kwargs) -ImageList_swigregister = _gdi_.ImageList_swigregister -ImageList_swigregister(ImageList) +_gdi_.ImageList_swigregister(ImageList) #--------------------------------------------------------------------------- @@ -4412,8 +4423,56 @@ class StockGDI(object): """GetFont(self, int item) -> Font""" return _gdi_.StockGDI_GetFont(*args, **kwargs) -StockGDI_swigregister = _gdi_.StockGDI_swigregister -StockGDI_swigregister(StockGDI) + def _initStockObjects(): + import wx + wx.ITALIC_FONT.this = StockGDI.instance().GetFont(StockGDI.FONT_ITALIC).this + wx.NORMAL_FONT.this = StockGDI.instance().GetFont(StockGDI.FONT_NORMAL).this + wx.SMALL_FONT.this = StockGDI.instance().GetFont(StockGDI.FONT_SMALL).this + wx.SWISS_FONT.this = StockGDI.instance().GetFont(StockGDI.FONT_SWISS).this + + wx.BLACK_DASHED_PEN.this = StockGDI.GetPen(StockGDI.PEN_BLACKDASHED).this + wx.BLACK_PEN.this = StockGDI.GetPen(StockGDI.PEN_BLACK).this + wx.CYAN_PEN.this = StockGDI.GetPen(StockGDI.PEN_CYAN).this + wx.GREEN_PEN.this = StockGDI.GetPen(StockGDI.PEN_GREEN).this + wx.GREY_PEN.this = StockGDI.GetPen(StockGDI.PEN_GREY).this + wx.LIGHT_GREY_PEN.this = StockGDI.GetPen(StockGDI.PEN_LIGHTGREY).this + wx.MEDIUM_GREY_PEN.this = StockGDI.GetPen(StockGDI.PEN_MEDIUMGREY).this + wx.RED_PEN.this = StockGDI.GetPen(StockGDI.PEN_RED).this + wx.TRANSPARENT_PEN.this = StockGDI.GetPen(StockGDI.PEN_TRANSPARENT).this + wx.WHITE_PEN.this = StockGDI.GetPen(StockGDI.PEN_WHITE).this + + wx.BLACK_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_BLACK).this + wx.BLUE_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_BLUE).this + wx.CYAN_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_CYAN).this + wx.GREEN_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_GREEN).this + wx.GREY_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_GREY).this + wx.LIGHT_GREY_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_LIGHTGREY).this + wx.MEDIUM_GREY_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_MEDIUMGREY).this + wx.RED_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_RED).this + wx.TRANSPARENT_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_TRANSPARENT).this + wx.WHITE_BRUSH.this = StockGDI.GetBrush(StockGDI.BRUSH_WHITE).this + + wx.BLACK.this = StockGDI.GetColour(StockGDI.COLOUR_BLACK).this + wx.BLUE.this = StockGDI.GetColour(StockGDI.COLOUR_BLUE).this + wx.CYAN.this = StockGDI.GetColour(StockGDI.COLOUR_CYAN).this + wx.GREEN.this = StockGDI.GetColour(StockGDI.COLOUR_GREEN).this + wx.LIGHT_GREY.this = StockGDI.GetColour(StockGDI.COLOUR_LIGHTGREY).this + wx.RED.this = StockGDI.GetColour(StockGDI.COLOUR_RED).this + wx.WHITE.this = StockGDI.GetColour(StockGDI.COLOUR_WHITE).this + + wx.CROSS_CURSOR.this = StockGDI.GetCursor(StockGDI.CURSOR_CROSS).this + wx.HOURGLASS_CURSOR.this = StockGDI.GetCursor(StockGDI.CURSOR_HOURGLASS).this + wx.STANDARD_CURSOR.this = StockGDI.GetCursor(StockGDI.CURSOR_STANDARD).this + + wx.TheFontList.this = _wxPyInitTheFontList().this + wx.ThePenList.this = _wxPyInitThePenList().this + wx.TheBrushList.this = _wxPyInitTheBrushList().this + wx.TheColourDatabase.this = _wxPyInitTheColourDatabase().this + + + _initStockObjects = staticmethod(_initStockObjects) + +_gdi_.StockGDI_swigregister(StockGDI) def StockGDI_DeleteAll(*args): """StockGDI_DeleteAll()""" @@ -4439,74 +4498,46 @@ def StockGDI_GetPen(*args, **kwargs): """StockGDI_GetPen(int item) -> Pen""" return _gdi_.StockGDI_GetPen(*args, **kwargs) -# This function makes a class used to do delayed initialization of some -# stock wx objects. When they are used the first time then an init function -# is called to make the real instance, which is then used to replace the -# original instance and class seen by the programmer. -def _wxPyMakeDelayedInitWrapper(initFunc): - class _wxPyStockObjectWrapper(object): - def __init__(self, *args): - self._args = args - def __getattr__(self, name): - obj = initFunc(*self._args) - self.__class__ = obj.__class__ - self.__dict__ = obj.__dict__ - return getattr(self, name) - def __str__(self): - return self.__getattr__("__str__")() - def __repr__(self): - return self.__getattr__("__repr__")() - return _wxPyStockObjectWrapper - -def _wxPyFontInit(id): - return StockGDI.instance().GetFont(id) - -_wxPyStockPen = _wxPyMakeDelayedInitWrapper(StockGDI.GetPen) -_wxPyStockBrush = _wxPyMakeDelayedInitWrapper(StockGDI.GetBrush) -_wxPyStockCursor = _wxPyMakeDelayedInitWrapper(StockGDI.GetCursor) -_wxPyStockColour = _wxPyMakeDelayedInitWrapper(StockGDI.GetColour) -_wxPyStockFont = _wxPyMakeDelayedInitWrapper(_wxPyFontInit) - - -ITALIC_FONT = _wxPyStockCursor(StockGDI.FONT_ITALIC) -NORMAL_FONT = _wxPyStockCursor(StockGDI.FONT_NORMAL) -SMALL_FONT = _wxPyStockCursor(StockGDI.FONT_SMALL) -SWISS_FONT = _wxPyStockCursor(StockGDI.FONT_SWISS) - -BLACK_DASHED_PEN = _wxPyStockPen(StockGDI.PEN_BLACKDASHED) -BLACK_PEN = _wxPyStockPen(StockGDI.PEN_BLACK) -CYAN_PEN = _wxPyStockPen(StockGDI.PEN_CYAN) -GREEN_PEN = _wxPyStockPen(StockGDI.PEN_GREEN) -GREY_PEN = _wxPyStockPen(StockGDI.PEN_GREY) -LIGHT_GREY_PEN = _wxPyStockPen(StockGDI.PEN_LIGHTGREY) -MEDIUM_GREY_PEN = _wxPyStockPen(StockGDI.PEN_MEDIUMGREY) -RED_PEN = _wxPyStockPen(StockGDI.PEN_RED) -TRANSPARENT_PEN = _wxPyStockPen(StockGDI.PEN_TRANSPARENT) -WHITE_PEN = _wxPyStockPen(StockGDI.PEN_WHITE) - -BLACK_BRUSH = _wxPyStockBrush(StockGDI.BRUSH_BLACK) -BLUE_BRUSH = _wxPyStockBrush(StockGDI.BRUSH_BLUE) -CYAN_BRUSH = _wxPyStockBrush(StockGDI.BRUSH_CYAN) -GREEN_BRUSH = _wxPyStockBrush(StockGDI.BRUSH_GREEN) -GREY_BRUSH = _wxPyStockBrush(StockGDI.BRUSH_GREY) -LIGHT_GREY_BRUSH = _wxPyStockBrush(StockGDI.BRUSH_LIGHTGREY) -MEDIUM_GREY_BRUSH = _wxPyStockBrush(StockGDI.BRUSH_MEDIUMGREY) -RED_BRUSH = _wxPyStockBrush(StockGDI.BRUSH_RED) -TRANSPARENT_BRUSH = _wxPyStockBrush(StockGDI.BRUSH_TRANSPARENT) -WHITE_BRUSH = _wxPyStockBrush(StockGDI.BRUSH_WHITE) - -BLACK = _wxPyStockColour(StockGDI.COLOUR_BLACK) -BLUE = _wxPyStockColour(StockGDI.COLOUR_BLUE) -CYAN = _wxPyStockColour(StockGDI.COLOUR_CYAN) -GREEN = _wxPyStockColour(StockGDI.COLOUR_GREEN) -LIGHT_GREY = _wxPyStockColour(StockGDI.COLOUR_LIGHTGREY) -RED = _wxPyStockColour(StockGDI.COLOUR_RED) -WHITE = _wxPyStockColour(StockGDI.COLOUR_WHITE) - -CROSS_CURSOR = _wxPyStockCursor(StockGDI.CURSOR_CROSS) -HOURGLASS_CURSOR = _wxPyStockCursor(StockGDI.CURSOR_HOURGLASS) -STANDARD_CURSOR = _wxPyStockCursor(StockGDI.CURSOR_STANDARD) - +# Create an uninitialized instance for the stock objects, they will +# be initialized later when the wx.App object is created. +ITALIC_FONT = Font.__new__(Font) +NORMAL_FONT = Font.__new__(Font) +SMALL_FONT = Font.__new__(Font) +SWISS_FONT = Font.__new__(Font) + +BLACK_DASHED_PEN = Pen.__new__(Pen) +BLACK_PEN = Pen.__new__(Pen) +CYAN_PEN = Pen.__new__(Pen) +GREEN_PEN = Pen.__new__(Pen) +GREY_PEN = Pen.__new__(Pen) +LIGHT_GREY_PEN = Pen.__new__(Pen) +MEDIUM_GREY_PEN = Pen.__new__(Pen) +RED_PEN = Pen.__new__(Pen) +TRANSPARENT_PEN = Pen.__new__(Pen) +WHITE_PEN = Pen.__new__(Pen) + +BLACK_BRUSH = Brush.__new__(Brush) +BLUE_BRUSH = Brush.__new__(Brush) +CYAN_BRUSH = Brush.__new__(Brush) +GREEN_BRUSH = Brush.__new__(Brush) +GREY_BRUSH = Brush.__new__(Brush) +LIGHT_GREY_BRUSH = Brush.__new__(Brush) +MEDIUM_GREY_BRUSH = Brush.__new__(Brush) +RED_BRUSH = Brush.__new__(Brush) +TRANSPARENT_BRUSH = Brush.__new__(Brush) +WHITE_BRUSH = Brush.__new__(Brush) + +BLACK = Colour.__new__(Colour) +BLUE = Colour.__new__(Colour) +CYAN = Colour.__new__(Colour) +GREEN = Colour.__new__(Colour) +LIGHT_GREY = Colour.__new__(Colour) +RED = Colour.__new__(Colour) +WHITE = Colour.__new__(Colour) + +CROSS_CURSOR = Cursor.__new__(Cursor) +HOURGLASS_CURSOR = Cursor.__new__(Cursor) +STANDARD_CURSOR = Cursor.__new__(Cursor) class GDIObjListBase(object): """Proxy of C++ GDIObjListBase class""" @@ -4517,8 +4548,7 @@ class GDIObjListBase(object): _gdi_.GDIObjListBase_swiginit(self,_gdi_.new_GDIObjListBase(*args, **kwargs)) __swig_destroy__ = _gdi_.delete_GDIObjListBase __del__ = lambda self : None; -GDIObjListBase_swigregister = _gdi_.GDIObjListBase_swigregister -GDIObjListBase_swigregister(GDIObjListBase) +_gdi_.GDIObjListBase_swigregister(GDIObjListBase) cvar = _gdi_.cvar NullBitmap = cvar.NullBitmap NullIcon = cvar.NullIcon @@ -4549,8 +4579,7 @@ class PenList(GDIObjListBase): AddPen = wx._deprecated(AddPen) RemovePen = wx._deprecated(RemovePen) -PenList_swigregister = _gdi_.PenList_swigregister -PenList_swigregister(PenList) +_gdi_.PenList_swigregister(PenList) class BrushList(GDIObjListBase): """Proxy of C++ BrushList class""" @@ -4572,8 +4601,7 @@ class BrushList(GDIObjListBase): AddBrush = wx._deprecated(AddBrush) RemoveBrush = wx._deprecated(RemoveBrush) -BrushList_swigregister = _gdi_.BrushList_swigregister -BrushList_swigregister(BrushList) +_gdi_.BrushList_swigregister(BrushList) class FontList(GDIObjListBase): """Proxy of C++ FontList class""" @@ -4599,8 +4627,7 @@ class FontList(GDIObjListBase): AddFont = wx._deprecated(AddFont) RemoveFont = wx._deprecated(RemoveFont) -FontList_swigregister = _gdi_.FontList_swigregister -FontList_swigregister(FontList) +_gdi_.FontList_swigregister(FontList) class ColourDatabase(object): """Proxy of C++ ColourDatabase class""" @@ -4628,8 +4655,7 @@ class ColourDatabase(object): """Append(self, String name, int red, int green, int blue)""" return _gdi_.ColourDatabase_Append(*args, **kwargs) -ColourDatabase_swigregister = _gdi_.ColourDatabase_swigregister -ColourDatabase_swigregister(ColourDatabase) +_gdi_.ColourDatabase_swigregister(ColourDatabase) #--------------------------------------------------------------------------- @@ -4649,10 +4675,12 @@ def _wxPyInitTheBrushList(*args): def _wxPyInitTheColourDatabase(*args): """_wxPyInitTheColourDatabase() -> ColourDatabase""" return _gdi_._wxPyInitTheColourDatabase(*args) -wxTheFontList = _wxPyMakeDelayedInitWrapper(_wxPyInitTheFontList)() -wxThePenList = _wxPyMakeDelayedInitWrapper(_wxPyInitThePenList)() -wxTheBrushList = _wxPyMakeDelayedInitWrapper(_wxPyInitTheBrushList)() -wxTheColourDatabase = _wxPyMakeDelayedInitWrapper(_wxPyInitTheColourDatabase)() +# Create an uninitialized instance for the stock objects, they will +# be initialized later when the wx.App object is created. +TheFontList = FontList.__new__(FontList) +ThePenList = PenList.__new__(PenList) +TheBrushList = BrushList.__new__(BrushList) +TheColourDatabase = ColourDatabase.__new__(ColourDatabase) NullColor = NullColour #--------------------------------------------------------------------------- @@ -4719,8 +4747,7 @@ class Effects(_core.Object): """TileBitmap(self, Rect rect, DC dc, Bitmap bitmap) -> bool""" return _gdi_.Effects_TileBitmap(*args, **kwargs) -Effects_swigregister = _gdi_.Effects_swigregister -Effects_swigregister(Effects) +_gdi_.Effects_swigregister(Effects) #--------------------------------------------------------------------------- @@ -4773,8 +4800,7 @@ class SplitterRenderParams(object): widthSash = property(_gdi_.SplitterRenderParams_widthSash_get) border = property(_gdi_.SplitterRenderParams_border_get) isHotSensitive = property(_gdi_.SplitterRenderParams_isHotSensitive_get) -SplitterRenderParams_swigregister = _gdi_.SplitterRenderParams_swigregister -SplitterRenderParams_swigregister(SplitterRenderParams) +_gdi_.SplitterRenderParams_swigregister(SplitterRenderParams) class RendererVersion(object): """ @@ -4804,8 +4830,7 @@ class RendererVersion(object): IsCompatible = staticmethod(IsCompatible) version = property(_gdi_.RendererVersion_version_get) age = property(_gdi_.RendererVersion_age_get) -RendererVersion_swigregister = _gdi_.RendererVersion_swigregister -RendererVersion_swigregister(RendererVersion) +_gdi_.RendererVersion_swigregister(RendererVersion) def RendererVersion_IsCompatible(*args, **kwargs): """RendererVersion_IsCompatible(RendererVersion ver) -> bool""" @@ -4824,6 +4849,11 @@ class RendererNative(object): genereic controls in ways that are as close to the native look as possible. + Note that each drawing function restores the `wx.DC` attributes if it + changes them, so it is safe to assume that the same pen, brush and + colours that were active before the call to this function are still in + effect after it. + """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') def __init__(self): raise AttributeError, "No constructor defined" @@ -4890,14 +4920,42 @@ class RendererNative(object): """ return _gdi_.RendererNative_DrawDropArrow(*args, **kwargs) - def DrawCheckButton(*args, **kwargs): + def DrawCheckBox(*args, **kwargs): """ - DrawCheckButton(self, Window win, DC dc, Rect rect, int flags=0) + DrawCheckBox(self, Window win, DC dc, Rect rect, int flags=0) Draw a check button. Flags may use wx.CONTROL_CHECKED, wx.CONTROL_UNDETERMINED and wx.CONTROL_CURRENT. """ - return _gdi_.RendererNative_DrawCheckButton(*args, **kwargs) + return _gdi_.RendererNative_DrawCheckBox(*args, **kwargs) + + def DrawPushButton(*args, **kwargs): + """ + DrawPushButton(self, Window win, DC dc, Rect rect, int flags=0) + + Draw a blank button. Flags may be wx.CONTROL_PRESSED, wx.CONTROL_CURRENT and + wx.CONTROL_ISDEFAULT + """ + return _gdi_.RendererNative_DrawPushButton(*args, **kwargs) + + def DrawItemSelectionRect(*args, **kwargs): + """ + DrawItemSelectionRect(self, Window win, DC dc, Rect rect, int flags=0) + + Draw rectangle indicating that an item in e.g. a list control has been + selected or focused + + The flags parameter may be: + + ==================== ============================================ + wx.CONTROL_SELECTED item is selected, e.g. draw background + wx.CONTROL_CURRENT item is the current item, e.g. dotted border + wx.CONTROL_FOCUSED the whole control has focus, e.g. blue + background vs. grey otherwise + ==================== ============================================ + + """ + return _gdi_.RendererNative_DrawItemSelectionRect(*args, **kwargs) def GetSplitterParams(*args, **kwargs): """ @@ -4959,8 +5017,7 @@ class RendererNative(object): """ return _gdi_.RendererNative_GetVersion(*args, **kwargs) -RendererNative_swigregister = _gdi_.RendererNative_swigregister -RendererNative_swigregister(RendererNative) +_gdi_.RendererNative_swigregister(RendererNative) def RendererNative_Get(*args): """