An implementation of wxPen.GetDashes.

wxSplitterEvent derives from wxNotifyEvent.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-05-15 19:46:10 +00:00
parent 23c0ea8c42
commit 756ed80cb8
6 changed files with 68 additions and 4 deletions

View File

@@ -423,9 +423,21 @@ public:
void SetStyle(int style);
void SetWidth(int width);
// **** This one needs to return a list of ints (wxDash)
//int GetDashes(wxDash **dashes);
void SetDashes(int LCOUNT, wxDash* choices);
//int GetDashes(wxDash **dashes);
%addmethods {
PyObject* GetDashes() {
wxDash* dashes;
int count = self->GetDashes(&dashes);
wxPyBeginBlockThreads();
PyObject* retval = PyList_New(0);
for (int x=0; x<count; x++)
PyList_Append(retval, PyInt_FromLong(dashes[x]));
wxPyEndBlockThreads();
return retval;
}
}
#ifdef __WXMSW__
wxBitmap* GetStipple();

View File

@@ -4236,6 +4236,45 @@ static PyObject *_wrap_wxPen_SetDashes(PyObject *self, PyObject *args, PyObject
return _resultobj;
}
static PyObject * wxPen_GetDashes(wxPen *self) {
wxDash* dashes;
int count = self->GetDashes(&dashes);
wxPyBeginBlockThreads();
PyObject* retval = PyList_New(0);
for (int x=0; x<count; x++)
PyList_Append(retval, PyInt_FromLong(dashes[x]));
wxPyEndBlockThreads();
return retval;
}
static PyObject *_wrap_wxPen_GetDashes(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
PyObject * _result;
wxPen * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPen_GetDashes",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPen_GetDashes. Expected _wxPen_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (PyObject *)wxPen_GetDashes(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{
_resultobj = _result;
}
return _resultobj;
}
#define wxPen_GetStipple(_swigobj) (_swigobj->GetStipple())
static PyObject *_wrap_wxPen_GetStipple(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -11327,6 +11366,7 @@ static PyMethodDef gdicMethods[] = {
{ "new_wxPyPen", (PyCFunction) _wrap_new_wxPyPen, METH_VARARGS | METH_KEYWORDS },
{ "wxPen_SetStipple", (PyCFunction) _wrap_wxPen_SetStipple, METH_VARARGS | METH_KEYWORDS },
{ "wxPen_GetStipple", (PyCFunction) _wrap_wxPen_GetStipple, METH_VARARGS | METH_KEYWORDS },
{ "wxPen_GetDashes", (PyCFunction) _wrap_wxPen_GetDashes, METH_VARARGS | METH_KEYWORDS },
{ "wxPen_SetDashes", (PyCFunction) _wrap_wxPen_SetDashes, METH_VARARGS | METH_KEYWORDS },
{ "wxPen_SetWidth", (PyCFunction) _wrap_wxPen_SetWidth, METH_VARARGS | METH_KEYWORDS },
{ "wxPen_SetStyle", (PyCFunction) _wrap_wxPen_SetStyle, METH_VARARGS | METH_KEYWORDS },

View File

@@ -388,6 +388,9 @@ class wxPenPtr(wxGDIObjectPtr):
def SetDashes(self, *_args, **_kwargs):
val = apply(gdic.wxPen_SetDashes,(self,) + _args, _kwargs)
return val
def GetDashes(self, *_args, **_kwargs):
val = apply(gdic.wxPen_GetDashes,(self,) + _args, _kwargs)
return val
def GetStipple(self, *_args, **_kwargs):
val = apply(gdic.wxPen_GetStipple,(self,) + _args, _kwargs)
if val: val = wxBitmapPtr(val)

View File

@@ -1177,6 +1177,14 @@ static PyObject *_wrap_wxNotebook_ResizeChildren(PyObject *self, PyObject *args,
return _resultobj;
}
static void *SwigwxSplitterEventTowxNotifyEvent(void *ptr) {
wxSplitterEvent *src;
wxNotifyEvent *dest;
src = (wxSplitterEvent *) ptr;
dest = (wxNotifyEvent *) src;
return (void *) dest;
}
static void *SwigwxSplitterEventTowxCommandEvent(void *ptr) {
wxSplitterEvent *src;
wxCommandEvent *dest;
@@ -2565,6 +2573,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxPrintQuality","_EBool",0},
{ "_wxPrintQuality","_size_t",0},
{ "_wxPrintQuality","_time_t",0},
{ "_wxNotifyEvent","_wxSplitterEvent",SwigwxSplitterEventTowxNotifyEvent},
{ "_wxNotifyEvent","_wxNotebookEvent",SwigwxNotebookEventTowxNotifyEvent},
{ "_byte","_unsigned_char",0},
{ "_long","_unsigned_long",0},

View File

@@ -129,7 +129,7 @@ def wxPreNotebook(*_args,**_kwargs):
return val
class wxSplitterEventPtr(wxCommandEventPtr):
class wxSplitterEventPtr(wxNotifyEventPtr):
def __init__(self,this):
self.this = this
self.thisown = 0

View File

@@ -158,7 +158,7 @@ enum
};
class wxSplitterEvent : public wxCommandEvent {
class wxSplitterEvent : public wxNotifyEvent {
public:
wxSplitterEvent(wxEventType type = wxEVT_NULL,
wxSplitterWindow *splitter = NULL);