X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e0c87227cf6b6215d169985d2bb5d2421a74512..0d267606ff0b2acebe59ef6aeab98b01ee67eb6b:/wxPython/src/_bitmap.i?ds=sidebyside diff --git a/wxPython/src/_bitmap.i b/wxPython/src/_bitmap.i index 3430d19555..8f9213ea36 100644 --- a/wxPython/src/_bitmap.i +++ b/wxPython/src/_bitmap.i @@ -110,7 +110,9 @@ public: // wxGDIImage methods #ifdef __WXMSW__ long GetHandle(); - void SetHandle(long handle); + %extend { + void SetHandle(long handle) { self->SetHandle((WXHANDLE)handle); } + } #endif bool Ok(); @@ -188,6 +190,11 @@ public: #endif %pythoncode { def __nonzero__(self): return self.Ok() } + + %extend { + bool __eq__(const wxBitmap* other) { return other ? (*self == *other) : False; } + bool __ne__(const wxBitmap* other) { return other ? (*self != *other) : True; } + } }; @@ -201,19 +208,29 @@ DocStr(wxMask, class wxMask : public wxObject { public: +#if 0 DocCtorStr( wxMask(const wxBitmap& bitmap), "Constructs a mask from a monochrome bitmap."); +#endif - DocCtorStrName( - wxMask(const wxBitmap& bitmap, const wxColour& colour), - "Constructs a mask from a bitmap and a colour in that bitmap that indicates the\n" - "background.", - MaskColour); + DocStr(wxMask, + "Constructs a mask from a bitmap and a colour in that bitmap that indicates\n" + "the transparent portions of the mask, by default BLACK is used."); + + %extend { + wxMask(const wxBitmap& bitmap, const wxColour& colour = wxNullColour) { + if ( !colour.Ok() ) + return new wxMask(bitmap, *wxBLACK); + else + return new wxMask(bitmap, colour); + } + } //~wxMask(); - }; +%pythoncode { MaskColour = Mask } + //--------------------------------------------------------------------------- //---------------------------------------------------------------------------