diff --git a/utils/wxPython/CHANGES.txt b/utils/wxPython/CHANGES.txt index 127a1441f9..76adc14a28 100644 --- a/utils/wxPython/CHANGES.txt +++ b/utils/wxPython/CHANGES.txt @@ -38,6 +38,22 @@ method calls, properties, etc., and if the class or a mix-in has matching method names, then the COM events will be propogated back to them. +Created a typemap that allows a string to be used for parameters +expecting a wxColour type. The string is either a colour name as +defined in the wxColourDatabase, or a colour spec of the form +"#RRGGBB". See the wxStyledTextCtrl demo for an example. + +I almost forgot to mention the wxStyledTextCtrl! Yes, the +wxStyledTextCtrl is finally in wxPython!! (And the crowd goes +wild...) There's no documentaTion yet (the crowd boos and hisses...) +but I've included a very readable source file in the +wxPython/demo/data directory, a couple fairly good examples, and you +can also refer to the Scintilla documentaion at +http://www.scintilla.org/ScintillaDoc.html to help fill in the gaps +until the docs are done. (The croud murmers contentedly as the tool +provider smiles convincingly and removes his flame-proof suit.) + + What's new in 2.1.13 diff --git a/utils/wxPython/README.txt b/utils/wxPython/README.txt index 6222375387..a913060bc7 100644 --- a/utils/wxPython/README.txt +++ b/utils/wxPython/README.txt @@ -37,11 +37,11 @@ various sources of help, but probably the best source is the wxPython-users mail list. You can view the archive or subscribe by going to - http://starship.python.net/mailman/listinfo/wxpython-users + http://wxwindows.org/mailman/listinfo/wxpython-users Or you can send mail directly to the list using this address: - wxpython-users@starship.python.net + wxpython-users@wxwindows.org Other Info diff --git a/utils/wxPython/demo/ActiveXWrapper_Acrobat.py b/utils/wxPython/demo/ActiveXWrapper_Acrobat.py index 3115ba0879..e8c1bca10b 100644 --- a/utils/wxPython/demo/ActiveXWrapper_Acrobat.py +++ b/utils/wxPython/demo/ActiveXWrapper_Acrobat.py @@ -1,4 +1,16 @@ """ + +This demo shows how to embed an ActiveX control in a wxPython application, (Win32 only.) +

+The MakeActiveXClass function dynamically builds a new Class on the fly, that has the +same signature and semantics as wxWindow. This means that when you call the function +you get back a new class that you can use just like wxWindow, (set the size and position, +use in a sizer, etc.) except its contents will be the COM control. +

+This demo embeds the Adobe Acrobat Reader, and gives you some buttons for opening a PDF +file, changing pages, etc. that show how to call methods on the COM object. If you don't +have Acrobat Reader 4.0 installed it won't work. + """ from wxPython.wx import * diff --git a/utils/wxPython/demo/ActiveXWrapper_IE.py b/utils/wxPython/demo/ActiveXWrapper_IE.py index a5c1d9062b..a30ad632b3 100644 --- a/utils/wxPython/demo/ActiveXWrapper_IE.py +++ b/utils/wxPython/demo/ActiveXWrapper_IE.py @@ -1,4 +1,16 @@ """ + +This demo shows how to embed an ActiveX control in a wxPython application, (Win32 only.) +

+The MakeActiveXClass function dynamically builds a new Class on the fly, that has the +same signature and semantics as wxWindow. This means that when you call the function +you get back a new class that you can use just like wxWindow, (set the size and position, +use in a sizer, etc.) except its contents will be the COM control. +

+This demo embeds the Internet Exploer WebBrowser control, and shows how to receive events +from the COM control. (The title bar and status bar are updated as pages change, in addition +to the log messages being shown.) + """ from wxPython.wx import * @@ -38,8 +50,12 @@ class TestPanel(wxWindow): self.ie = theClass(self, -1, style=wxSUNKEN_BORDER) - btn = wxButton(self, wxNewId(), " Open ") - EVT_BUTTON(self, btn.GetId(), self.OnOpenButton) + #btn = wxButton(self, wxNewId(), " Open ") + #EVT_BUTTON(self, btn.GetId(), self.OnOpenButton) + #btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5) + + btn = wxButton(self, wxNewId(), " Home ") + EVT_BUTTON(self, btn.GetId(), self.OnHomeButton) btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5) btn = wxButton(self, wxNewId(), " <-- ") @@ -104,6 +120,8 @@ class TestPanel(wxWindow): self.ie.Navigate(self.current) dlg.Destroy() + def OnHomeButton(self, event): + self.ie.GoHome() ## ET Phone Home! def OnPrevPageButton(self, event): self.ie.GoBack() diff --git a/utils/wxPython/demo/Main.py b/utils/wxPython/demo/Main.py index 7758152502..a7a1b42e0e 100644 --- a/utils/wxPython/demo/Main.py +++ b/utils/wxPython/demo/Main.py @@ -14,6 +14,7 @@ import sys, os from wxPython.wx import * from wxPython.lib.splashscreen import SplashScreen +from wxPython.html import wxHtmlWindow #--------------------------------------------------------------------------- @@ -21,7 +22,7 @@ _useSplitter = true _useNestedSplitter = true _treeList = [ - ('New since last release', ['wxGrid', 'wxStyledTextCtrl', + ('New since last release', ['wxGrid', 'wxStyledTextCtrl_1', 'ActiveXWrapper_Acrobat', 'ActiveXWrapper_IE', 'FileBrowseButton', 'wxCalendar']), @@ -157,12 +158,13 @@ class wxPythonDemo(wxFrame): EVT_TREE_ITEM_EXPANDED (self.tree, tID, self.OnItemExpanded) EVT_TREE_ITEM_COLLAPSED (self.tree, tID, self.OnItemCollapsed) EVT_TREE_SEL_CHANGED (self.tree, tID, self.OnSelChanged) + EVT_LEFT_DOWN (self.tree, self.OnTreeLeftDown) # Create a Notebook self.nb = wxNotebook(nbParent, -1) # Set up a TextCtrl on the Overview Notebook page - self.ovr = wxTextCtrl(self.nb, -1, style = wxTE_MULTILINE|wxTE_READONLY) + self.ovr = wxHtmlWindow(self.nb, -1) self.nb.AddPage(self.ovr, "Overview") @@ -241,6 +243,16 @@ class wxPythonDemo(wxFrame): item = event.GetItem() self.log.WriteText("OnItemCollapsed: %s\n" % self.tree.GetItemText(item)) + + #--------------------------------------------- + def OnTreeLeftDown(self, event): + pt = event.GetPosition(); + item, flags = self.tree.HitTest(pt) + if item == self.tree.GetSelection(): + self.SetOverview(self.tree.GetItemText(item), self.curOverview) + else: + event.Skip() + #--------------------------------------------- def OnSelChanged(self, event): if self.dying: @@ -284,7 +296,7 @@ class wxPythonDemo(wxFrame): self.nb.SetSelection(2) else: - self.ovr.Clear() + self.ovr.SetPage("") self.txt.Clear() self.window = None @@ -307,11 +319,13 @@ class wxPythonDemo(wxFrame): #--------------------------------------------- def SetOverview(self, name, text): - self.ovr.Clear() - self.ovr.WriteText(text) + self.curOverview = text + lead = text[:6] + if lead != '' and lead != '') + #text = '

' + text + '
' + self.ovr.SetPage(text) self.nb.SetPageText(0, name) - self.ovr.SetInsertionPoint(0) - self.ovr.ShowPosition(0) #--------------------------------------------- # Menu methods @@ -399,29 +413,27 @@ def main(): overview = """\ -Python ------------- + +

Python

Python is an interpreted, interactive, object-oriented programming language often compared to Tcl, Perl, Scheme, or Java. - +

Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing. There are interfaces to many system calls and libraries, and new built-in modules are easily written in C or C++. Python is also usable as an extension language for applications that need a programmable interface. - -wxWindows --------------------- +

+

wxWindows

wxWindows is a free C++ framework designed to make cross-platform programming child's play. Well, almost. wxWindows 2 supports Windows 3.1/95/98/NT, Unix with GTK/Motif/Lesstif, with a Mac version underway. Other ports are under consideration. - +

wxWindows is a set of libraries that allows C++ applications to compile and run on several different types of computers, with minimal source code changes. There is one library per supported GUI (such as Motif, or Windows). As well as providing a common API (Application Programming Interface) for GUI functionality, it provides functionality for accessing some commonly-used operating system facilities, such as copying or deleting files. wxWindows is a 'framework' in the sense that it provides a lot of built-in functionality, which the application can use or replace as required, thus saving a great deal of coding effort. Basic data structures such as strings, linked lists and hash tables are also supported. - -wxPython ----------------- +

+

wxPython

wxPython is a Python extension module that encapsulates the wxWindows GUI classes. Currently it is only available for the Win32 and GTK ports of wxWindows, but as soon as the other ports are brought up to the same level as Win32 and GTK, it should be fairly trivial to enable wxPython to be used with the new GUI. - +

The wxPython extension module attempts to mirror the class heiarchy of wxWindows as closely as possible. This means that there is a wxFrame class in wxPython that looks, smells, tastes and acts almost the same as the wxFrame class in the C++ version. Unfortunately, because of differences in the languages, wxPython doesn't match wxWindows exactly, but the differences should be easy to absorb because they are natural to Python. For example, some methods that return multiple values via argument pointers in C++ will return a tuple of values in Python. - +

There is still much to be done for wxPython, many classes still need to be mirrored. Also, wxWindows is still somewhat of a moving target so it is a bit of an effort just keeping wxPython up to date. On the other hand, there are enough of the core classes completed that useful applications can be written. - +

wxPython is close enough to the C++ version that the majority of the wxPython documentation is actually just notes attached to the C++ documents that describe the places where wxPython is different. There is also a series of sample programs included, and a series of documentation pages that assist the programmer in getting started with wxPython. """ diff --git a/utils/wxPython/demo/wxCalendar.py b/utils/wxPython/demo/wxCalendar.py index cf49fc2d9f..27e6f631c2 100644 --- a/utils/wxPython/demo/wxCalendar.py +++ b/utils/wxPython/demo/wxCalendar.py @@ -715,6 +715,7 @@ def runTest(frame, nb, log): overview = """\ This control provides a calendar control class for displaying and selecting dates. In addition, the class is extended and can now be used for printing/previewing. + Additional features include weekend highlighting and business type Monday-Sunday format. See example for various methods used to set display month, year, and highlighted dates (different font and background colours). diff --git a/utils/wxPython/demo/wxGrid.py b/utils/wxPython/demo/wxGrid.py index f4baf69d71..cdb508bf30 100644 --- a/utils/wxPython/demo/wxGrid.py +++ b/utils/wxPython/demo/wxGrid.py @@ -55,5 +55,32 @@ def runTest(frame, nb, log): overview = """\ -This demo shows various ways of using the ** NEW ** wxGrid. For more details see wxPython/demo/Grid*.py. + +

wxGrid

+ +This demo shows various ways of using the new and improved wxGrid class. +Unfortunatly it has not been documented yet, and while it is somewhat backwards compatible, +if you try to go by the current wxGrid documentation you will probably just confuse yourself. +

+You can look at the sources for these samples to learn a lot about how the new classes work. +

    +
  1. GridSimple.py A simple grid that shows how to catch all the +various events. +

    +

  2. GridStdEdRend.py A grid that uses non-default Cell Editors +and Cell Renderers. +

    +

  3. GridHugeTable.py A grid that uses a non-default Grid Table. +This table is read-only and simply generates on the fly a unique string for each cell. +

    +

  4. GridCustTable.py This grid shows how to deal with tables +that have non-string data, and how Cell Editors and Cell Renderers are automatically chosen +based on the data type. +

    +

+

+You can also look at the SWIG interface file used to generate +the grid module for a lot more clues as to how things work. + """ + diff --git a/utils/wxPython/demo/wxStyledTextCtrl_1.py b/utils/wxPython/demo/wxStyledTextCtrl_1.py new file mode 100644 index 0000000000..563a8b2750 --- /dev/null +++ b/utils/wxPython/demo/wxStyledTextCtrl_1.py @@ -0,0 +1,81 @@ + +from wxPython.wx import * +from wxPython.stc import * + +#---------------------------------------------------------------------- + +demoText = """\ + +This editor is provided by a class named wxStyledTextCtrl. As +the name suggests, you can define styles that can be applied to +sections of text. This will typically be used for things like +syntax highlighting code editors, but I'm sure that there are other +applications as well. A style is a combination of font, point size, +forground and background colours. The editor can handle +proportional fonts just as easily as monospaced fonts, and various +styles can use different sized fonts. + +There are a few canned language lexers and colourizers included, +(see the next demo) or you can handle the colourization yourself. +If you do you can simply register an event handler and the editor +will let you know when the visible portion of the text needs +styling. + +wxStyledTextEditor also supports setting markers in the margin... + + + + +...and indicators within the text. You can use these for whatever +you want in your application. Drag and Drop of text works, as well +as virtually unlimited Undo and Redo capabilities, (right click to +try it out.) + +""" + + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + ed = wxStyledTextCtrl(nb, -1) + + ed.SetText(demoText) + + ed.SetMarginType(0, wxSTC_MARGIN_NUMBER) + ed.SetMarginWidth(0, 22) + ed.StyleSetSpec(wxSTC_STYLE_LINENUMBER, "size:6,face:Ariel") + + ed.SetMarginType(1, wxSTC_MARGIN_SYMBOL) + ed.MarkerDefine(0, wxSTC_MARK_ROUNDRECT, "#DD0FCC", "RED") + ed.MarkerDefine(1, wxSTC_MARK_CIRCLE, "FOREST GREEN", "SIENNA") + ed.MarkerDefine(2, wxSTC_MARK_SHORTARROW, "blue", "blue") + ed.MarkerDefine(3, wxSTC_MARK_ARROW, "#00FF00", "#00FF00") + + ed.MarkerAdd(17, 0) + ed.MarkerAdd(18, 1) + ed.MarkerAdd(19, 2) + ed.MarkerAdd(20, 3) + ed.MarkerAdd(20, 0) + + + return ed + + + +#---------------------------------------------------------------------- + + +overview = """\ +""" + + + +if __name__ == '__main__': + import sys + app = wxPySimpleApp() + frame = wxFrame(None, -1, "Tester...", size=(640, 480)) + win = runTest(frame, frame, sys.stdout) + frame.Show(true) + app.MainLoop() + + diff --git a/utils/wxPython/modules/stc/stc.cpp b/utils/wxPython/modules/stc/stc.cpp index 1b7ea8ad9d..5d08a25e27 100644 --- a/utils/wxPython/modules/stc/stc.cpp +++ b/utils/wxPython/modules/stc/stc.cpp @@ -140,18 +140,17 @@ static PyObject *_wrap_new_wxStyledTextCtrl(PyObject *self, PyObject *args, PyOb wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) 0; - wxString * _arg5 = (wxString *) &(wxSTCNameStr); + char * _arg5 = (char *) (wxSTCNameStr); PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; - PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxStyledTextCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxStyledTextCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -171,18 +170,10 @@ static PyObject *_wrap_new_wxStyledTextCtrl(PyObject *self, PyObject *args, PyOb _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; -} - if (_obj5) -{ - if (!PyString_Check(_obj5)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg5 = new wxString(PyString_AsString(_obj5), PyString_Size(_obj5)); } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxStyledTextCtrl *)new_wxStyledTextCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); + _result = (wxStyledTextCtrl *)new_wxStyledTextCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); wxPy_END_ALLOW_THREADS; } if (_result) { @@ -192,10 +183,6 @@ static PyObject *_wrap_new_wxStyledTextCtrl(PyObject *self, PyObject *args, PyOb Py_INCREF(Py_None); _resultobj = Py_None; } -{ - if (_obj5) - delete _arg5; -} return _resultobj; } @@ -2683,11 +2670,12 @@ static PyObject *_wrap_wxStyledTextCtrl_StyleSetForeground(PyObject *self, PyObj int _arg1; wxColour * _arg2; PyObject * _argo0 = 0; - PyObject * _argo2 = 0; + wxColour temp; + PyObject * _obj2 = 0; char *_kwnames[] = { "self","styleNum","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxStyledTextCtrl_StyleSetForeground",_kwnames,&_argo0,&_arg1,&_argo2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxStyledTextCtrl_StyleSetForeground",_kwnames,&_argo0,&_arg1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2696,13 +2684,11 @@ static PyObject *_wrap_wxStyledTextCtrl_StyleSetForeground(PyObject *self, PyObj return NULL; } } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxStyledTextCtrl_StyleSetForeground. Expected _wxColour_p."); +{ + _arg2 = &temp; + if (! wxColour_helper(_obj2, &_arg2)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxStyledTextCtrl_StyleSetForeground(_arg0,_arg1,*_arg2); @@ -2720,11 +2706,12 @@ static PyObject *_wrap_wxStyledTextCtrl_StyleSetBackground(PyObject *self, PyObj int _arg1; wxColour * _arg2; PyObject * _argo0 = 0; - PyObject * _argo2 = 0; + wxColour temp; + PyObject * _obj2 = 0; char *_kwnames[] = { "self","styleNum","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxStyledTextCtrl_StyleSetBackground",_kwnames,&_argo0,&_arg1,&_argo2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxStyledTextCtrl_StyleSetBackground",_kwnames,&_argo0,&_arg1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2733,13 +2720,11 @@ static PyObject *_wrap_wxStyledTextCtrl_StyleSetBackground(PyObject *self, PyObj return NULL; } } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxStyledTextCtrl_StyleSetBackground. Expected _wxColour_p."); +{ + _arg2 = &temp; + if (! wxColour_helper(_obj2, &_arg2)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxStyledTextCtrl_StyleSetBackground(_arg0,_arg1,*_arg2); @@ -3317,11 +3302,12 @@ static PyObject *_wrap_wxStyledTextCtrl_SetSelectionForeground(PyObject *self, P wxStyledTextCtrl * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextCtrl_SetSelectionForeground",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextCtrl_SetSelectionForeground",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3330,13 +3316,11 @@ static PyObject *_wrap_wxStyledTextCtrl_SetSelectionForeground(PyObject *self, P return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxStyledTextCtrl_SetSelectionForeground. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxStyledTextCtrl_SetSelectionForeground(_arg0,*_arg1); @@ -3353,11 +3337,12 @@ static PyObject *_wrap_wxStyledTextCtrl_SetSelectionBackground(PyObject *self, P wxStyledTextCtrl * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextCtrl_SetSelectionBackground",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextCtrl_SetSelectionBackground",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3366,13 +3351,11 @@ static PyObject *_wrap_wxStyledTextCtrl_SetSelectionBackground(PyObject *self, P return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxStyledTextCtrl_SetSelectionBackground. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxStyledTextCtrl_SetSelectionBackground(_arg0,*_arg1); @@ -3389,11 +3372,12 @@ static PyObject *_wrap_wxStyledTextCtrl_SetCaretForeground(PyObject *self, PyObj wxStyledTextCtrl * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextCtrl_SetCaretForeground",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextCtrl_SetCaretForeground",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3402,13 +3386,11 @@ static PyObject *_wrap_wxStyledTextCtrl_SetCaretForeground(PyObject *self, PyObj return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxStyledTextCtrl_SetCaretForeground. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxStyledTextCtrl_SetCaretForeground(_arg0,*_arg1); @@ -3667,12 +3649,14 @@ static PyObject *_wrap_wxStyledTextCtrl_MarkerDefine(PyObject *self, PyObject *a wxColour * _arg3; wxColour * _arg4; PyObject * _argo0 = 0; - PyObject * _argo3 = 0; - PyObject * _argo4 = 0; + wxColour temp; + PyObject * _obj3 = 0; + wxColour temp0; + PyObject * _obj4 = 0; char *_kwnames[] = { "self","markerNumber","markerSymbol","foreground","background", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiOO:wxStyledTextCtrl_MarkerDefine",_kwnames,&_argo0,&_arg1,&_arg2,&_argo3,&_argo4)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiOO:wxStyledTextCtrl_MarkerDefine",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_obj4)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3681,20 +3665,16 @@ static PyObject *_wrap_wxStyledTextCtrl_MarkerDefine(PyObject *self, PyObject *a return NULL; } } - if (_argo3) { - if (_argo3 == Py_None) { _arg3 = NULL; } - else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxStyledTextCtrl_MarkerDefine. Expected _wxColour_p."); +{ + _arg3 = &temp; + if (! wxColour_helper(_obj3, &_arg3)) return NULL; - } - } - if (_argo4) { - if (_argo4 == Py_None) { _arg4 = NULL; } - else if (SWIG_GetPtrObj(_argo4,(void **) &_arg4,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 5 of wxStyledTextCtrl_MarkerDefine. Expected _wxColour_p."); +} +{ + _arg4 = &temp0; + if (! wxColour_helper(_obj4, &_arg4)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxStyledTextCtrl_MarkerDefine(_arg0,_arg1,_arg2,*_arg3,*_arg4); @@ -3741,11 +3721,12 @@ static PyObject *_wrap_wxStyledTextCtrl_MarkerSetForeground(PyObject *self, PyOb int _arg1; wxColour * _arg2; PyObject * _argo0 = 0; - PyObject * _argo2 = 0; + wxColour temp; + PyObject * _obj2 = 0; char *_kwnames[] = { "self","markerNumber","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxStyledTextCtrl_MarkerSetForeground",_kwnames,&_argo0,&_arg1,&_argo2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxStyledTextCtrl_MarkerSetForeground",_kwnames,&_argo0,&_arg1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3754,13 +3735,11 @@ static PyObject *_wrap_wxStyledTextCtrl_MarkerSetForeground(PyObject *self, PyOb return NULL; } } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxStyledTextCtrl_MarkerSetForeground. Expected _wxColour_p."); +{ + _arg2 = &temp; + if (! wxColour_helper(_obj2, &_arg2)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxStyledTextCtrl_MarkerSetForeground(_arg0,_arg1,*_arg2); @@ -3778,11 +3757,12 @@ static PyObject *_wrap_wxStyledTextCtrl_MarkerSetBackground(PyObject *self, PyOb int _arg1; wxColour * _arg2; PyObject * _argo0 = 0; - PyObject * _argo2 = 0; + wxColour temp; + PyObject * _obj2 = 0; char *_kwnames[] = { "self","markerNumber","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxStyledTextCtrl_MarkerSetBackground",_kwnames,&_argo0,&_arg1,&_argo2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxStyledTextCtrl_MarkerSetBackground",_kwnames,&_argo0,&_arg1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3791,13 +3771,11 @@ static PyObject *_wrap_wxStyledTextCtrl_MarkerSetBackground(PyObject *self, PyOb return NULL; } } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxStyledTextCtrl_MarkerSetBackground. Expected _wxColour_p."); +{ + _arg2 = &temp; + if (! wxColour_helper(_obj2, &_arg2)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxStyledTextCtrl_MarkerSetBackground(_arg0,_arg1,*_arg2); @@ -4100,11 +4078,12 @@ static PyObject *_wrap_wxStyledTextCtrl_IndicatorSetColour(PyObject *self, PyObj int _arg1; wxColour * _arg2; PyObject * _argo0 = 0; - PyObject * _argo2 = 0; + wxColour temp; + PyObject * _obj2 = 0; char *_kwnames[] = { "self","indicNum","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxStyledTextCtrl_IndicatorSetColour",_kwnames,&_argo0,&_arg1,&_argo2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxStyledTextCtrl_IndicatorSetColour",_kwnames,&_argo0,&_arg1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4113,13 +4092,11 @@ static PyObject *_wrap_wxStyledTextCtrl_IndicatorSetColour(PyObject *self, PyObj return NULL; } } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxStyledTextCtrl_IndicatorSetColour. Expected _wxColour_p."); +{ + _arg2 = &temp; + if (! wxColour_helper(_obj2, &_arg2)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxStyledTextCtrl_IndicatorSetColour(_arg0,_arg1,*_arg2); @@ -4475,11 +4452,12 @@ static PyObject *_wrap_wxStyledTextCtrl_CallTipSetBackground(PyObject *self, PyO wxStyledTextCtrl * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextCtrl_CallTipSetBackground",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextCtrl_CallTipSetBackground",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4488,13 +4466,11 @@ static PyObject *_wrap_wxStyledTextCtrl_CallTipSetBackground(PyObject *self, PyO return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxStyledTextCtrl_CallTipSetBackground. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxStyledTextCtrl_CallTipSetBackground(_arg0,*_arg1); @@ -5267,11 +5243,12 @@ static PyObject *_wrap_wxStyledTextCtrl_SetEdgeColour(PyObject *self, PyObject * wxStyledTextCtrl * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextCtrl_SetEdgeColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextCtrl_SetEdgeColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5280,13 +5257,11 @@ static PyObject *_wrap_wxStyledTextCtrl_SetEdgeColour(PyObject *self, PyObject * return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxStyledTextCtrl_SetEdgeColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxStyledTextCtrl_SetEdgeColour(_arg0,*_arg1); @@ -7142,6 +7117,11 @@ SWIGEXPORT(void) initstcc() { PyDict_SetItemString(d,"wxSTC_CMD_ZOOMOUT", PyInt_FromLong((long) wxSTC_CMD_ZOOMOUT)); PyDict_SetItemString(d,"wxSTC_CMD_DELWORDLEFT", PyInt_FromLong((long) wxSTC_CMD_DELWORDLEFT)); PyDict_SetItemString(d,"wxSTC_CMD_DELWORDRIGHT", PyInt_FromLong((long) wxSTC_CMD_DELWORDRIGHT)); + PyDict_SetItemString(d,"wxSTC_CMD_LINECUT", PyInt_FromLong((long) wxSTC_CMD_LINECUT)); + PyDict_SetItemString(d,"wxSTC_CMD_LINEDELETE", PyInt_FromLong((long) wxSTC_CMD_LINEDELETE)); + PyDict_SetItemString(d,"wxSTC_CMD_LINETRANSPOSE", PyInt_FromLong((long) wxSTC_CMD_LINETRANSPOSE)); + PyDict_SetItemString(d,"wxSTC_CMD_LOWERCASE", PyInt_FromLong((long) wxSTC_CMD_LOWERCASE)); + PyDict_SetItemString(d,"wxSTC_CMD_UPPERCASE", PyInt_FromLong((long) wxSTC_CMD_UPPERCASE)); PyDict_SetItemString(d,"wxSTC_LEX_CONTAINER", PyInt_FromLong((long) wxSTC_LEX_CONTAINER)); PyDict_SetItemString(d,"wxSTC_LEX_NULL", PyInt_FromLong((long) wxSTC_LEX_NULL)); PyDict_SetItemString(d,"wxSTC_LEX_PYTHON", PyInt_FromLong((long) wxSTC_LEX_PYTHON)); diff --git a/utils/wxPython/modules/stc/stc.i b/utils/wxPython/modules/stc/stc.i index aaaa78803f..7dd3437945 100644 --- a/utils/wxPython/modules/stc/stc.i +++ b/utils/wxPython/modules/stc/stc.i @@ -117,7 +117,12 @@ enum { wxSTC_CMD_ZOOMIN, wxSTC_CMD_ZOOMOUT, wxSTC_CMD_DELWORDLEFT, - wxSTC_CMD_DELWORDRIGHT + wxSTC_CMD_DELWORDRIGHT, + wxSTC_CMD_LINECUT, + wxSTC_CMD_LINEDELETE, + wxSTC_CMD_LINETRANSPOSE, + wxSTC_CMD_LOWERCASE, + wxSTC_CMD_UPPERCASE }; @@ -163,7 +168,7 @@ public: wxStyledTextCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxSTCNameStr); + const char* name = wxSTCNameStr); //~wxStyledTextCtrl(); diff --git a/utils/wxPython/modules/stc/stc.py b/utils/wxPython/modules/stc/stc.py index a65871038e..0bcb9a1a88 100644 --- a/utils/wxPython/modules/stc/stc.py +++ b/utils/wxPython/modules/stc/stc.py @@ -784,6 +784,11 @@ wxSTC_CMD_ZOOMIN = stcc.wxSTC_CMD_ZOOMIN wxSTC_CMD_ZOOMOUT = stcc.wxSTC_CMD_ZOOMOUT wxSTC_CMD_DELWORDLEFT = stcc.wxSTC_CMD_DELWORDLEFT wxSTC_CMD_DELWORDRIGHT = stcc.wxSTC_CMD_DELWORDRIGHT +wxSTC_CMD_LINECUT = stcc.wxSTC_CMD_LINECUT +wxSTC_CMD_LINEDELETE = stcc.wxSTC_CMD_LINEDELETE +wxSTC_CMD_LINETRANSPOSE = stcc.wxSTC_CMD_LINETRANSPOSE +wxSTC_CMD_LOWERCASE = stcc.wxSTC_CMD_LOWERCASE +wxSTC_CMD_UPPERCASE = stcc.wxSTC_CMD_UPPERCASE wxSTC_LEX_CONTAINER = stcc.wxSTC_LEX_CONTAINER wxSTC_LEX_NULL = stcc.wxSTC_LEX_NULL wxSTC_LEX_PYTHON = stcc.wxSTC_LEX_PYTHON diff --git a/utils/wxPython/src/controls2.i b/utils/wxPython/src/controls2.i index 91293f3622..f424df14a7 100644 --- a/utils/wxPython/src/controls2.i +++ b/utils/wxPython/src/controls2.i @@ -378,6 +378,11 @@ public: ~wxTreeItemId(); bool IsOk(); + %addmethods { + int __cmp__(wxTreeItemId* other) { + return *self != *other; + } + } }; diff --git a/utils/wxPython/src/grid.i b/utils/wxPython/src/grid.i index c6d4bb27e2..d3165104b5 100644 --- a/utils/wxPython/src/grid.i +++ b/utils/wxPython/src/grid.i @@ -4,7 +4,7 @@ // // Author: Robin Dunn // -// Created: 6/2/98 +// Created: 17-March-2000 // RCS-ID: $Id$ // Copyright: (c) 1998 by Total Control Software // Licence: wxWindows license @@ -1345,6 +1345,7 @@ public: void DisableCellEditControl(); bool CanEnableCellControl() const; bool IsCellEditControlEnabled() const; + bool IsCellEditControlShown() const; bool IsCurrentCellReadOnly() const; diff --git a/utils/wxPython/src/helpers.cpp b/utils/wxPython/src/helpers.cpp index 14ce153771..2df0ad24d6 100644 --- a/utils/wxPython/src/helpers.cpp +++ b/utils/wxPython/src/helpers.cpp @@ -928,6 +928,39 @@ bool wxRect_helper(PyObject* source, wxRect** obj) { +bool wxColour_helper(PyObject* source, wxColour** obj) { + + // If source is an object instance then it may already be the right type + if (PyInstance_Check(source)) { + wxColour* ptr; + if (SWIG_GetPtrObj(source, (void **)&ptr, "_wxColour_p")) + goto error; + *obj = ptr; + return TRUE; + } + // otherwise a string is expected + else if (PyString_Check(source)) { + wxString spec = PyString_AS_STRING(source); + if (spec[0] == '#' && spec.Length() == 7) { // It's #RRGGBB + char* junk; + int red = strtol(spec.Mid(1,2), &junk, 16); + int green = strtol(spec.Mid(3,2), &junk, 16); + int blue = strtol(spec.Mid(5,2), &junk, 16); + **obj = wxColour(red, green, blue); + return TRUE; + } + else { // it's a colour name + **obj = wxColour(spec); + return TRUE; + } + } + + error: + PyErr_SetString(PyExc_TypeError, "Expected a wxColour object or a string containing a colour name or #RRGGBB."); + return FALSE; +} + + //---------------------------------------------------------------------- //---------------------------------------------------------------------- //---------------------------------------------------------------------- diff --git a/utils/wxPython/src/helpers.h b/utils/wxPython/src/helpers.h index 45e6d1aeaf..87335078b2 100644 --- a/utils/wxPython/src/helpers.h +++ b/utils/wxPython/src/helpers.h @@ -102,6 +102,7 @@ HELPEREXPORT bool wxSize_helper(PyObject* source, wxSize** obj); HELPEREXPORT bool wxPoint_helper(PyObject* source, wxPoint** obj); HELPEREXPORT bool wxRealPoint_helper(PyObject* source, wxRealPoint** obj); HELPEREXPORT bool wxRect_helper(PyObject* source, wxRect** obj); +HELPEREXPORT bool wxColour_helper(PyObject* source, wxColour** obj); //---------------------------------------------------------------------- diff --git a/utils/wxPython/src/msw/cmndlgs.cpp b/utils/wxPython/src/msw/cmndlgs.cpp index d70f92c95b..06b503691b 100644 --- a/utils/wxPython/src/msw/cmndlgs.cpp +++ b/utils/wxPython/src/msw/cmndlgs.cpp @@ -288,11 +288,12 @@ static PyObject *_wrap_wxColourData_SetColour(PyObject *self, PyObject *args, Py wxColourData * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxColourData_SetColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxColourData_SetColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -301,13 +302,11 @@ static PyObject *_wrap_wxColourData_SetColour(PyObject *self, PyObject *args, Py return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxColourData_SetColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxColourData_SetColour(_arg0,*_arg1); @@ -325,11 +324,12 @@ static PyObject *_wrap_wxColourData_SetCustomColour(PyObject *self, PyObject *ar int _arg1; wxColour * _arg2; PyObject * _argo0 = 0; - PyObject * _argo2 = 0; + wxColour temp; + PyObject * _obj2 = 0; char *_kwnames[] = { "self","i","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxColourData_SetCustomColour",_kwnames,&_argo0,&_arg1,&_argo2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxColourData_SetCustomColour",_kwnames,&_argo0,&_arg1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -338,13 +338,11 @@ static PyObject *_wrap_wxColourData_SetCustomColour(PyObject *self, PyObject *ar return NULL; } } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxColourData_SetCustomColour. Expected _wxColour_p."); +{ + _arg2 = &temp; + if (! wxColour_helper(_obj2, &_arg2)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxColourData_SetCustomColour(_arg0,_arg1,*_arg2); @@ -2092,11 +2090,12 @@ static PyObject *_wrap_wxFontData_SetColour(PyObject *self, PyObject *args, PyOb wxFontData * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxFontData_SetColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxFontData_SetColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2105,13 +2104,11 @@ static PyObject *_wrap_wxFontData_SetColour(PyObject *self, PyObject *args, PyOb return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxFontData_SetColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxFontData_SetColour(_arg0,*_arg1); diff --git a/utils/wxPython/src/msw/controls.cpp b/utils/wxPython/src/msw/controls.cpp index c0a2ac8a20..0a8888568f 100644 --- a/utils/wxPython/src/msw/controls.cpp +++ b/utils/wxPython/src/msw/controls.cpp @@ -484,11 +484,12 @@ static PyObject *_wrap_wxButton_SetBackgroundColour(PyObject *self, PyObject *ar wxButton * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxButton_SetBackgroundColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxButton_SetBackgroundColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -497,13 +498,11 @@ static PyObject *_wrap_wxButton_SetBackgroundColour(PyObject *self, PyObject *ar return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxButton_SetBackgroundColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxButton_SetBackgroundColour(_arg0,*_arg1); @@ -520,11 +519,12 @@ static PyObject *_wrap_wxButton_SetForegroundColour(PyObject *self, PyObject *ar wxButton * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxButton_SetForegroundColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxButton_SetForegroundColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -533,13 +533,11 @@ static PyObject *_wrap_wxButton_SetForegroundColour(PyObject *self, PyObject *ar return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxButton_SetForegroundColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxButton_SetForegroundColour(_arg0,*_arg1); diff --git a/utils/wxPython/src/msw/controls2.cpp b/utils/wxPython/src/msw/controls2.cpp index 5445b5d7e0..5d0972aeeb 100644 --- a/utils/wxPython/src/msw/controls2.cpp +++ b/utils/wxPython/src/msw/controls2.cpp @@ -191,11 +191,12 @@ static PyObject *_wrap_wxListItemAttr_SetTextColour(PyObject *self, PyObject *ar wxListItemAttr * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colText", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListItemAttr_SetTextColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListItemAttr_SetTextColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -204,13 +205,11 @@ static PyObject *_wrap_wxListItemAttr_SetTextColour(PyObject *self, PyObject *ar return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListItemAttr_SetTextColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxListItemAttr_SetTextColour(_arg0,*_arg1); @@ -227,11 +226,12 @@ static PyObject *_wrap_wxListItemAttr_SetBackgroundColour(PyObject *self, PyObje wxListItemAttr * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colBack", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListItemAttr_SetBackgroundColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListItemAttr_SetBackgroundColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -240,13 +240,11 @@ static PyObject *_wrap_wxListItemAttr_SetBackgroundColour(PyObject *self, PyObje return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListItemAttr_SetBackgroundColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxListItemAttr_SetBackgroundColour(_arg0,*_arg1); @@ -883,11 +881,12 @@ static PyObject *_wrap_wxListItem_SetTextColour(PyObject *self, PyObject *args, wxListItem * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colText", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListItem_SetTextColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListItem_SetTextColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -896,13 +895,11 @@ static PyObject *_wrap_wxListItem_SetTextColour(PyObject *self, PyObject *args, return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListItem_SetTextColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxListItem_SetTextColour(_arg0,*_arg1); @@ -919,11 +916,12 @@ static PyObject *_wrap_wxListItem_SetBackgroundColour(PyObject *self, PyObject * wxListItem * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colBack", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListItem_SetBackgroundColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListItem_SetBackgroundColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -932,13 +930,11 @@ static PyObject *_wrap_wxListItem_SetBackgroundColour(PyObject *self, PyObject * return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListItem_SetBackgroundColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxListItem_SetBackgroundColour(_arg0,*_arg1); @@ -3736,11 +3732,12 @@ static PyObject *_wrap_wxListCtrl_SetTextColour(PyObject *self, PyObject *args, wxListCtrl * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","col", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_SetTextColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_SetTextColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3749,13 +3746,11 @@ static PyObject *_wrap_wxListCtrl_SetTextColour(PyObject *self, PyObject *args, return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListCtrl_SetTextColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxListCtrl_SetTextColour(_arg0,*_arg1); @@ -4101,11 +4096,12 @@ static PyObject *_wrap_wxListCtrl_SetBackgroundColour(PyObject *self, PyObject * wxListCtrl * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","col", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_SetBackgroundColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_SetBackgroundColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4114,13 +4110,11 @@ static PyObject *_wrap_wxListCtrl_SetBackgroundColour(PyObject *self, PyObject * return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListCtrl_SetBackgroundColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxListCtrl_SetBackgroundColour(_arg0,*_arg1); @@ -4654,6 +4648,44 @@ static PyObject *_wrap_wxTreeItemId_IsOk(PyObject *self, PyObject *args, PyObjec return _resultobj; } +static int wxTreeItemId___cmp__(wxTreeItemId *self,wxTreeItemId * other) { + return *self != *other; + } +static PyObject *_wrap_wxTreeItemId___cmp__(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxTreeItemId * _arg0; + wxTreeItemId * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","other", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxTreeItemId___cmp__",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTreeItemId_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTreeItemId___cmp__. Expected _wxTreeItemId_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTreeItemId_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTreeItemId___cmp__. Expected _wxTreeItemId_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxTreeItemId___cmp__(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + #define new_wxTreeItemData(_swigarg0) (new wxPyTreeItemData(_swigarg0)) static PyObject *_wrap_new_wxTreeItemData(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -7388,11 +7420,12 @@ static PyObject *_wrap_wxTreeCtrl_SetItemTextColour(PyObject *self, PyObject *ar wxColour * _arg2; PyObject * _argo0 = 0; PyObject * _argo1 = 0; - PyObject * _argo2 = 0; + wxColour temp; + PyObject * _obj2 = 0; char *_kwnames[] = { "self","item","col", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxTreeCtrl_SetItemTextColour",_kwnames,&_argo0,&_argo1,&_argo2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxTreeCtrl_SetItemTextColour",_kwnames,&_argo0,&_argo1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -7408,13 +7441,11 @@ static PyObject *_wrap_wxTreeCtrl_SetItemTextColour(PyObject *self, PyObject *ar return NULL; } } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxTreeCtrl_SetItemTextColour. Expected _wxColour_p."); +{ + _arg2 = &temp; + if (! wxColour_helper(_obj2, &_arg2)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxTreeCtrl_SetItemTextColour(_arg0,*_arg1,*_arg2); @@ -7433,11 +7464,12 @@ static PyObject *_wrap_wxTreeCtrl_SetItemBackgroundColour(PyObject *self, PyObje wxColour * _arg2; PyObject * _argo0 = 0; PyObject * _argo1 = 0; - PyObject * _argo2 = 0; + wxColour temp; + PyObject * _obj2 = 0; char *_kwnames[] = { "self","item","col", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxTreeCtrl_SetItemBackgroundColour",_kwnames,&_argo0,&_argo1,&_argo2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxTreeCtrl_SetItemBackgroundColour",_kwnames,&_argo0,&_argo1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -7453,13 +7485,11 @@ static PyObject *_wrap_wxTreeCtrl_SetItemBackgroundColour(PyObject *self, PyObje return NULL; } } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxTreeCtrl_SetItemBackgroundColour. Expected _wxColour_p."); +{ + _arg2 = &temp; + if (! wxColour_helper(_obj2, &_arg2)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxTreeCtrl_SetItemBackgroundColour(_arg0,*_arg1,*_arg2); @@ -7681,6 +7711,7 @@ static PyMethodDef controls2cMethods[] = { { "wxTreeItemData_SetData", (PyCFunction) _wrap_wxTreeItemData_SetData, METH_VARARGS | METH_KEYWORDS }, { "wxTreeItemData_GetData", (PyCFunction) _wrap_wxTreeItemData_GetData, METH_VARARGS | METH_KEYWORDS }, { "new_wxTreeItemData", (PyCFunction) _wrap_new_wxTreeItemData, METH_VARARGS | METH_KEYWORDS }, + { "wxTreeItemId___cmp__", (PyCFunction) _wrap_wxTreeItemId___cmp__, METH_VARARGS | METH_KEYWORDS }, { "wxTreeItemId_IsOk", (PyCFunction) _wrap_wxTreeItemId_IsOk, METH_VARARGS | METH_KEYWORDS }, { "delete_wxTreeItemId", (PyCFunction) _wrap_delete_wxTreeItemId, METH_VARARGS | METH_KEYWORDS }, { "new_wxTreeItemId", (PyCFunction) _wrap_new_wxTreeItemId, METH_VARARGS | METH_KEYWORDS }, diff --git a/utils/wxPython/src/msw/controls2.py b/utils/wxPython/src/msw/controls2.py index 3814192950..bbb4b11a7f 100644 --- a/utils/wxPython/src/msw/controls2.py +++ b/utils/wxPython/src/msw/controls2.py @@ -500,6 +500,9 @@ class wxTreeItemIdPtr : def IsOk(self, *_args, **_kwargs): val = apply(controls2c.wxTreeItemId_IsOk,(self,) + _args, _kwargs) return val + def __cmp__(self, *_args, **_kwargs): + val = apply(controls2c.wxTreeItemId___cmp__,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxTreeItemId(wxTreeItemIdPtr): diff --git a/utils/wxPython/src/msw/gdi.cpp b/utils/wxPython/src/msw/gdi.cpp index e5cd14e6e5..02bf9cbc08 100644 --- a/utils/wxPython/src/msw/gdi.cpp +++ b/utils/wxPython/src/msw/gdi.cpp @@ -263,12 +263,13 @@ static PyObject *_wrap_wxMaskColour(PyObject *self, PyObject *args, PyObject *kw wxBitmap * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "bitmap","colour", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxMaskColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxMaskColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -277,13 +278,11 @@ static PyObject *_wrap_wxMaskColour(PyObject *self, PyObject *args, PyObject *kw return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxMaskColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; _result = (wxMask *)wxMaskColour(*_arg0,*_arg1); @@ -3200,19 +3199,18 @@ static PyObject *_wrap_new_wxColour(PyObject *self, PyObject *args, PyObject *kw static PyObject *_wrap_delete_wxColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxColour * _arg0; - PyObject * _argo0 = 0; + wxColour temp; + PyObject * _obj0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxColour",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxColour",_kwnames,&_obj0)) return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxColour. Expected _wxColour_p."); +{ + _arg0 = &temp; + if (! wxColour_helper(_obj0, &_arg0)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; delete_wxColour(_arg0); @@ -3228,19 +3226,18 @@ static PyObject *_wrap_wxColour_Red(PyObject *self, PyObject *args, PyObject *kw PyObject * _resultobj; unsigned char _result; wxColour * _arg0; - PyObject * _argo0 = 0; + wxColour temp; + PyObject * _obj0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxColour_Red",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxColour_Red",_kwnames,&_obj0)) return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxColour_Red. Expected _wxColour_p."); +{ + _arg0 = &temp; + if (! wxColour_helper(_obj0, &_arg0)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; _result = (unsigned char )wxColour_Red(_arg0); @@ -3255,19 +3252,18 @@ static PyObject *_wrap_wxColour_Green(PyObject *self, PyObject *args, PyObject * PyObject * _resultobj; unsigned char _result; wxColour * _arg0; - PyObject * _argo0 = 0; + wxColour temp; + PyObject * _obj0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxColour_Green",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxColour_Green",_kwnames,&_obj0)) return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxColour_Green. Expected _wxColour_p."); +{ + _arg0 = &temp; + if (! wxColour_helper(_obj0, &_arg0)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; _result = (unsigned char )wxColour_Green(_arg0); @@ -3282,19 +3278,18 @@ static PyObject *_wrap_wxColour_Blue(PyObject *self, PyObject *args, PyObject *k PyObject * _resultobj; unsigned char _result; wxColour * _arg0; - PyObject * _argo0 = 0; + wxColour temp; + PyObject * _obj0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxColour_Blue",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxColour_Blue",_kwnames,&_obj0)) return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxColour_Blue. Expected _wxColour_p."); +{ + _arg0 = &temp; + if (! wxColour_helper(_obj0, &_arg0)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; _result = (unsigned char )wxColour_Blue(_arg0); @@ -3309,19 +3304,18 @@ static PyObject *_wrap_wxColour_Ok(PyObject *self, PyObject *args, PyObject *kwa PyObject * _resultobj; bool _result; wxColour * _arg0; - PyObject * _argo0 = 0; + wxColour temp; + PyObject * _obj0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxColour_Ok",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxColour_Ok",_kwnames,&_obj0)) return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxColour_Ok. Expected _wxColour_p."); +{ + _arg0 = &temp; + if (! wxColour_helper(_obj0, &_arg0)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; _result = (bool )wxColour_Ok(_arg0); @@ -3338,19 +3332,18 @@ static PyObject *_wrap_wxColour_Set(PyObject *self, PyObject *args, PyObject *kw unsigned char _arg1; unsigned char _arg2; unsigned char _arg3; - PyObject * _argo0 = 0; + wxColour temp; + PyObject * _obj0 = 0; char *_kwnames[] = { "self","red","green","blue", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Obbb:wxColour_Set",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Obbb:wxColour_Set",_kwnames,&_obj0,&_arg1,&_arg2,&_arg3)) return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxColour_Set. Expected _wxColour_p."); +{ + _arg0 = &temp; + if (! wxColour_helper(_obj0, &_arg0)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxColour_Set(_arg0,_arg1,_arg2,_arg3); @@ -3372,19 +3365,18 @@ static PyObject *_wrap_wxColour_Get(PyObject *self, PyObject *args, PyObject *kw PyObject * _resultobj; PyObject * _result; wxColour * _arg0; - PyObject * _argo0 = 0; + wxColour temp; + PyObject * _obj0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxColour_Get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxColour_Get",_kwnames,&_obj0)) return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxColour_Get. Expected _wxColour_p."); +{ + _arg0 = &temp; + if (! wxColour_helper(_obj0, &_arg0)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; _result = (PyObject *)wxColour_Get(_arg0); @@ -3406,20 +3398,19 @@ static PyObject *_wrap_new_wxPen(PyObject *self, PyObject *args, PyObject *kwarg wxColour * _arg0; int _arg1 = (int ) 1; int _arg2 = (int ) wxSOLID; - PyObject * _argo0 = 0; + wxColour temp; + PyObject * _obj0 = 0; char *_kwnames[] = { "colour","width","style", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|ii:new_wxPen",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|ii:new_wxPen",_kwnames,&_obj0,&_arg1,&_arg2)) return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxPen. Expected _wxColour_p."); +{ + _arg0 = &temp; + if (! wxColour_helper(_obj0, &_arg0)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; _result = (wxPen *)new_wxPen(_arg0,_arg1,_arg2); @@ -3639,11 +3630,12 @@ static PyObject *_wrap_wxPen_SetColour(PyObject *self, PyObject *args, PyObject wxPen * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPen_SetColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPen_SetColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3652,13 +3644,11 @@ static PyObject *_wrap_wxPen_SetColour(PyObject *self, PyObject *args, PyObject return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPen_SetColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxPen_SetColour(_arg0,*_arg1); @@ -3916,20 +3906,19 @@ static PyObject *_wrap_new_wxBrush(PyObject *self, PyObject *args, PyObject *kwa wxBrush * _result; wxColour * _arg0; int _arg1 = (int ) wxSOLID; - PyObject * _argo0 = 0; + wxColour temp; + PyObject * _obj0 = 0; char *_kwnames[] = { "colour","style", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:new_wxBrush",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:new_wxBrush",_kwnames,&_obj0,&_arg1)) return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxBrush. Expected _wxColour_p."); +{ + _arg0 = &temp; + if (! wxColour_helper(_obj0, &_arg0)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; _result = (wxBrush *)new_wxBrush(_arg0,_arg1); @@ -4074,11 +4063,12 @@ static PyObject *_wrap_wxBrush_SetColour(PyObject *self, PyObject *args, PyObjec wxBrush * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxBrush_SetColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxBrush_SetColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4087,13 +4077,11 @@ static PyObject *_wrap_wxBrush_SetColour(PyObject *self, PyObject *args, PyObjec return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxBrush_SetColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxBrush_SetColour(_arg0,*_arg1); @@ -5073,11 +5061,12 @@ static PyObject *_wrap_wxDC_FloodFill(PyObject *self, PyObject *args, PyObject * wxColour * _arg3; int _arg4 = (int ) wxFLOOD_SURFACE; PyObject * _argo0 = 0; - PyObject * _argo3 = 0; + wxColour temp; + PyObject * _obj3 = 0; char *_kwnames[] = { "self","x","y","colour","style", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OllO|i:wxDC_FloodFill",_kwnames,&_argo0,&_arg1,&_arg2,&_argo3,&_arg4)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OllO|i:wxDC_FloodFill",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_arg4)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5086,13 +5075,11 @@ static PyObject *_wrap_wxDC_FloodFill(PyObject *self, PyObject *args, PyObject * return NULL; } } - if (_argo3) { - if (_argo3 == Py_None) { _arg3 = NULL; } - else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxDC_FloodFill. Expected _wxColour_p."); +{ + _arg3 = &temp; + if (! wxColour_helper(_obj3, &_arg3)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxDC_FloodFill(_arg0,_arg1,_arg2,*_arg3,_arg4); @@ -6539,11 +6526,12 @@ static PyObject *_wrap_wxDC_SetTextBackground(PyObject *self, PyObject *args, Py wxDC * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDC_SetTextBackground",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDC_SetTextBackground",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -6552,13 +6540,11 @@ static PyObject *_wrap_wxDC_SetTextBackground(PyObject *self, PyObject *args, Py return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDC_SetTextBackground. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxDC_SetTextBackground(_arg0,*_arg1); @@ -6575,11 +6561,12 @@ static PyObject *_wrap_wxDC_SetTextForeground(PyObject *self, PyObject *args, Py wxDC * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDC_SetTextForeground",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDC_SetTextForeground",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -6588,13 +6575,11 @@ static PyObject *_wrap_wxDC_SetTextForeground(PyObject *self, PyObject *args, Py return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDC_SetTextForeground. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxDC_SetTextForeground(_arg0,*_arg1); @@ -7807,11 +7792,12 @@ static PyObject *_wrap_wxImageList_AddWithColourMask(PyObject *self, PyObject *a wxColour * _arg2; PyObject * _argo0 = 0; PyObject * _argo1 = 0; - PyObject * _argo2 = 0; + wxColour temp; + PyObject * _obj2 = 0; char *_kwnames[] = { "self","bitmap","maskColour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxImageList_AddWithColourMask",_kwnames,&_argo0,&_argo1,&_argo2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxImageList_AddWithColourMask",_kwnames,&_argo0,&_argo1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -7827,13 +7813,11 @@ static PyObject *_wrap_wxImageList_AddWithColourMask(PyObject *self, PyObject *a return NULL; } } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxImageList_AddWithColourMask. Expected _wxColour_p."); +{ + _arg2 = &temp; + if (! wxColour_helper(_obj2, &_arg2)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; _result = (int )wxImageList_AddWithColourMask(_arg0,*_arg1,*_arg2); diff --git a/utils/wxPython/src/msw/grid.cpp b/utils/wxPython/src/msw/grid.cpp index 0e990d2d72..abfb51b9b1 100644 --- a/utils/wxPython/src/msw/grid.cpp +++ b/utils/wxPython/src/msw/grid.cpp @@ -2671,11 +2671,12 @@ static PyObject *_wrap_wxGridCellAttr_SetTextColour(PyObject *self, PyObject *ar wxGridCellAttr * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colText", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGridCellAttr_SetTextColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGridCellAttr_SetTextColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2684,13 +2685,11 @@ static PyObject *_wrap_wxGridCellAttr_SetTextColour(PyObject *self, PyObject *ar return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGridCellAttr_SetTextColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxGridCellAttr_SetTextColour(_arg0,*_arg1); @@ -2707,11 +2706,12 @@ static PyObject *_wrap_wxGridCellAttr_SetBackgroundColour(PyObject *self, PyObje wxGridCellAttr * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colBack", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGridCellAttr_SetBackgroundColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGridCellAttr_SetBackgroundColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2720,13 +2720,11 @@ static PyObject *_wrap_wxGridCellAttr_SetBackgroundColour(PyObject *self, PyObje return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGridCellAttr_SetBackgroundColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxGridCellAttr_SetBackgroundColour(_arg0,*_arg1); @@ -7373,6 +7371,33 @@ static PyObject *_wrap_wxGrid_IsCellEditControlEnabled(PyObject *self, PyObject return _resultobj; } +#define wxGrid_IsCellEditControlShown(_swigobj) (_swigobj->IsCellEditControlShown()) +static PyObject *_wrap_wxGrid_IsCellEditControlShown(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxGrid * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGrid_IsCellEditControlShown",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGrid_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGrid_IsCellEditControlShown. Expected _wxGrid_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxGrid_IsCellEditControlShown(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + #define wxGrid_IsCurrentCellReadOnly(_swigobj) (_swigobj->IsCurrentCellReadOnly()) static PyObject *_wrap_wxGrid_IsCurrentCellReadOnly(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -8548,11 +8573,12 @@ static PyObject *_wrap_wxGrid_SetLabelBackgroundColour(PyObject *self, PyObject wxGrid * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","arg2", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetLabelBackgroundColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetLabelBackgroundColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -8561,13 +8587,11 @@ static PyObject *_wrap_wxGrid_SetLabelBackgroundColour(PyObject *self, PyObject return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGrid_SetLabelBackgroundColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxGrid_SetLabelBackgroundColour(_arg0,*_arg1); @@ -8584,11 +8608,12 @@ static PyObject *_wrap_wxGrid_SetLabelTextColour(PyObject *self, PyObject *args, wxGrid * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","arg2", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetLabelTextColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetLabelTextColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -8597,13 +8622,11 @@ static PyObject *_wrap_wxGrid_SetLabelTextColour(PyObject *self, PyObject *args, return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGrid_SetLabelTextColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxGrid_SetLabelTextColour(_arg0,*_arg1); @@ -8796,11 +8819,12 @@ static PyObject *_wrap_wxGrid_SetGridLineColour(PyObject *self, PyObject *args, wxGrid * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","arg2", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetGridLineColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetGridLineColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -8809,13 +8833,11 @@ static PyObject *_wrap_wxGrid_SetGridLineColour(PyObject *self, PyObject *args, return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGrid_SetGridLineColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxGrid_SetGridLineColour(_arg0,*_arg1); @@ -10051,11 +10073,12 @@ static PyObject *_wrap_wxGrid_SetDefaultCellBackgroundColour(PyObject *self, PyO wxGrid * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","arg2", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetDefaultCellBackgroundColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetDefaultCellBackgroundColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -10064,13 +10087,11 @@ static PyObject *_wrap_wxGrid_SetDefaultCellBackgroundColour(PyObject *self, PyO return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGrid_SetDefaultCellBackgroundColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxGrid_SetDefaultCellBackgroundColour(_arg0,*_arg1); @@ -10089,11 +10110,12 @@ static PyObject *_wrap_wxGrid_SetCellBackgroundColour(PyObject *self, PyObject * int _arg2; wxColour * _arg3; PyObject * _argo0 = 0; - PyObject * _argo3 = 0; + wxColour temp; + PyObject * _obj3 = 0; char *_kwnames[] = { "self","row","col","arg4", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiO:wxGrid_SetCellBackgroundColour",_kwnames,&_argo0,&_arg1,&_arg2,&_argo3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiO:wxGrid_SetCellBackgroundColour",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -10102,13 +10124,11 @@ static PyObject *_wrap_wxGrid_SetCellBackgroundColour(PyObject *self, PyObject * return NULL; } } - if (_argo3) { - if (_argo3 == Py_None) { _arg3 = NULL; } - else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxGrid_SetCellBackgroundColour. Expected _wxColour_p."); +{ + _arg3 = &temp; + if (! wxColour_helper(_obj3, &_arg3)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxGrid_SetCellBackgroundColour(_arg0,_arg1,_arg2,*_arg3); @@ -10125,11 +10145,12 @@ static PyObject *_wrap_wxGrid_SetDefaultCellTextColour(PyObject *self, PyObject wxGrid * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","arg2", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetDefaultCellTextColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetDefaultCellTextColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -10138,13 +10159,11 @@ static PyObject *_wrap_wxGrid_SetDefaultCellTextColour(PyObject *self, PyObject return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGrid_SetDefaultCellTextColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxGrid_SetDefaultCellTextColour(_arg0,*_arg1); @@ -10163,11 +10182,12 @@ static PyObject *_wrap_wxGrid_SetCellTextColour(PyObject *self, PyObject *args, int _arg2; wxColour * _arg3; PyObject * _argo0 = 0; - PyObject * _argo3 = 0; + wxColour temp; + PyObject * _obj3 = 0; char *_kwnames[] = { "self","row","col","arg4", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiO:wxGrid_SetCellTextColour",_kwnames,&_argo0,&_arg1,&_arg2,&_argo3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiO:wxGrid_SetCellTextColour",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -10176,13 +10196,11 @@ static PyObject *_wrap_wxGrid_SetCellTextColour(PyObject *self, PyObject *args, return NULL; } } - if (_argo3) { - if (_argo3 == Py_None) { _arg3 = NULL; } - else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxGrid_SetCellTextColour. Expected _wxColour_p."); +{ + _arg3 = &temp; + if (! wxColour_helper(_obj3, &_arg3)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxGrid_SetCellTextColour(_arg0,_arg1,_arg2,*_arg3); @@ -11093,11 +11111,12 @@ static PyObject *_wrap_wxGrid_SetSelectionBackground(PyObject *self, PyObject *a wxGrid * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","c", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetSelectionBackground",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetSelectionBackground",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -11106,13 +11125,11 @@ static PyObject *_wrap_wxGrid_SetSelectionBackground(PyObject *self, PyObject *a return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGrid_SetSelectionBackground. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxGrid_SetSelectionBackground(_arg0,*_arg1); @@ -11129,11 +11146,12 @@ static PyObject *_wrap_wxGrid_SetSelectionForeground(PyObject *self, PyObject *a wxGrid * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","c", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetSelectionForeground",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetSelectionForeground",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -11142,13 +11160,11 @@ static PyObject *_wrap_wxGrid_SetSelectionForeground(PyObject *self, PyObject *a return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGrid_SetSelectionForeground. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxGrid_SetSelectionForeground(_arg0,*_arg1); @@ -12495,6 +12511,7 @@ static PyMethodDef gridcMethods[] = { { "wxGrid_HideCellEditControl", (PyCFunction) _wrap_wxGrid_HideCellEditControl, METH_VARARGS | METH_KEYWORDS }, { "wxGrid_ShowCellEditControl", (PyCFunction) _wrap_wxGrid_ShowCellEditControl, METH_VARARGS | METH_KEYWORDS }, { "wxGrid_IsCurrentCellReadOnly", (PyCFunction) _wrap_wxGrid_IsCurrentCellReadOnly, METH_VARARGS | METH_KEYWORDS }, + { "wxGrid_IsCellEditControlShown", (PyCFunction) _wrap_wxGrid_IsCellEditControlShown, METH_VARARGS | METH_KEYWORDS }, { "wxGrid_IsCellEditControlEnabled", (PyCFunction) _wrap_wxGrid_IsCellEditControlEnabled, METH_VARARGS | METH_KEYWORDS }, { "wxGrid_CanEnableCellControl", (PyCFunction) _wrap_wxGrid_CanEnableCellControl, METH_VARARGS | METH_KEYWORDS }, { "wxGrid_DisableCellEditControl", (PyCFunction) _wrap_wxGrid_DisableCellEditControl, METH_VARARGS | METH_KEYWORDS }, diff --git a/utils/wxPython/src/msw/grid.py b/utils/wxPython/src/msw/grid.py index e962cc3a3b..d94382d479 100644 --- a/utils/wxPython/src/msw/grid.py +++ b/utils/wxPython/src/msw/grid.py @@ -898,6 +898,9 @@ class wxGridPtr(wxScrolledWindowPtr): def IsCellEditControlEnabled(self, *_args, **_kwargs): val = apply(gridc.wxGrid_IsCellEditControlEnabled,(self,) + _args, _kwargs) return val + def IsCellEditControlShown(self, *_args, **_kwargs): + val = apply(gridc.wxGrid_IsCellEditControlShown,(self,) + _args, _kwargs) + return val def IsCurrentCellReadOnly(self, *_args, **_kwargs): val = apply(gridc.wxGrid_IsCurrentCellReadOnly,(self,) + _args, _kwargs) return val diff --git a/utils/wxPython/src/msw/windows.cpp b/utils/wxPython/src/msw/windows.cpp index fbfaec2b39..aa8807d7c3 100644 --- a/utils/wxPython/src/msw/windows.cpp +++ b/utils/wxPython/src/msw/windows.cpp @@ -3480,11 +3480,12 @@ static PyObject *_wrap_wxWindow_SetBackgroundColour(PyObject *self, PyObject *ar wxWindow * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_SetBackgroundColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_SetBackgroundColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3493,13 +3494,11 @@ static PyObject *_wrap_wxWindow_SetBackgroundColour(PyObject *self, PyObject *ar return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxWindow_SetBackgroundColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxWindow_SetBackgroundColour(_arg0,*_arg1); @@ -3678,11 +3677,12 @@ static PyObject *_wrap_wxWindow_SetForegroundColour(PyObject *self, PyObject *ar wxWindow * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; + wxColour temp; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","colour", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_SetForegroundColour",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_SetForegroundColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3691,13 +3691,11 @@ static PyObject *_wrap_wxWindow_SetForegroundColour(PyObject *self, PyObject *ar return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxWindow_SetForegroundColour. Expected _wxColour_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; wxWindow_SetForegroundColour(_arg0,*_arg1); diff --git a/utils/wxPython/src/my_typemaps.i b/utils/wxPython/src/my_typemaps.i index fb0fdfc0aa..9ee9ee6479 100644 --- a/utils/wxPython/src/my_typemaps.i +++ b/utils/wxPython/src/my_typemaps.i @@ -220,6 +220,16 @@ static char* wxStringErrorMsg = "string type is required for parameter"; return NULL; } +//--------------------------------------------------------------------------- +// Typemap to convert strings to wxColour. Two string formats are accepted, +// either a colour name, for a hex colour spec like "#RRGGBB" + +%typemap(python,in) wxColour& (wxColour temp) { + $target = &temp; + if (! wxColour_helper($source, &$target)) + return NULL; +} + //--------------------------------------------------------------------------- // Map T_OUTPUTs for floats to return ints.