Added a wxIconFromBitmap "constructor" for wxIcon.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14499 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -234,6 +234,7 @@ public:
|
||||
// Declarations of some alternate "constructors"
|
||||
%new wxIcon* wxEmptyIcon();
|
||||
%new wxIcon* wxIconFromXPMData(PyObject* listOfStrings);
|
||||
%new wxIcon* wxIconFromBitmap(const wxBitmap& bmp);
|
||||
|
||||
%{ // Implementations of some alternate "constructors"
|
||||
wxIcon* wxEmptyIcon() {
|
||||
@@ -251,6 +252,12 @@ public:
|
||||
delete [] cArray;
|
||||
return icon;
|
||||
}
|
||||
|
||||
wxIcon* wxIconFromBitmap(const wxBitmap& bmp) {
|
||||
wxIcon* icon = new wxIcon();
|
||||
icon->CopyFromBitmap(bmp);
|
||||
return icon;
|
||||
}
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@@ -172,6 +172,12 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
|
||||
delete [] cArray;
|
||||
return icon;
|
||||
}
|
||||
|
||||
wxIcon* wxIconFromBitmap(const wxBitmap& bmp) {
|
||||
wxIcon* icon = new wxIcon();
|
||||
icon->CopyFromBitmap(bmp);
|
||||
return icon;
|
||||
}
|
||||
// Alternate 'constructor'
|
||||
wxCursor* wxPyStockCursor(int id) {
|
||||
return new wxCursor(id);
|
||||
@@ -488,6 +494,40 @@ static PyObject *_wrap_wxIconFromXPMData(PyObject *self, PyObject *args, PyObjec
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyObject *_wrap_wxIconFromBitmap(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxIcon * _result;
|
||||
wxBitmap * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "bmp", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxIconFromBitmap",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIconFromBitmap. Expected _wxBitmap_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxIcon *)wxIconFromBitmap(*_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxIcon_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyObject *_wrap_wxStockCursor(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxCursor * _result;
|
||||
@@ -13449,6 +13489,7 @@ static PyMethodDef gdicMethods[] = {
|
||||
{ "wxMemoryDCFromDC", (PyCFunction) _wrap_wxMemoryDCFromDC, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxNamedColour", (PyCFunction) _wrap_wxNamedColour, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxStockCursor", (PyCFunction) _wrap_wxStockCursor, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxIconFromBitmap", (PyCFunction) _wrap_wxIconFromBitmap, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxIconFromXPMData", (PyCFunction) _wrap_wxIconFromXPMData, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxEmptyIcon", (PyCFunction) _wrap_wxEmptyIcon, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxMaskColour", (PyCFunction) _wrap_wxMaskColour, METH_VARARGS | METH_KEYWORDS },
|
||||
|
@@ -1401,6 +1401,11 @@ def wxIconFromXPMData(*_args, **_kwargs):
|
||||
if val: val = wxIconPtr(val); val.thisown = 1
|
||||
return val
|
||||
|
||||
def wxIconFromBitmap(*_args, **_kwargs):
|
||||
val = apply(gdic.wxIconFromBitmap,_args,_kwargs)
|
||||
if val: val = wxIconPtr(val); val.thisown = 1
|
||||
return val
|
||||
|
||||
def wxStockCursor(*_args, **_kwargs):
|
||||
val = apply(gdic.wxStockCursor,_args,_kwargs)
|
||||
if val: val = wxCursorPtr(val); val.thisown = 1
|
||||
|
Reference in New Issue
Block a user