From 262804532ca5be7bc679b73e2fed033de708361a Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 11 Jul 2000 04:49:30 +0000 Subject: [PATCH] small updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/stc/stc_.cpp | 43 +++++++++++++++ wxPython/contrib/stc/stc_.py | 3 + wxPython/demo/wxStyledTextCtrl_1.py | 51 ++++++++++++++++- wxPython/src/controls.i | 3 + wxPython/src/gtk/controls.cpp | 86 +++++++++++++++++++++++++++++ wxPython/src/gtk/controls.py | 9 +++ wxPython/src/msw/controls.cpp | 86 +++++++++++++++++++++++++++++ wxPython/src/msw/controls.py | 9 +++ 8 files changed, 289 insertions(+), 1 deletion(-) diff --git a/wxPython/contrib/stc/stc_.cpp b/wxPython/contrib/stc/stc_.cpp index ef96ff99c8..fe7a375e74 100644 --- a/wxPython/contrib/stc/stc_.cpp +++ b/wxPython/contrib/stc/stc_.cpp @@ -6071,6 +6071,34 @@ static PyObject *_wrap_wxStyledTextCtrl_SetKeywords(PyObject *self, PyObject *ar return _resultobj; } +#define wxStyledTextCtrl_SetModEventMask(_swigobj,_swigarg0) (_swigobj->SetModEventMask(_swigarg0)) +static PyObject *_wrap_wxStyledTextCtrl_SetModEventMask(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxStyledTextCtrl * _arg0; + int _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","mask", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxStyledTextCtrl_SetModEventMask",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextCtrl_SetModEventMask. Expected _wxStyledTextCtrl_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxStyledTextCtrl_SetModEventMask(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxStyledTextEventTowxCommandEvent(void *ptr) { wxStyledTextEvent *src; wxCommandEvent *dest; @@ -7068,6 +7096,7 @@ static PyMethodDef stc_cMethods[] = { { "wxStyledTextEvent_SetPosition", (PyCFunction) _wrap_wxStyledTextEvent_SetPosition, METH_VARARGS | METH_KEYWORDS }, { "delete_wxStyledTextEvent", (PyCFunction) _wrap_delete_wxStyledTextEvent, METH_VARARGS | METH_KEYWORDS }, { "new_wxStyledTextEvent", (PyCFunction) _wrap_new_wxStyledTextEvent, METH_VARARGS | METH_KEYWORDS }, + { "wxStyledTextCtrl_SetModEventMask", (PyCFunction) _wrap_wxStyledTextCtrl_SetModEventMask, METH_VARARGS | METH_KEYWORDS }, { "wxStyledTextCtrl_SetKeywords", (PyCFunction) _wrap_wxStyledTextCtrl_SetKeywords, METH_VARARGS | METH_KEYWORDS }, { "wxStyledTextCtrl_SetProperty", (PyCFunction) _wrap_wxStyledTextCtrl_SetProperty, METH_VARARGS | METH_KEYWORDS }, { "wxStyledTextCtrl_Colourise", (PyCFunction) _wrap_wxStyledTextCtrl_Colourise, METH_VARARGS | METH_KEYWORDS }, @@ -7293,6 +7322,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_wxFontData","_class_wxFontData",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, @@ -7310,6 +7340,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxNotifyEvent","_class_wxNotifyEvent",0}, { "_wxPyTreeCtrl","_class_wxPyTreeCtrl",0}, { "_wxImageHandler","_class_wxImageHandler",0}, + { "_wxLog","_class_wxLog",0}, { "_class_wxToolBarBase","_wxToolBarBase",0}, { "_wxMask","_class_wxMask",0}, { "_wxToolTip","_class_wxToolTip",0}, @@ -7367,6 +7398,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, { "_wxPNMHandler","_class_wxPNMHandler",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, + { "_wxLogGui","_class_wxLogGui",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, { "_wxSysColourChangedEvent","_class_wxSysColourChangedEvent",0}, @@ -7424,11 +7456,13 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxCommandEvent","_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent}, { "_wxCommandEvent","_class_wxCommandEvent",0}, { "_wxSizeEvent","_class_wxSizeEvent",0}, + { "_class_wxLogWindow","_wxLogWindow",0}, { "_class_wxImage","_wxImage",0}, { "_wxPoint","_class_wxPoint",0}, { "_class_wxSashLayoutWindow","_wxSashLayoutWindow",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_class_wxFontData","_wxFontData",0}, { "_class_wxPNMHandler","_wxPNMHandler",0}, { "_wxBoxSizer","_class_wxBoxSizer",0}, @@ -7485,6 +7519,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0}, { "_wxPyApp","_class_wxPyApp",0}, { "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0}, + { "_wxLogTextCtrl","_class_wxLogTextCtrl",0}, { "_wxMDIParentFrame","_class_wxMDIParentFrame",0}, { "_class_wxTreeEvent","_wxTreeEvent",0}, { "_class_wxDirDialog","_wxDirDialog",0}, @@ -7528,6 +7563,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxWindow","_class_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxWindow}, { "_class_wxWindow","_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxWindow}, { "_class_wxWindow","_wxWindow",0}, + { "_class_wxLogStderr","_wxLogStderr",0}, { "_wxSplitterWindow","_class_wxSplitterWindow",0}, { "_class_wxStyledTextEvent","_wxStyledTextEvent",0}, { "_class_wxStaticText","_wxStaticText",0}, @@ -7566,6 +7602,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0}, { "_class_wxImageHandler","_wxImageHandler",0}, { "_wxScrolledWindow","_class_wxScrolledWindow",0}, + { "_class_wxLog","_wxLog",0}, { "_wxTreeItemId","_class_wxTreeItemId",0}, { "_unsigned_char","_byte",0}, { "_class_wxMenu","_wxMenu",0}, @@ -7626,16 +7663,20 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_int","_signed_int",0}, { "_class_wxMouseEvent","_wxMouseEvent",0}, { "_wxPyCommandEvent","_class_wxPyCommandEvent",0}, + { "_wxLogWindow","_class_wxLogWindow",0}, { "_class_wxListEvent","_wxListEvent",0}, { "_class_wxPrintPreview","_wxPrintPreview",0}, { "_class_wxSpinEvent","_wxSpinEvent",0}, { "_class_wxQueryNewPaletteEvent","_wxQueryNewPaletteEvent",0}, { "_class_wxNavigationKeyEvent","_wxNavigationKeyEvent",0}, + { "_wxLogNull","_class_wxLogNull",0}, { "_wxButton","_class_wxButton",0}, { "_class_wxPyApp","_wxPyApp",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, + { "_class_wxLogTextCtrl","_wxLogTextCtrl",0}, + { "_class_wxLogGui","_wxLogGui",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, @@ -7695,6 +7736,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSizeEvent","_wxSizeEvent",0}, { "_class_wxListCtrl","_wxListCtrl",0}, { "_wxCustomDataObject","_class_wxCustomDataObject",0}, + { "_class_wxLogNull","_wxLogNull",0}, { "_class_wxSize","_wxSize",0}, { "_class_wxBitmap","_wxBitmap",0}, { "_class_wxMemoryDC","_wxMemoryDC",0}, @@ -7730,6 +7772,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxWindow","_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxWindow}, { "_wxWindow","_class_wxWindow",0}, { "_class_wxWindowDestroyEvent","_wxWindowDestroyEvent",0}, + { "_wxLogStderr","_class_wxLogStderr",0}, { "_wxStyledTextEvent","_class_wxStyledTextEvent",0}, { "_class_wxFrame","_wxFrame",0}, {0,0,0}}; diff --git a/wxPython/contrib/stc/stc_.py b/wxPython/contrib/stc/stc_.py index fedace7f9d..914062d24d 100644 --- a/wxPython/contrib/stc/stc_.py +++ b/wxPython/contrib/stc/stc_.py @@ -659,6 +659,9 @@ class wxStyledTextCtrlPtr(wxControlPtr): def SetKeywords(self, *_args, **_kwargs): val = apply(stc_c.wxStyledTextCtrl_SetKeywords,(self,) + _args, _kwargs) return val + def SetModEventMask(self, *_args, **_kwargs): + val = apply(stc_c.wxStyledTextCtrl_SetModEventMask,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxStyledTextCtrl(wxStyledTextCtrlPtr): diff --git a/wxPython/demo/wxStyledTextCtrl_1.py b/wxPython/demo/wxStyledTextCtrl_1.py index bfc71e3a79..7fab856c7c 100644 --- a/wxPython/demo/wxStyledTextCtrl_1.py +++ b/wxPython/demo/wxStyledTextCtrl_1.py @@ -45,10 +45,59 @@ else: pb = 10 +#---------------------------------------------------------------------- +# This shows how to catch the Modified event from the wxStyledTextCtrl + +class MySTC(wxStyledTextCtrl): + def __init__(self, parent, ID, log): + wxStyledTextCtrl.__init__(self, parent, ID) + self.log = log + + EVT_STC_MODIFIED(self, ID, self.OnModified) + + + def OnModified(self, evt): + self.log.write("""OnModified + Mod type: %s + At position: %d + Lines added: %d + Text Length: %d + Text: %s\n""" % ( self.transModType(evt.GetModificationType()), + evt.GetPosition(), + evt.GetLinesAdded(), + evt.GetLength(), + evt.GetText() )) + + def transModType(self, modType): + st = "" + table = [(wxSTC_MOD_INSERTTEXT, "InsertText"), + (wxSTC_MOD_DELETETEXT, "DeleteText"), + (wxSTC_MOD_CHANGESTYLE, "ChangeStyle"), + (wxSTC_MOD_CHANGEFOLD, "ChangeFold"), + (wxSTC_PERFORMED_USER, "UserFlag"), + (wxSTC_PERFORMED_UNDO, "Undo"), + (wxSTC_PERFORMED_REDO, "Redo"), + (wxSTC_LASTSTEPINUNDOREDO, "Last-Undo/Redo"), + (wxSTC_MOD_CHANGEMARKER, "ChangeMarker"), + (wxSTC_MOD_BEFOREINSERT, "B4-Insert"), + (wxSTC_MOD_BEFOREDELETE, "B4-Delete") + ] + + for flag,text in table: + if flag & modType: + st = st + text + " " + + if not st: + st = 'UNKNOWN' + + return st + + + #---------------------------------------------------------------------- def runTest(frame, nb, log): - ed = wxStyledTextCtrl(nb, -1) + ed = MySTC(nb, -1, log) ed.SetText(demoText) ed.EmptyUndoBuffer() diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index fe6928cb3d..35fbfd1b81 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -124,6 +124,9 @@ public: void SetBitmapSelected(const wxBitmap& bitmap); void SetBitmapLabel(const wxBitmap& bitmap); + void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; } + int GetMarginX() const { return m_marginX; } + int GetMarginY() const { return m_marginY; } }; //---------------------------------------------------------------------- diff --git a/wxPython/src/gtk/controls.cpp b/wxPython/src/gtk/controls.cpp index 108d47e6ad..e79ba95900 100644 --- a/wxPython/src/gtk/controls.cpp +++ b/wxPython/src/gtk/controls.cpp @@ -938,6 +938,89 @@ static PyObject *_wrap_wxBitmapButton_SetBitmapLabel(PyObject *self, PyObject *a return _resultobj; } +#define wxBitmapButton_SetMargins(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetMargins(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxBitmapButton_SetMargins(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBitmapButton * _arg0; + int _arg1; + int _arg2; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","x","y", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxBitmapButton_SetMargins",_kwnames,&_argo0,&_arg1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmapButton_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmapButton_SetMargins. Expected _wxBitmapButton_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxBitmapButton_SetMargins(_arg0,_arg1,_arg2); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxBitmapButton_GetMarginX(_swigobj) (_swigobj->GetMarginX()) +static PyObject *_wrap_wxBitmapButton_GetMarginX(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxBitmapButton * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBitmapButton_GetMarginX",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmapButton_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmapButton_GetMarginX. Expected _wxBitmapButton_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxBitmapButton_GetMarginX(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxBitmapButton_GetMarginY(_swigobj) (_swigobj->GetMarginY()) +static PyObject *_wrap_wxBitmapButton_GetMarginY(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxBitmapButton * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBitmapButton_GetMarginY",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmapButton_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmapButton_GetMarginY. Expected _wxBitmapButton_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxBitmapButton_GetMarginY(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxCheckBoxTowxControl(void *ptr) { wxCheckBox *src; wxControl *dest; @@ -7413,6 +7496,9 @@ static PyMethodDef controlscMethods[] = { { "wxCheckBox_SetValue", (PyCFunction) _wrap_wxCheckBox_SetValue, METH_VARARGS | METH_KEYWORDS }, { "wxCheckBox_GetValue", (PyCFunction) _wrap_wxCheckBox_GetValue, METH_VARARGS | METH_KEYWORDS }, { "new_wxCheckBox", (PyCFunction) _wrap_new_wxCheckBox, METH_VARARGS | METH_KEYWORDS }, + { "wxBitmapButton_GetMarginY", (PyCFunction) _wrap_wxBitmapButton_GetMarginY, METH_VARARGS | METH_KEYWORDS }, + { "wxBitmapButton_GetMarginX", (PyCFunction) _wrap_wxBitmapButton_GetMarginX, METH_VARARGS | METH_KEYWORDS }, + { "wxBitmapButton_SetMargins", (PyCFunction) _wrap_wxBitmapButton_SetMargins, METH_VARARGS | METH_KEYWORDS }, { "wxBitmapButton_SetBitmapLabel", (PyCFunction) _wrap_wxBitmapButton_SetBitmapLabel, METH_VARARGS | METH_KEYWORDS }, { "wxBitmapButton_SetBitmapSelected", (PyCFunction) _wrap_wxBitmapButton_SetBitmapSelected, METH_VARARGS | METH_KEYWORDS }, { "wxBitmapButton_SetBitmapFocus", (PyCFunction) _wrap_wxBitmapButton_SetBitmapFocus, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/gtk/controls.py b/wxPython/src/gtk/controls.py index a0026e819b..3e6a270097 100644 --- a/wxPython/src/gtk/controls.py +++ b/wxPython/src/gtk/controls.py @@ -91,6 +91,15 @@ class wxBitmapButtonPtr(wxButtonPtr): def SetBitmapLabel(self, *_args, **_kwargs): val = apply(controlsc.wxBitmapButton_SetBitmapLabel,(self,) + _args, _kwargs) return val + def SetMargins(self, *_args, **_kwargs): + val = apply(controlsc.wxBitmapButton_SetMargins,(self,) + _args, _kwargs) + return val + def GetMarginX(self, *_args, **_kwargs): + val = apply(controlsc.wxBitmapButton_GetMarginX,(self,) + _args, _kwargs) + return val + def GetMarginY(self, *_args, **_kwargs): + val = apply(controlsc.wxBitmapButton_GetMarginY,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxBitmapButton(wxBitmapButtonPtr): diff --git a/wxPython/src/msw/controls.cpp b/wxPython/src/msw/controls.cpp index 5c19ec844d..4698f3390c 100644 --- a/wxPython/src/msw/controls.cpp +++ b/wxPython/src/msw/controls.cpp @@ -938,6 +938,89 @@ static PyObject *_wrap_wxBitmapButton_SetBitmapLabel(PyObject *self, PyObject *a return _resultobj; } +#define wxBitmapButton_SetMargins(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetMargins(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxBitmapButton_SetMargins(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBitmapButton * _arg0; + int _arg1; + int _arg2; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","x","y", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxBitmapButton_SetMargins",_kwnames,&_argo0,&_arg1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmapButton_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmapButton_SetMargins. Expected _wxBitmapButton_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxBitmapButton_SetMargins(_arg0,_arg1,_arg2); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxBitmapButton_GetMarginX(_swigobj) (_swigobj->GetMarginX()) +static PyObject *_wrap_wxBitmapButton_GetMarginX(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxBitmapButton * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBitmapButton_GetMarginX",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmapButton_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmapButton_GetMarginX. Expected _wxBitmapButton_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxBitmapButton_GetMarginX(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxBitmapButton_GetMarginY(_swigobj) (_swigobj->GetMarginY()) +static PyObject *_wrap_wxBitmapButton_GetMarginY(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxBitmapButton * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBitmapButton_GetMarginY",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmapButton_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmapButton_GetMarginY. Expected _wxBitmapButton_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxBitmapButton_GetMarginY(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxCheckBoxTowxControl(void *ptr) { wxCheckBox *src; wxControl *dest; @@ -7413,6 +7496,9 @@ static PyMethodDef controlscMethods[] = { { "wxCheckBox_SetValue", (PyCFunction) _wrap_wxCheckBox_SetValue, METH_VARARGS | METH_KEYWORDS }, { "wxCheckBox_GetValue", (PyCFunction) _wrap_wxCheckBox_GetValue, METH_VARARGS | METH_KEYWORDS }, { "new_wxCheckBox", (PyCFunction) _wrap_new_wxCheckBox, METH_VARARGS | METH_KEYWORDS }, + { "wxBitmapButton_GetMarginY", (PyCFunction) _wrap_wxBitmapButton_GetMarginY, METH_VARARGS | METH_KEYWORDS }, + { "wxBitmapButton_GetMarginX", (PyCFunction) _wrap_wxBitmapButton_GetMarginX, METH_VARARGS | METH_KEYWORDS }, + { "wxBitmapButton_SetMargins", (PyCFunction) _wrap_wxBitmapButton_SetMargins, METH_VARARGS | METH_KEYWORDS }, { "wxBitmapButton_SetBitmapLabel", (PyCFunction) _wrap_wxBitmapButton_SetBitmapLabel, METH_VARARGS | METH_KEYWORDS }, { "wxBitmapButton_SetBitmapSelected", (PyCFunction) _wrap_wxBitmapButton_SetBitmapSelected, METH_VARARGS | METH_KEYWORDS }, { "wxBitmapButton_SetBitmapFocus", (PyCFunction) _wrap_wxBitmapButton_SetBitmapFocus, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/controls.py b/wxPython/src/msw/controls.py index a0026e819b..3e6a270097 100644 --- a/wxPython/src/msw/controls.py +++ b/wxPython/src/msw/controls.py @@ -91,6 +91,15 @@ class wxBitmapButtonPtr(wxButtonPtr): def SetBitmapLabel(self, *_args, **_kwargs): val = apply(controlsc.wxBitmapButton_SetBitmapLabel,(self,) + _args, _kwargs) return val + def SetMargins(self, *_args, **_kwargs): + val = apply(controlsc.wxBitmapButton_SetMargins,(self,) + _args, _kwargs) + return val + def GetMarginX(self, *_args, **_kwargs): + val = apply(controlsc.wxBitmapButton_GetMarginX,(self,) + _args, _kwargs) + return val + def GetMarginY(self, *_args, **_kwargs): + val = apply(controlsc.wxBitmapButton_GetMarginY,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxBitmapButton(wxBitmapButtonPtr):