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 }
+
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
return "<%s.%s; proxy of C++ wxMask instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""
- __init__(Bitmap bitmap) -> Mask
+ __init__(Bitmap bitmap, Colour colour=NullColour) -> Mask
- Constructs a mask from a monochrome bitmap.
+ Constructs a mask from a bitmap and a colour in that bitmap that indicates
+ the transparent portions of the mask, by default BLACK is used.
"""
newobj = _gdi.new_Mask(*args, **kwargs)
self.this = newobj.this
self.__class__ = Mask
_gdi.Mask_swigregister(MaskPtr)
-def MaskColour(*args, **kwargs):
- """
- MaskColour(Bitmap bitmap, Colour colour) -> Mask
-
- Constructs a mask from a bitmap and a colour in that bitmap that indicates the
- background.
- """
- val = _gdi.new_MaskColour(*args, **kwargs)
- val.thisown = 1
- return val
-
+MaskColour = Mask
class Icon(GDIObject):
def __repr__(self):
return "<%s.%s; proxy of C++ wxIcon instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
wxMask *mask = new wxMask(*self, colour);
self->SetMask(mask);
}
+wxMask *new_wxMask(wxBitmap const &bitmap,wxColour const &colour){
+ if ( !colour.Ok() )
+ return new wxMask(bitmap, *wxBLACK);
+ else
+ return new wxMask(bitmap, colour);
+ }
#include <wx/iconbndl.h>
static PyObject *_wrap_new_Mask(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxBitmap *arg1 = 0 ;
- wxMask *result;
- PyObject * obj0 = 0 ;
- char *kwnames[] = {
- (char *) "bitmap", NULL
- };
-
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:new_Mask",kwnames,&obj0)) goto fail;
- if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxBitmap,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
- if (arg1 == NULL) {
- PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail;
- }
- {
- PyThreadState* __tstate = wxPyBeginAllowThreads();
- result = (wxMask *)new wxMask((wxBitmap const &)*arg1);
-
- wxPyEndAllowThreads(__tstate);
- if (PyErr_Occurred()) SWIG_fail;
- }
- resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxMask, 1);
- return resultobj;
- fail:
- return NULL;
-}
-
-
-static PyObject *_wrap_new_MaskColour(PyObject *self, PyObject *args, PyObject *kwargs) {
- PyObject *resultobj;
- wxBitmap *arg1 = 0 ;
- wxColour *arg2 = 0 ;
+ wxColour const &arg2_defvalue = wxNullColour ;
+ wxColour *arg2 = (wxColour *) &arg2_defvalue ;
wxMask *result;
wxColour temp2 ;
PyObject * obj0 = 0 ;
(char *) "bitmap",(char *) "colour", NULL
};
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:new_MaskColour",kwnames,&obj0,&obj1)) goto fail;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:new_Mask",kwnames,&obj0,&obj1)) goto fail;
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxBitmap,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
if (arg1 == NULL) {
PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail;
}
- {
- arg2 = &temp2;
- if ( ! wxColour_helper(obj1, &arg2)) SWIG_fail;
+ if (obj1) {
+ {
+ arg2 = &temp2;
+ if ( ! wxColour_helper(obj1, &arg2)) SWIG_fail;
+ }
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- result = (wxMask *)new wxMask((wxBitmap const &)*arg1,(wxColour const &)*arg2);
+ result = (wxMask *)new_wxMask((wxBitmap const &)*arg1,(wxColour const &)*arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
{ (char *)"Bitmap_SetDepth", (PyCFunction) _wrap_Bitmap_SetDepth, METH_VARARGS | METH_KEYWORDS },
{ (char *)"Bitmap_swigregister", Bitmap_swigregister, METH_VARARGS },
{ (char *)"new_Mask", (PyCFunction) _wrap_new_Mask, METH_VARARGS | METH_KEYWORDS },
- { (char *)"new_MaskColour", (PyCFunction) _wrap_new_MaskColour, METH_VARARGS | METH_KEYWORDS },
{ (char *)"Mask_swigregister", Mask_swigregister, METH_VARARGS },
{ (char *)"new_Icon", (PyCFunction) _wrap_new_Icon, METH_VARARGS | METH_KEYWORDS },
{ (char *)"delete_Icon", (PyCFunction) _wrap_delete_Icon, METH_VARARGS | METH_KEYWORDS },