From a72f4631fe5ab7ebeefdacf8ec9c826ea962133f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 23 Sep 2004 20:23:54 +0000 Subject: [PATCH] Update SWIG patch to output "True" ("False") in the autodoc string when "true" ("false") is in the .i file. Changed the .i files to use true/false to avoid collisions with any True/False in headers that may be included. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29290 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/SWIG/swig.python-2.patch | 26 ++++--- wxPython/contrib/activex/activex.i | 8 +- wxPython/contrib/gizmos/gizmos.i | 26 +++---- wxPython/contrib/iewin/iewin.i | 4 +- wxPython/contrib/ogl/_oglbasic.i | 36 ++++----- wxPython/contrib/ogl/_oglshapes.i | 42 +++++------ wxPython/contrib/ogl/_oglshapes2.i | 30 ++++---- wxPython/include/wx/wxPython/pyistream.h | 8 +- wxPython/include/wx/wxPython/wxPython.h | 2 +- wxPython/include/wx/wxPython/wxPython_int.h | 58 +++++++------- wxPython/src/_app.i | 4 +- wxPython/src/_bitmap.i | 4 +- wxPython/src/_clipbrd.i | 2 +- wxPython/src/_config.i | 16 ++-- wxPython/src/_core_api.i | 2 +- wxPython/src/_cshelp.i | 2 +- wxPython/src/_cursor.i | 2 +- wxPython/src/_dataobj.i | 16 ++-- wxPython/src/_datetime.i | 44 +++++------ wxPython/src/_dc.i | 12 +-- wxPython/src/_display.i | 4 +- wxPython/src/_dnd.i | 2 +- wxPython/src/_dragimg.i | 2 +- wxPython/src/_event.i | 12 +-- wxPython/src/_filesys.i | 2 +- wxPython/src/_font.i | 16 ++-- wxPython/src/_functions.i | 12 +-- wxPython/src/_gbsizer.i | 20 ++--- wxPython/src/_gdicmn.i | 6 +- wxPython/src/_image.i | 12 +-- wxPython/src/_imaglist.i | 4 +- wxPython/src/_intl.i | 4 +- wxPython/src/_joystick.i | 20 ++--- wxPython/src/_listbox.i | 6 +- wxPython/src/_listctrl.i | 10 +-- wxPython/src/_log.i | 10 +-- wxPython/src/_menu.i | 8 +- wxPython/src/_mimetype.i | 6 +- wxPython/src/_misc.i | 4 +- wxPython/src/_notebook.i | 9 +-- wxPython/src/_panel.i | 2 +- wxPython/src/_pen.i | 4 +- wxPython/src/_printfw.i | 56 +++++++------- wxPython/src/_radio.i | 4 +- wxPython/src/_scrolbar.i | 2 +- wxPython/src/_sizers.i | 40 +++++----- wxPython/src/_sound.i | 4 +- wxPython/src/_splitter.i | 2 +- wxPython/src/_stockobjs.i | 2 +- wxPython/src/_streams.i | 8 +- wxPython/src/_textctrl.i | 2 +- wxPython/src/_timer.i | 6 +- wxPython/src/_tipdlg.i | 2 +- wxPython/src/_toplvl.i | 4 +- wxPython/src/_treectrl.i | 30 ++++---- wxPython/src/_validator.i | 4 +- wxPython/src/_vscroll.i | 4 +- wxPython/src/_window.i | 26 +++---- wxPython/src/_xmlhandler.i | 14 ++-- wxPython/src/calendar.i | 6 +- wxPython/src/grid.i | 84 ++++++++++----------- wxPython/src/html.i | 12 +-- wxPython/src/my_typemaps.i | 16 ++-- wxPython/src/wizard.i | 4 +- 64 files changed, 425 insertions(+), 426 deletions(-) diff --git a/wxPython/SWIG/swig.python-2.patch b/wxPython/SWIG/swig.python-2.patch index 5ce3520e44..5ff6aacaef 100644 --- a/wxPython/SWIG/swig.python-2.patch +++ b/wxPython/SWIG/swig.python-2.patch @@ -4,7 +4,7 @@ RCS file: /cvsroot/swig/SWIG/Doc/Manual/Python.html,v retrieving revision 1.18 diff -u -4 -r1.18 Python.html --- Doc/Manual/Python.html 2 Sep 2004 20:27:14 -0000 1.18 -+++ Doc/Manual/Python.html 6 Sep 2004 21:06:11 -0000 ++++ Doc/Manual/Python.html 23 Sep 2004 00:31:44 -0000 @@ -86,8 +86,15 @@
  • Mapping Python tuples into small arrays
  • Mapping sequences to C arrays @@ -282,7 +282,7 @@ RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v retrieving revision 1.50 diff -u -4 -r1.50 python.cxx --- Source/Modules/python.cxx 1 Sep 2004 22:25:56 -0000 1.50 -+++ Source/Modules/python.cxx 6 Sep 2004 21:06:11 -0000 ++++ Source/Modules/python.cxx 23 Sep 2004 00:31:44 -0000 @@ -19,8 +19,9 @@ static String *const_code = 0; @@ -413,7 +413,7 @@ diff -u -4 -r1.50 python.cxx } -@@ -440,24 +486,303 @@ +@@ -440,24 +486,307 @@ } @@ -662,6 +662,10 @@ diff -u -4 -r1.50 python.cxx + if (value) { + if (Strcmp(value, "NULL") == 0) + value = NewString("None"); ++ else if (Strcmp(value, "true") == 0 || Strcmp(value, "TRUE") == 0) ++ value = NewString("True"); ++ else if (Strcmp(value, "false") == 0 || Strcmp(value, "FALSE") == 0) ++ value = NewString("False"); + else { + lookup = Swig_symbol_clookup(value, 0); + if (lookup) @@ -725,7 +729,7 @@ diff -u -4 -r1.50 python.cxx if (*t == '{') { Delitem(str ,0); Delitem(str,DOH_END); -@@ -1686,9 +2011,18 @@ +@@ -1686,9 +2015,18 @@ mod = Getattr(n,"module"); if (mod) { String *modname = Getattr(mod,"name"); @@ -745,7 +749,7 @@ diff -u -4 -r1.50 python.cxx importname = NewString(Getattr(n,"sym:name")); } Setattr(n,"python:proxy",importname); -@@ -1760,9 +2094,11 @@ +@@ -1760,9 +2098,11 @@ Printf(f_shadow, modern ? "(object)" : "(_object)"); } } @@ -758,7 +762,7 @@ diff -u -4 -r1.50 python.cxx Printv(f_shadow,tab4,"__swig_setmethods__ = {}\n",NIL); if (Len(base_class)) { Printf(f_shadow,"%sfor _s in [%s]: __swig_setmethods__.update(_s.__swig_setmethods__)\n",tab4,base_class); -@@ -1906,16 +2242,24 @@ +@@ -1906,16 +2246,24 @@ Delete(pyaction); Printv(f_shadow,pycode,"\n",NIL); } else { @@ -790,7 +794,7 @@ diff -u -4 -r1.50 python.cxx } } -@@ -1930,14 +2274,22 @@ +@@ -1930,14 +2278,22 @@ virtual int staticmemberfunctionHandler(Node *n) { String *symname = Getattr(n,"sym:name"); Language::staticmemberfunctionHandler(n); @@ -817,7 +821,7 @@ diff -u -4 -r1.50 python.cxx " = staticmethod(", symname, ")\n", NIL); if (!modern) { -@@ -2022,8 +2374,12 @@ +@@ -2022,8 +2378,12 @@ } Printv(f_shadow, tab4, "def __init__(self, *args", @@ -830,7 +834,7 @@ diff -u -4 -r1.50 python.cxx if (!modern) { Printv(f_shadow, tab8, "_swig_setattr(self, ", rclassname, ", 'this', ", funcCallHelper(Swig_name_construct(symname), allow_kwargs), ")\n", NIL); -@@ -2036,10 +2392,10 @@ +@@ -2036,10 +2396,10 @@ Printv(f_shadow, tab8, "self.this = newobj.this\n", NIL); Printv(f_shadow, tab8, "self.thisown = 1\n", NIL); Printv(f_shadow, tab8, "del newobj.thisown\n", NIL); @@ -843,7 +847,7 @@ diff -u -4 -r1.50 python.cxx } have_constructor = 1; } else { -@@ -2055,13 +2411,17 @@ +@@ -2055,13 +2415,17 @@ } else { Printv(f_shadow_stubs, "\ndef ", symname, "(*args", @@ -863,7 +867,7 @@ diff -u -4 -r1.50 python.cxx } } } -@@ -2088,13 +2448,18 @@ +@@ -2088,13 +2452,18 @@ Delete(pyaction); Printv(f_shadow,pycode,"\n", NIL); } else { diff --git a/wxPython/contrib/activex/activex.i b/wxPython/contrib/activex/activex.i index 6fe37547fa..bb3852c793 100644 --- a/wxPython/contrib/activex/activex.i +++ b/wxPython/contrib/activex/activex.i @@ -57,7 +57,7 @@ typedef unsigned short VARTYPE; // Some conversion helpers static wxVariant _PyObj2Variant(PyObject* value); static bool _PyObj2Variant(PyObject* value, wxVariant& wv); -static PyObject* _Variant2PyObj(wxVariant& value, bool useNone=False); +static PyObject* _Variant2PyObj(wxVariant& value, bool useNone=false); static wxString _VARTYPEname(VARTYPE vt); // Check if an exception has been raised (blocking threads) @@ -460,7 +460,7 @@ public: // conversion errors for now wxVariant wv; MSWVariantToVariant(rv, wv); - rval = _Variant2PyObj(wv, True); + rval = _Variant2PyObj(wv, true); VariantClear(&rv); if (func.hasOut) { @@ -477,7 +477,7 @@ public: const wxParamX &px = func.params[i]; if (px.IsOut()) { MSWVariantToVariant(va, wv); - PyObject* obj = _Variant2PyObj(wv, True); + PyObject* obj = _Variant2PyObj(wv, true); PyList_Append(lst, obj); } } @@ -642,7 +642,7 @@ public: Py_DECREF(pList); for (int i=0; iParamCount(); i+=1) { PyObject* name = PyString_FromString((char*)(const char*)self->ParamName(i).mb_str()); - PyObject* val = _Variant2PyObj((*self)[i], True); + PyObject* val = _Variant2PyObj((*self)[i], true); PyObject_SetAttr(pyself, name, val); PyList_Append(pList, name); Py_DECREF(val); diff --git a/wxPython/contrib/gizmos/gizmos.i b/wxPython/contrib/gizmos/gizmos.i index 098f3ac7bb..e0496bd699 100644 --- a/wxPython/contrib/gizmos/gizmos.i +++ b/wxPython/contrib/gizmos/gizmos.i @@ -286,8 +286,8 @@ public: bool blocked = wxPyBeginBlockThreads(); if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) { PyObject* dcobj = wxPyMake_wxObject(&dc,false); - PyObject* idobj = wxPyConstructObject((void*)&id, wxT("wxTreeItemId"), False); - PyObject* recobj= wxPyConstructObject((void*)&rect, wxT("wxRect"), False); + PyObject* idobj = wxPyConstructObject((void*)&id, wxT("wxTreeItemId"), false); + PyObject* recobj= wxPyConstructObject((void*)&rect, wxT("wxRect"), false); wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj)); Py_DECREF(dcobj); Py_DECREF(idobj); @@ -455,7 +455,7 @@ public: wxTreeListColumnInfo(const wxString& text = wxPyEmptyString, int image = -1, size_t width = 100, - bool shown = True, + bool shown = true, wxTreeListColumnAlign alignment = wxTL_ALIGN_LEFT); bool GetShown() const; @@ -702,10 +702,10 @@ public: // allow the user to expand the items which don't have any children now // - but instead add them only when needed, thus minimizing memory // usage and loading time. - void SetItemHasChildren(const wxTreeItemId& item, bool has = True); + void SetItemHasChildren(const wxTreeItemId& item, bool has = true); // the item will be shown in bold - void SetItemBold(const wxTreeItemId& item, bool bold = True); + void SetItemBold(const wxTreeItemId& item, bool bold = true); // set the item's text colour void SetItemTextColour(const wxTreeItemId& item, const wxColour& colour); @@ -740,7 +740,7 @@ public: // if 'recursively' is False, only immediate children count, otherwise // the returned number is the number of all items in this branch - size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = True); + size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = true); // wxTreeItemId.IsOk() will return False if there is no such item @@ -762,7 +762,7 @@ public: num = self->GetSelections(array); for (x=0; x < num; x++) { wxTreeItemId *tii = new wxTreeItemId(array.Item(x)); - PyObject* item = wxPyConstructObject((void*)tii, wxT("wxTreeItemId"), True); + PyObject* item = wxPyConstructObject((void*)tii, wxT("wxTreeItemId"), true); PyList_Append(rval, item); } wxPyEndBlockThreads(blocked); @@ -793,7 +793,7 @@ public: wxTreeItemId* ritem = new wxTreeItemId(self->GetFirstChild(item, cookie)); bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), True)); + PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true)); PyTuple_SET_ITEM(tup, 1, wxPyMakeSwigPtr(cookie, wxT("void"))); wxPyEndBlockThreads(blocked); return tup; @@ -808,7 +808,7 @@ public: wxTreeItemId* ritem = new wxTreeItemId(self->GetNextChild(item, cookie)); bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), True)); + PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true)); PyTuple_SET_ITEM(tup, 1, wxPyMakeSwigPtr(cookie, wxT("void"))); wxPyEndBlockThreads(blocked); return tup; @@ -905,10 +905,10 @@ public: void UnselectAll(); // select this item - void SelectItem(const wxTreeItemId& item, bool unselect_others=True, - bool extended_select=False); + void SelectItem(const wxTreeItemId& item, bool unselect_others=true, + bool extended_select=false); - void SelectAll(bool extended_select=False); + void SelectAll(bool extended_select=false); // make sure this item is visible (expanding the parent item and/or // scrolling to this item if necessary) @@ -922,7 +922,7 @@ public: %extend { // get the bounding rectangle of the item (or of its label only) - PyObject* GetBoundingRect(const wxTreeItemId& item, bool textOnly = False) { + PyObject* GetBoundingRect(const wxTreeItemId& item, bool textOnly = false) { wxRect rect; if (self->GetBoundingRect(item, rect, textOnly)) { bool blocked = wxPyBeginBlockThreads(); diff --git a/wxPython/contrib/iewin/iewin.i b/wxPython/contrib/iewin/iewin.i index e76a1f80bd..d232b5a42b 100644 --- a/wxPython/contrib/iewin/iewin.i +++ b/wxPython/contrib/iewin/iewin.i @@ -100,8 +100,8 @@ public: void SetCharset(wxString charset); void SetEditMode(bool seton); bool GetEditMode(); - wxString GetStringSelection(bool asHTML = False); - wxString GetText(bool asHTML = False); + wxString GetStringSelection(bool asHTML = false); + wxString GetText(bool asHTML = false); bool GoBack(); bool GoForward(); diff --git a/wxPython/contrib/ogl/_oglbasic.i b/wxPython/contrib/ogl/_oglbasic.i index df8052dff6..8c9185aeb2 100644 --- a/wxPython/contrib/ogl/_oglbasic.i +++ b/wxPython/contrib/ogl/_oglbasic.i @@ -112,7 +112,7 @@ public: void base_OnDelete(); void base_OnDraw(wxDC& dc); void base_OnDrawContents(wxDC& dc); - void base_OnDrawBranches(wxDC& dc, bool erase = False); + void base_OnDrawBranches(wxDC& dc, bool erase = false); void base_OnMoveLinks(wxDC& dc); void base_OnErase(wxDC& dc); void base_OnEraseContents(wxDC& dc); @@ -121,8 +121,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -132,7 +132,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -198,21 +198,21 @@ public: void ResetMandatoryControlPoints(); bool Recompute(); void CalculateSize(); - void Select(bool select = True, wxDC* dc = NULL); - void SetHighlight(bool hi = True, bool recurse = False); + void Select(bool select = true, wxDC* dc = NULL); + void SetHighlight(bool hi = true, bool recurse = false); bool IsHighlighted() ; bool Selected(); bool AncestorSelected(); - void SetSensitivityFilter(int sens = OP_ALL, bool recursive = False); + void SetSensitivityFilter(int sens = OP_ALL, bool recursive = false); int GetSensitivityFilter(); - void SetDraggable(bool drag, bool recursive = False); + void SetDraggable(bool drag, bool recursive = false); void SetFixedSize(bool x, bool y); void GetFixedSize(bool *OUTPUT, bool *OUTPUT) ; bool GetFixedWidth(); bool GetFixedHeight(); void SetSpaceAttachments(bool sp); bool GetSpaceAttachments() ; - void SetShadowMode(int mode, bool redraw = False); + void SetShadowMode(int mode, bool redraw = false); int GetShadowMode(); bool HitTest(double x, double y, int *OUTPUT, double *OUTPUT); void SetCentreResize(bool cr); @@ -256,14 +256,14 @@ public: void Show(bool show); bool IsShown(); - void Move(wxDC& dc, double x1, double y1, bool display = True); + void Move(wxDC& dc, double x1, double y1, bool display = true); void Erase(wxDC& dc); void EraseContents(wxDC& dc); void Draw(wxDC& dc); void Flash(); void MoveLinks(wxDC& dc); void DrawContents(wxDC& dc); - void SetSize(double x, double y, bool recursive = True); + void SetSize(double x, double y, bool recursive = true); void SetAttachmentSize(double x, double y); void Attach(wxPyShapeCanvas *can); void Detach(); @@ -330,8 +330,8 @@ public: wxRealPoint CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPoint& pt2, int nth, int noArcs, wxPyLineShape* line); bool AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, const wxRealPoint& pt2); - void EraseLinks(wxDC& dc, int attachment = -1, bool recurse = False); - void DrawLinks(wxDC& dc, int attachment = -1, bool recurse = False); + void EraseLinks(wxDC& dc, int attachment = -1, bool recurse = false); + void DrawLinks(wxDC& dc, int attachment = -1, bool recurse = false); bool MoveLineToNewAttachment(wxDC& dc, wxPyLineShape *to_move, double x, double y); @@ -362,7 +362,7 @@ public: int LogicalToPhysicalAttachment(int logicalAttachment); bool Draggable(); bool HasDescendant(wxPyShape *image); - wxPyShape *CreateNewCopy(bool resetMapping = True, bool recompute = True); + wxPyShape *CreateNewCopy(bool resetMapping = true, bool recompute = true); void Copy(wxPyShape& copy); void CopyWithHandler(wxPyShape& copy); void Rotate(double x, double y, double theta); @@ -377,7 +377,7 @@ public: void base_OnDelete(); void base_OnDraw(wxDC& dc); void base_OnDrawContents(wxDC& dc); - void base_OnDrawBranches(wxDC& dc, bool erase = False); + void base_OnDrawBranches(wxDC& dc, bool erase = false); void base_OnMoveLinks(wxDC& dc); void base_OnErase(wxDC& dc); void base_OnEraseContents(wxDC& dc); @@ -386,8 +386,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -397,7 +397,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); diff --git a/wxPython/contrib/ogl/_oglshapes.i b/wxPython/contrib/ogl/_oglshapes.i index 65aca87428..891828c550 100644 --- a/wxPython/contrib/ogl/_oglshapes.i +++ b/wxPython/contrib/ogl/_oglshapes.i @@ -153,8 +153,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -164,7 +164,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -204,8 +204,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -215,7 +215,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -255,8 +255,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -266,7 +266,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -335,8 +335,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -346,7 +346,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -457,8 +457,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -468,7 +468,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -508,8 +508,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -519,7 +519,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -586,8 +586,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -597,7 +597,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); diff --git a/wxPython/contrib/ogl/_oglshapes2.i b/wxPython/contrib/ogl/_oglshapes2.i index 99b00d4025..7dce30b7bd 100644 --- a/wxPython/contrib/ogl/_oglshapes2.i +++ b/wxPython/contrib/ogl/_oglshapes2.i @@ -39,8 +39,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -50,7 +50,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -83,8 +83,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -94,7 +94,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -247,8 +247,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -258,7 +258,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -344,8 +344,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -355,7 +355,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); @@ -388,8 +388,8 @@ public: void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0); void base_OnSize(double x, double y); - bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); - void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = True); + bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -399,7 +399,7 @@ public: void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h); void base_OnDrawControlPoints(wxDC& dc); void base_OnEraseControlPoints(wxDC& dc); - void base_OnMoveLink(wxDC& dc, bool moveControlPoints = True); + void base_OnMoveLink(wxDC& dc, bool moveControlPoints = true); void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0); void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0); diff --git a/wxPython/include/wx/wxPython/pyistream.h b/wxPython/include/wx/wxPython/pyistream.h index 23dedb56b0..ef1941b557 100644 --- a/wxPython/include/wx/wxPython/pyistream.h +++ b/wxPython/include/wx/wxPython/pyistream.h @@ -53,9 +53,9 @@ public: char Peek() { if (m_wxis) return m_wxis->Peek(); else return -1; } char GetC() { if (m_wxis) return m_wxis->GetC(); else return -1; } size_t LastRead() { if (m_wxis) return m_wxis->LastRead(); else return 0; } - bool CanRead() { if (m_wxis) return m_wxis->CanRead(); else return False; } - bool Eof() { if (m_wxis) return m_wxis->Eof(); else return False; } - bool Ungetch(char c) { if (m_wxis) return m_wxis->Ungetch(c); else return False; } + bool CanRead() { if (m_wxis) return m_wxis->CanRead(); else return false; } + bool Eof() { if (m_wxis) return m_wxis->Eof(); else return false; } + bool Ungetch(char c) { if (m_wxis) return m_wxis->Ungetch(c); else return false; } unsigned long SeekI(unsigned long pos, wxSeekMode mode) { if (m_wxis) return m_wxis->SeekI(pos, mode); else return 0; } @@ -72,7 +72,7 @@ public: virtual size_t GetSize() const; // factory function - static wxPyCBInputStream* create(PyObject *py, bool block=True); + static wxPyCBInputStream* create(PyObject *py, bool block=true); protected: // can only be created via the factory diff --git a/wxPython/include/wx/wxPython/wxPython.h b/wxPython/include/wx/wxPython/wxPython.h index 4f96d2fcfd..dda85883aa 100644 --- a/wxPython/include/wx/wxPython/wxPython.h +++ b/wxPython/include/wx/wxPython/wxPython.h @@ -115,7 +115,7 @@ inline wxPyCoreAPI* wxPyGetCoreAPIPtr() #define wxPyCBH_callCallbackObj(a, b) (wxPyGetCoreAPIPtr()->p_wxPyCBH_callCallbackObj(a, b)) #define wxPyCBH_delete(a) (wxPyGetCoreAPIPtr()->p_wxPyCBH_delete(a)) -#define wxPyMake_wxObject(a,b) (wxPyGetCoreAPIPtr()->p_wxPyMake_wxObject(a,b,True)) +#define wxPyMake_wxObject(a,b) (wxPyGetCoreAPIPtr()->p_wxPyMake_wxObject(a,b,true)) #define wxPyMake_wxObject2(a,b,c) (wxPyGetCoreAPIPtr()->p_wxPyMake_wxObject(a,b,c)) #define wxPyMake_wxSizer(a,b) (wxPyGetCoreAPIPtr()->p_wxPyMake_wxSizer(a,b)) #define wxPyPtrTypeMap_Add(a, b) (wxPyGetCoreAPIPtr()->p_wxPyPtrTypeMap_Add(a, b)) diff --git a/wxPython/include/wx/wxPython/wxPython_int.h b/wxPython/include/wx/wxPython/wxPython_int.h index a39639af6e..0b964cf469 100644 --- a/wxPython/include/wx/wxPython/wxPython_int.h +++ b/wxPython/include/wx/wxPython/wxPython_int.h @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -82,9 +83,6 @@ typedef unsigned char byte; typedef wxPoint2DDouble wxPoint2D; -const bool True = true; -const bool False = false; - #ifndef wxPyUSE_EXPORTED_API @@ -109,7 +107,7 @@ PyObject* wxPyMakeSwigPtr(void* ptr, const wxChar* classname); PyObject* wx2PyString(const wxString& src); wxString Py2wxString(PyObject* source); -PyObject* wxPyMake_wxObject(wxObject* source, bool setThisOwn, bool checkEvtHandler=True); +PyObject* wxPyMake_wxObject(wxObject* source, bool setThisOwn, bool checkEvtHandler=true); PyObject* wxPyMake_wxSizer(wxSizer* source, bool setThisOwn); void wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName); @@ -199,7 +197,7 @@ bool wxPyTwoIntItem_helper(PyObject* source, T** obj, const wxChar* name) if (! wxPyConvertSwigPtr(source, (void **)&ptr, name)) goto error; *obj = ptr; - return True; + return true; } // otherwise a 2-tuple of integers is expected else if (PySequence_Check(source) && PyObject_Length(source) == 2) { @@ -213,14 +211,14 @@ bool wxPyTwoIntItem_helper(PyObject* source, T** obj, const wxChar* name) **obj = T(PyInt_AsLong(o1), PyInt_AsLong(o2)); Py_DECREF(o1); Py_DECREF(o2); - return True; + return true; } error: wxString msg; msg.Printf(wxT("Expected a 2-tuple of integers or a %s object."), name); PyErr_SetString(PyExc_TypeError, msg.mb_str()); - return False; + return false; } @@ -275,7 +273,7 @@ public: wxPyEvtSelfRef(); ~wxPyEvtSelfRef(); - void SetSelf(PyObject* self, bool clone=False); + void SetSelf(PyObject* self, bool clone=false); PyObject* GetSelf() const; bool GetCloned() const { return m_cloned; } @@ -517,7 +515,7 @@ public: m_class = NULL; m_self = NULL; m_lastFound = NULL; - m_incRef = False; + m_incRef = false; } ~wxPyCallbackHelper() { @@ -528,7 +526,7 @@ public: #endif } - void setSelf(PyObject* self, PyObject* klass, int incref=True); + void setSelf(PyObject* self, PyObject* klass, int incref=true); bool findCallback(const char* name) const; int callCallback(PyObject* argTuple) const; PyObject* callCallbackObj(PyObject* argTuple) const; @@ -664,7 +662,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_INTINT(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(int a, int b) { \ - bool rval=False, found; \ + bool rval=false, found; \ bool blocked = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b)); \ @@ -876,7 +874,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_BOOL(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(bool a) { \ - bool rval=False, found; \ + bool rval=false, found; \ bool blocked = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));\ @@ -898,7 +896,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_INT(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(int a) { \ - bool rval=False, found; \ + bool rval=false, found; \ bool blocked = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));\ @@ -919,11 +917,11 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_INT_pure(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(int a) { \ - bool rval=False; \ + bool rval=false; \ bool blocked = wxPyBeginBlockThreads(); \ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a)); \ - else rval = False; \ + else rval = false; \ wxPyEndBlockThreads(blocked); \ return rval; \ } @@ -1081,7 +1079,7 @@ extern wxPyApp *wxPythonApp; bool CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) { \ bool found; \ bool blocked = wxPyBeginBlockThreads(); \ - bool rval=False; \ + bool rval=false; \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ PyObject* obj = wxPyMake_wxObject(&a,false); \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));\ @@ -1291,7 +1289,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_STRING(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(const wxString& a) { \ - bool rval=False; \ + bool rval=false; \ bool found; \ bool blocked = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ @@ -1315,7 +1313,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_STRING_pure(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(const wxString& a) { \ - bool rval=False; \ + bool rval=false; \ bool blocked = wxPyBeginBlockThreads(); \ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ PyObject* s = wx2PyString(a); \ @@ -1407,7 +1405,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_STRINGSTRING(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(const wxString& a, const wxString& b) { \ - bool rval=False; \ + bool rval=false; \ bool found; \ bool blocked = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ @@ -1532,7 +1530,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_TAG_pure(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(const wxHtmlTag& a) { \ - bool rval=False; \ + bool rval=false; \ bool blocked = wxPyBeginBlockThreads(); \ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ PyObject* obj = wxPyConstructObject((void*)&a, wxT("wxHtmlTag"), 0);\ @@ -1677,7 +1675,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_WXWIN(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(wxWindow* a) { \ - bool rval=False; \ + bool rval=false; \ bool found; \ bool blocked = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ @@ -1703,7 +1701,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_WXWINDC(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(wxWindow* a, wxDC& b) { \ - bool rval=False; \ + bool rval=false; \ bool found; \ bool blocked = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ @@ -1755,7 +1753,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME() { \ - bool rval=False; \ + bool rval=false; \ bool found; \ bool blocked = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ @@ -1778,7 +1776,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_const(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME() const { \ - bool rval=False; \ + bool rval=false; \ bool found; \ bool blocked = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ @@ -1850,7 +1848,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_DR(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(wxDragResult a) { \ - bool rval=False; \ + bool rval=false; \ bool found; \ bool blocked = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ @@ -1887,7 +1885,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_INTINTSTR_pure(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(int a, int b, const wxString& c) { \ - bool rval=False; \ + bool rval=false; \ bool blocked = wxPyBeginBlockThreads(); \ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ PyObject* s = wx2PyString(c); \ @@ -2033,7 +2031,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_bool_any(CLASS, PCLASS, CBNAME, Type) \ bool CLASS::CBNAME(Type& a) { \ - bool rv=False; \ + bool rv=false; \ bool found; \ bool blocked = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ @@ -2058,7 +2056,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_bool_anypure(CLASS, PCLASS, CBNAME, Type) \ bool CLASS::CBNAME(Type& a) { \ - bool rv=False; \ + bool rv=false; \ bool blocked = wxPyBeginBlockThreads(); \ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0); \ @@ -2166,7 +2164,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_ME(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(wxMouseEvent& e) { \ - bool rval=False; \ + bool rval=false; \ bool found; \ bool blocked = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ @@ -2285,7 +2283,7 @@ extern wxPyApp *wxPythonApp; #define IMP_PYCALLBACK_BOOL_NODE_pure(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(wxXmlNode* a) { \ - bool rv=False; \ + bool rv=false; \ bool blocked = wxPyBeginBlockThreads(); \ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ PyObject* obj = wxPyConstructObject((void*)a, wxT("wxXmlNode"), 0); \ diff --git a/wxPython/src/_app.i b/wxPython/src/_app.i index 549ca80c44..1f9f92bacb 100644 --- a/wxPython/src/_app.i +++ b/wxPython/src/_app.i @@ -115,7 +115,7 @@ during each event loop iteration.", ""); DocDeclStr( - virtual bool, Yield(bool onlyIfNeeded = False), + virtual bool, Yield(bool onlyIfNeeded = false), "Process all currently pending events right now, instead of waiting until return to the event loop. It is an error to call ``Yield`` recursively unless the value of ``onlyIfNeeded`` is True. @@ -307,7 +307,7 @@ DocDeclStr( DocDeclStr( - bool, wxSafeYield(wxWindow* win=NULL, bool onlyIfNeeded=False), + bool, wxSafeYield(wxWindow* win=NULL, bool onlyIfNeeded=false), "This function is similar to `wx.Yield`, except that it disables the user input to all program windows before calling `wx.Yield` and re-enables it again afterwards. If ``win`` is not None, this window diff --git a/wxPython/src/_bitmap.i b/wxPython/src/_bitmap.i index 88e91c0d5e..a89b83b968 100644 --- a/wxPython/src/_bitmap.i +++ b/wxPython/src/_bitmap.i @@ -289,8 +289,8 @@ the ``type`` parameter.", ""); %pythoncode { def __nonzero__(self): return self.Ok() } %extend { - bool __eq__(const wxBitmap* other) { return other ? (*self == *other) : False; } - bool __ne__(const wxBitmap* other) { return other ? (*self != *other) : True; } + bool __eq__(const wxBitmap* other) { return other ? (*self == *other) : false; } + bool __ne__(const wxBitmap* other) { return other ? (*self != *other) : true; } } }; diff --git a/wxPython/src/_clipbrd.i b/wxPython/src/_clipbrd.i index 8fb471613e..1c262b3888 100644 --- a/wxPython/src/_clipbrd.i +++ b/wxPython/src/_clipbrd.i @@ -113,7 +113,7 @@ exit. Returns False if the operation is unsuccesful for any reason.", ""); DocDeclStr( - virtual void , UsePrimarySelection( bool primary = True ), + virtual void , UsePrimarySelection( bool primary = true ), "On platforms supporting it (the X11 based platforms), selects the so called PRIMARY SELECTION as the clipboard as opposed to the normal clipboard, if primary is True.", ""); diff --git a/wxPython/src/_config.i b/wxPython/src/_config.i index a0a2bf2660..5935dae670 100644 --- a/wxPython/src/_config.i +++ b/wxPython/src/_config.i @@ -92,7 +92,7 @@ reference to the previous global config object.", ""); DocDeclStr( - static wxConfigBase *, Get(bool createOnDemand = True), + static wxConfigBase *, Get(bool createOnDemand = true), "Returns the current global config object, creating one if neccessary.", ""); @@ -192,12 +192,12 @@ GetNextGroup to fetch the next item.", ""); DocDeclStr( - virtual size_t , GetNumberOfEntries(bool recursive = False) const, + virtual size_t , GetNumberOfEntries(bool recursive = false) const, "Get the number of entries in the current group, with or without its subgroups.", ""); DocDeclStr( - virtual size_t , GetNumberOfGroups(bool recursive = False) const, + virtual size_t , GetNumberOfGroups(bool recursive = false) const, "Get the number of subgroups in the current group, with or without its subgroups.", ""); @@ -249,7 +249,7 @@ subgroups.", ""); DocStr(ReadBool, "Returns the value of key if it exists, defaultVal otherwise.", ""); - bool ReadBool(const wxString& key, bool defaultVal = False) { + bool ReadBool(const wxString& key, bool defaultVal = false) { bool rv; self->Read(key, &rv, defaultVal); return rv; @@ -279,7 +279,7 @@ subgroups.", ""); DocDeclStr( - virtual bool , Flush(bool currentOnly = False), + virtual bool , Flush(bool currentOnly = false), "permanently writes all changes", ""); @@ -300,7 +300,7 @@ name is already taken by an existing entry)", ""); // it was the last key in it and the second parameter is True DocDeclStr( virtual bool , DeleteEntry(const wxString& key, - bool deleteGroupIfEmpty = True), + bool deleteGroupIfEmpty = true), "Deletes the specified entry and the group it belongs to if it was the last key in it and the second parameter is True", ""); @@ -318,7 +318,7 @@ primarly intended for use by deinstallation routine.", ""); DocDeclStr( - void , SetExpandEnvVars(bool doIt = True), + void , SetExpandEnvVars(bool doIt = true), "We can automatically expand environment variables in the config entries this option is on by default, you can turn it on/off at any time)", ""); @@ -329,7 +329,7 @@ time)", ""); DocDeclStr( - void , SetRecordDefaults(bool doIt = True), + void , SetRecordDefaults(bool doIt = true), "Set whether the config objec should record default values.", ""); DocDeclStr( diff --git a/wxPython/src/_core_api.i b/wxPython/src/_core_api.i index c3cc8fd053..4138758000 100644 --- a/wxPython/src/_core_api.i +++ b/wxPython/src/_core_api.i @@ -94,7 +94,7 @@ bool wxPyConvertSwigPtr(PyObject* obj, void **ptr, const wxChar* className) { swig_type_info* swigType = wxPyFindSwigType(className); - wxCHECK_MSG(swigType != NULL, False, wxT("Unknown type in wxPyConvertSwigPtr")); + wxCHECK_MSG(swigType != NULL, false, wxT("Unknown type in wxPyConvertSwigPtr")); return SWIG_Python_ConvertPtr(obj, ptr, swigType, SWIG_POINTER_EXCEPTION) != -1; } diff --git a/wxPython/src/_cshelp.i b/wxPython/src/_cshelp.i index 31944bf0a5..ca04f0cae8 100644 --- a/wxPython/src/_cshelp.i +++ b/wxPython/src/_cshelp.i @@ -138,7 +138,7 @@ MustHaveApp(wxContextHelp); class wxContextHelp : public wxObject { public: DocCtorStr( - wxContextHelp(wxWindow* window = NULL, bool doNow = True), + wxContextHelp(wxWindow* window = NULL, bool doNow = true), "Constructs a context help object, calling BeginContextHelp if doNow is true (the default). diff --git a/wxPython/src/_cursor.i b/wxPython/src/_cursor.i index ecb8a7a9ce..81fe4c90a9 100644 --- a/wxPython/src/_cursor.i +++ b/wxPython/src/_cursor.i @@ -77,7 +77,7 @@ This constructor is not available on wxGTK, use ``wx.StockCursor``, ``wx.CursorFromImage``, or ``wx.CursorFromBits`` instead.", ""); wxCursor(const wxString* cursorName, long type, int hotSpotX=0, int hotSpotY=0) { %#ifdef __WXGTK__ - wxCHECK_MSG(False, NULL, + wxCHECK_MSG(false, NULL, wxT("wx.Cursor constructor not implemented for wxGTK, use wx.StockCursor, wx.CursorFromImage, or wx.CursorFromBits instead.")); %#else return new wxCursor(*cursorName, type, hotSpotX, hotSpotY); diff --git a/wxPython/src/_dataobj.i b/wxPython/src/_dataobj.i index 8c9c4bb5a2..d755d6d1ec 100644 --- a/wxPython/src/_dataobj.i +++ b/wxPython/src/_dataobj.i @@ -247,7 +247,7 @@ in the given direction.", ""); PyObject* list = PyList_New(count); for (size_t i=0; i *other) : True; } -// bool __ge__(const wxDateTime* other) { return other ? (*self >= *other) : True; } +// bool __lt__(const wxDateTime* other) { return other ? (*self < *other) : false; } +// bool __le__(const wxDateTime* other) { return other ? (*self <= *other) : false; } +// bool __gt__(const wxDateTime* other) { return other ? (*self > *other) : true; } +// bool __ge__(const wxDateTime* other) { return other ? (*self >= *other) : true; } // These fall back to just comparing pointers if other is NULL, or if @@ -934,12 +934,12 @@ public: wxTimeSpan __mul__(int n) { return *self * n; } wxTimeSpan __rmul__(int n) { return n * *self; } - bool __lt__(const wxTimeSpan* other) { return other ? (*self < *other) : False; } - bool __le__(const wxTimeSpan* other) { return other ? (*self <= *other) : False; } - bool __gt__(const wxTimeSpan* other) { return other ? (*self > *other) : True; } - bool __ge__(const wxTimeSpan* other) { return other ? (*self >= *other) : True; } - bool __eq__(const wxTimeSpan* other) { return other ? (*self == *other) : False; } - bool __ne__(const wxTimeSpan* other) { return other ? (*self != *other) : True; } + bool __lt__(const wxTimeSpan* other) { return other ? (*self < *other) : false; } + bool __le__(const wxTimeSpan* other) { return other ? (*self <= *other) : false; } + bool __gt__(const wxTimeSpan* other) { return other ? (*self > *other) : true; } + bool __ge__(const wxTimeSpan* other) { return other ? (*self >= *other) : true; } + bool __eq__(const wxTimeSpan* other) { return other ? (*self == *other) : false; } + bool __ne__(const wxTimeSpan* other) { return other ? (*self != *other) : true; } } @@ -1120,13 +1120,13 @@ public: wxDateSpan __mul__(int n) { return *self * n; } wxDateSpan __rmul__(int n) { return n * *self; } -// bool __lt__(const wxDateSpan* other) { return other ? (*self < *other) : False; } -// bool __le__(const wxDateSpan* other) { return other ? (*self <= *other) : False; } -// bool __gt__(const wxDateSpan* other) { return other ? (*self > *other) : True; } -// bool __ge__(const wxDateSpan* other) { return other ? (*self >= *other) : True; } +// bool __lt__(const wxDateSpan* other) { return other ? (*self < *other) : false; } +// bool __le__(const wxDateSpan* other) { return other ? (*self <= *other) : false; } +// bool __gt__(const wxDateSpan* other) { return other ? (*self > *other) : true; } +// bool __ge__(const wxDateSpan* other) { return other ? (*self >= *other) : true; } - bool __eq__(const wxDateSpan* other) { return other ? (*self == *other) : False; } - bool __ne__(const wxDateSpan* other) { return other ? (*self != *other) : True; } + bool __eq__(const wxDateSpan* other) { return other ? (*self == *other) : false; } + bool __ne__(const wxDateSpan* other) { return other ? (*self != *other) : true; } } }; diff --git a/wxPython/src/_dc.i b/wxPython/src/_dc.i index d5dca6ae04..af658a2aff 100644 --- a/wxPython/src/_dc.i +++ b/wxPython/src/_dc.i @@ -246,8 +246,8 @@ current text background colour to draw the background (all bits set to 0). :see: `SetTextForeground`, `SetTextBackground` and `wx.MemoryDC`"); - void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = False); - %name(DrawBitmapPoint) void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, bool useMask = False); + void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = false); + %name(DrawBitmapPoint) void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, bool useMask = false); DocStr( @@ -285,7 +285,7 @@ font. ``wx.SWISS_FONT`` is an example of a font which is."," DocDeclStr( bool , Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = False, + int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1), "Copy from a source DC to this DC. Parameters specify the destination coordinates, size of area to copy, source DC, source coordinates, @@ -312,7 +312,7 @@ position.", " DocDeclStrName( bool , Blit(const wxPoint& destPt, const wxSize& sz, wxDC *source, const wxPoint& srcPt, - int rop = wxCOPY, bool useMask = False, + int rop = wxCOPY, bool useMask = false, const wxPoint& srcPtMask = wxDefaultPosition), "Copy from a source DC to this DC. Parameters specify the destination coordinates, size of area to copy, source DC, source coordinates, @@ -1575,7 +1575,7 @@ public: // %name(PrinterDC2) wxPrinterDC(const wxString& driver, // const wxString& device, // const wxString& output, -// bool interactive = True, +// bool interactive = true, // int orientation = wxPORTRAIT); }; @@ -1597,7 +1597,7 @@ public: // %name(PrinterDC2) wxPrinterDC(const wxString& driver, // const wxString& device, // const wxString& output, -// bool interactive = True, +// bool interactive = true, // int orientation = wxPORTRAIT); }; #endif diff --git a/wxPython/src/_display.i b/wxPython/src/_display.i index 9e26f5f69d..938c85ada3 100644 --- a/wxPython/src/_display.i +++ b/wxPython/src/_display.i @@ -61,8 +61,8 @@ means unspecified/known", ""); %pythoncode { def __nonzero__(self): return self.IsOk() } %extend { - bool __eq__(const wxVideoMode* other) { return other ? (*self == *other) : False; } - bool __ne__(const wxVideoMode* other) { return other ? (*self != *other) : True; } + bool __eq__(const wxVideoMode* other) { return other ? (*self == *other) : false; } + bool __ne__(const wxVideoMode* other) { return other ? (*self != *other) : true; } } diff --git a/wxPython/src/_dnd.i b/wxPython/src/_dnd.i index 9c2ade6aa3..dfa264c4ae 100644 --- a/wxPython/src/_dnd.i +++ b/wxPython/src/_dnd.i @@ -216,7 +216,7 @@ public: bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) { - bool rval = False; + bool rval = false; bool blocked = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "OnDropFiles")) { PyObject* list = wxArrayString2PyList_helper(filenames); diff --git a/wxPython/src/_dragimg.i b/wxPython/src/_dragimg.i index fdbbb93d1f..a0f1d2cc09 100644 --- a/wxPython/src/_dragimg.i +++ b/wxPython/src/_dragimg.i @@ -52,7 +52,7 @@ public: // Begin drag. hotspot is the location of the drag position relative to the upper-left // corner of the image. bool BeginDrag(const wxPoint& hotspot, wxWindow* window, - bool fullScreen = False, wxRect* rect = NULL); + bool fullScreen = false, wxRect* rect = NULL); // Begin drag. hotspot is the location of the drag position relative to the upper-left // corner of the image. This is full screen only. fullScreenRect gives the diff --git a/wxPython/src/_event.i b/wxPython/src/_event.i index 004cc784ee..0b893da8b5 100644 --- a/wxPython/src/_event.i +++ b/wxPython/src/_event.i @@ -378,7 +378,7 @@ public: // (treat as if the event table entry had not been found): this must be done // to allow the event processing by the base classes (calling event.Skip() // is the analog of calling the base class verstion of a virtual function) - void Skip(bool skip = True); + void Skip(bool skip = true); bool GetSkipped() const; // Determine if this event should be propagating to the parent window. @@ -877,7 +877,7 @@ public: class wxActivateEvent : public wxEvent { public: - wxActivateEvent(wxEventType type = wxEVT_NULL, bool active = True, int Id = 0); + wxActivateEvent(wxEventType type = wxEVT_NULL, bool active = true, int Id = 0); bool GetActive() const; }; @@ -922,7 +922,7 @@ public: void SetLoggingOff(bool logOff); bool GetLoggingOff() const; - void Veto(bool veto = True); + void Veto(bool veto = true); void SetCanVeto(bool canVeto); bool CanVeto() const; @@ -936,7 +936,7 @@ public: class wxShowEvent : public wxEvent { public: - wxShowEvent(int winid = 0, bool show = False); + wxShowEvent(int winid = 0, bool show = false); void SetShow(bool show); bool GetShow() const; @@ -950,7 +950,7 @@ public: class wxIconizeEvent: public wxEvent { public: - wxIconizeEvent(int id = 0, bool iconized = True); + wxIconizeEvent(int id = 0, bool iconized = true); bool Iconized(); }; @@ -1220,7 +1220,7 @@ class wxIdleEvent : public wxEvent public: wxIdleEvent(); - void RequestMore(bool needMore = True); + void RequestMore(bool needMore = true); bool MoreRequested() const; // Specify how wxWindows will send idle events: to diff --git a/wxPython/src/_filesys.i b/wxPython/src/_filesys.i index c951dd5d21..fe7be734e8 100644 --- a/wxPython/src/_filesys.i +++ b/wxPython/src/_filesys.i @@ -127,7 +127,7 @@ public: wxFileSystem(); ~wxFileSystem(); - void ChangePathTo(const wxString& location, bool is_dir = False); + void ChangePathTo(const wxString& location, bool is_dir = false); wxString GetPath(); %newobject OpenFile; diff --git a/wxPython/src/_font.i b/wxPython/src/_font.i index 2e858aacca..b4800781fa 100644 --- a/wxPython/src/_font.i +++ b/wxPython/src/_font.i @@ -316,7 +316,7 @@ bool wxTestFontEncoding(const wxNativeEncodingInfo& info); { wxPyRaiseNotImplemented(); return NULL; } bool wxTestFontEncoding(const wxNativeEncodingInfo& info) - { wxPyRaiseNotImplemented(); return False; } + { wxPyRaiseNotImplemented(); return false; } %} #endif @@ -356,7 +356,7 @@ public: // interactive parameter is ignored in the base class, we behave as if it // were always False virtual wxFontEncoding CharsetToEncoding(const wxString& charset, - bool interactive = True); + bool interactive = true); // get the number of font encodings we know about @@ -398,7 +398,7 @@ public: %extend { PyObject* GetAltForEncoding(wxFontEncoding encoding, const wxString& facename = wxPyEmptyString, - bool interactive = True) { + bool interactive = true) { wxFontEncoding alt_enc; if (self->GetAltForEncoding(encoding, &alt_enc, facename, interactive)) return PyInt_FromLong(alt_enc); @@ -439,7 +439,7 @@ public: %pythonPrepend wxFont "if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']" wxFont( int pointSize, int family, int style, int weight, - bool underline=False, const wxString& face = wxPyEmptyString, + bool underline=false, const wxString& face = wxPyEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT); ~wxFont(); @@ -467,8 +467,8 @@ public: // comparison %extend { - bool __eq__(const wxFont* other) { return other ? (*self == *other) : False; } - bool __ne__(const wxFont* other) { return other ? (*self != *other) : True; } + bool __eq__(const wxFont* other) { return other ? (*self == *other) : false; } + bool __ne__(const wxFont* other) { return other ? (*self != *other) : true; } } // accessors: get the font characteristics @@ -505,7 +505,7 @@ public: wxString GetWeightString() const; // Unofficial API, don't use - virtual void SetNoAntiAliasing( bool no = True ); + virtual void SetNoAntiAliasing( bool no = true ); virtual bool GetNoAntiAliasing() const; // the default encoding is used for creating all fonts with default @@ -549,7 +549,7 @@ public: bool EnumerateFacenames( wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all - bool fixedWidthOnly = False); + bool fixedWidthOnly = false); bool EnumerateEncodings(const wxString& facename = wxPyEmptyString); diff --git a/wxPython/src/_functions.i b/wxPython/src/_functions.i index 3304ca5f08..f3f05a9858 100644 --- a/wxPython/src/_functions.i +++ b/wxPython/src/_functions.i @@ -49,7 +49,7 @@ void wxBell(); MustHaveApp(wxEndBusyCursor); void wxEndBusyCursor(); -long wxGetElapsedTime(bool resetTimer = True); +long wxGetElapsedTime(bool resetTimer = true); MustHaveApp(wxGetMousePosition); DocDeclA( @@ -161,7 +161,7 @@ wxString wxGetTextFromUser(const wxString& message, const wxString& default_value = wxPyEmptyString, wxWindow *parent = NULL, int x = -1, int y = -1, - bool centre = True); + bool centre = true); MustHaveApp(wxGetPasswordFromUser); wxString wxGetPasswordFromUser(const wxString& message, @@ -175,7 +175,7 @@ wxString wxGetPasswordFromUser(const wxString& message, // int LCOUNT, char** choices, // int nsel, int *selection, // wxWindow *parent = NULL, int x = -1, int y = -1, -// bool centre = True, int width=150, int height=200); +// bool centre = true, int width=150, int height=200); MustHaveApp(wxGetSingleChoice); @@ -183,7 +183,7 @@ wxString wxGetSingleChoice(const wxString& message, const wxString& caption, int choices, wxString* choices_array, wxWindow *parent = NULL, int x = -1, int y = -1, - bool centre = True, + bool centre = true, int width=150, int height=200); MustHaveApp(wxGetSingleChoiceIndex); @@ -191,7 +191,7 @@ int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption, int choices, wxString* choices_array, wxWindow *parent = NULL, int x = -1, int y = -1, - bool centre = True, + bool centre = true, int width=150, int height=200); @@ -318,7 +318,7 @@ MustHaveApp(wxThread); #ifdef WXP_WITH_THREAD return wxThread::IsMain(); #else - return True; + return true; #endif } %} diff --git a/wxPython/src/_gbsizer.i b/wxPython/src/_gbsizer.i index 76989c4f50..d4dc75e0fb 100644 --- a/wxPython/src/_gbsizer.i +++ b/wxPython/src/_gbsizer.i @@ -42,7 +42,7 @@ bool wxGBPosition_helper(PyObject* source, wxGBPosition** obj) { if (source == Py_None) { **obj = wxGBPosition(-1,-1); - return True; + return true; } return wxPyTwoIntItem_helper(source, obj, wxT("wxGBPosition")); } @@ -51,7 +51,7 @@ bool wxGBSpan_helper(PyObject* source, wxGBSpan** obj) { if (source == Py_None) { **obj = wxGBSpan(-1,-1); - return True; + return true; } return wxPyTwoIntItem_helper(source, obj, wxT("wxGBSpan")); } @@ -80,8 +80,8 @@ public: void SetCol(int col); // %extend { -// bool __eq__(const wxGBPosition* other) { return other ? (*self == *other) : False; } -// bool __ne__(const wxGBPosition* other) { return other ? (*self != *other) : True; } +// bool __eq__(const wxGBPosition* other) { return other ? (*self == *other) : false; } +// bool __ne__(const wxGBPosition* other) { return other ? (*self != *other) : true; } // } bool operator==(const wxGBPosition& other); @@ -113,7 +113,7 @@ public: elif index == 1: self.SetCol(val) else: raise IndexError def __nonzero__(self): return self.Get() != (0,0) - __safe_for_unpickling__ = True + __safe_for_unpickling__ = true def __reduce__(self): return (wx.GBPosition, self.Get()) } @@ -149,8 +149,8 @@ cell in each direction.", ""); void SetColspan(int colspan); // %extend { -// bool __eq__(const wxGBSpan* other) { return other ? (*self == *other) : False; } -// bool __ne__(const wxGBSpan* other) { return other ? (*self != *other) : True; } +// bool __eq__(const wxGBSpan* other) { return other ? (*self == *other) : false; } +// bool __ne__(const wxGBSpan* other) { return other ? (*self != *other) : true; } // } bool operator==(const wxGBSpan& other); bool operator!=(const wxGBSpan& other); @@ -182,7 +182,7 @@ cell in each direction.", ""); elif index == 1: self.SetColspan(val) else: raise IndexError def __nonzero__(self): return self.Get() != (0,0) - __safe_for_unpickling__ = True + __safe_for_unpickling__ = true def __reduce__(self): return (wx.GBSpan, self.Get()) } @@ -386,7 +386,7 @@ position, False if something was already there. wxPyUserData* data = NULL; bool blocked = wxPyBeginBlockThreads(); - wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, True, False); + wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false); if ( userData && (info.window || info.sizer || info.gotSize) ) data = new wxPyUserData(userData); wxPyEndBlockThreads(blocked); @@ -399,7 +399,7 @@ position, False if something was already there. else if (info.gotSize) return self->Add(info.size.GetWidth(), info.size.GetHeight(), pos, span, flag, border, data); - return False; + return false; } } diff --git a/wxPython/src/_gdicmn.i b/wxPython/src/_gdicmn.i index 399b5749f1..c62c8c7c10 100644 --- a/wxPython/src/_gdicmn.i +++ b/wxPython/src/_gdicmn.i @@ -132,8 +132,8 @@ public: // None/NULL is now handled properly by the typemap, so these are not needed. // %extend { -// bool __eq__(const wxSize* other) { return other ? (*self == *other) : False; } -// bool __ne__(const wxSize* other) { return other ? (*self != *other) : True; } +// bool __eq__(const wxSize* other) { return other ? (*self == *other) : false; } +// bool __ne__(const wxSize* other) { return other ? (*self != *other) : true; } // } DocDeclStr( @@ -594,7 +594,7 @@ DocAStr(wxIntersectRect, if (dest != wxRect(0,0,0,0)) { bool blocked = wxPyBeginBlockThreads(); wxRect* newRect = new wxRect(dest); - obj = wxPyConstructObject((void*)newRect, wxT("wxRect"), True); + obj = wxPyConstructObject((void*)newRect, wxT("wxRect"), true); wxPyEndBlockThreads(blocked); return obj; } diff --git a/wxPython/src/_image.i b/wxPython/src/_image.i index a3e9547aed..7c3ea50467 100644 --- a/wxPython/src/_image.i +++ b/wxPython/src/_image.i @@ -84,7 +84,7 @@ public: %name(ImageFromStream) wxImage(wxInputStream& stream, long type = wxBITMAP_TYPE_ANY, int index = -1); %name(ImageFromStreamMime) wxImage(wxInputStream& stream, const wxString& mimetype, int index = -1 ); %extend { - %name(EmptyImage) wxImage(int width=0, int height=0, bool clear = True) { + %name(EmptyImage) wxImage(int width=0, int height=0, bool clear = true) { if (width > 0 && height > 0) return new wxImage(width, height, clear); else @@ -104,7 +104,7 @@ public: return NULL; } memcpy(copy, data, width*height*3); - return new wxImage(width, height, copy, False); + return new wxImage(width, height, copy, false); } } @@ -297,13 +297,13 @@ nothing.", ""); unsigned char GetMaskRed(); unsigned char GetMaskGreen(); unsigned char GetMaskBlue(); - void SetMask( bool mask = True ); + void SetMask( bool mask = true ); bool HasMask(); wxImage Rotate(double angle, const wxPoint & centre_of_rotation, - bool interpolating = True, wxPoint * offset_after_rotation = NULL) const ; - wxImage Rotate90( bool clockwise = True ) ; - wxImage Mirror( bool horizontally = True ) ; + bool interpolating = true, wxPoint * offset_after_rotation = NULL) const ; + wxImage Rotate90( bool clockwise = true ) ; + wxImage Mirror( bool horizontally = true ) ; void Replace( unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2 ); diff --git a/wxPython/src/_imaglist.i b/wxPython/src/_imaglist.i index 98625e782f..b5df300010 100644 --- a/wxPython/src/_imaglist.i +++ b/wxPython/src/_imaglist.i @@ -43,7 +43,7 @@ MustHaveApp(wxImageList); // two bitmaps, or an icon. class wxImageList : public wxObject { public: - wxImageList(int width, int height, int mask=True, int initialCount=1); + wxImageList(int width, int height, int mask=true, int initialCount=1); ~wxImageList(); int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap); @@ -58,7 +58,7 @@ public: #endif bool Draw(int index, wxDC& dc, int x, int x, int flags = wxIMAGELIST_DRAW_NORMAL, - const bool solidBackground = False); + const bool solidBackground = false); int GetImageCount(); bool Remove(int index); diff --git a/wxPython/src/_intl.i b/wxPython/src/_intl.i index 22f868cf08..9f8f54fe62 100644 --- a/wxPython/src/_intl.i +++ b/wxPython/src/_intl.i @@ -324,8 +324,8 @@ public: %name(Init1)bool Init(const wxString& szName, const wxString& szShort = wxPyEmptyString, const wxString& szLocale = wxPyEmptyString, - bool bLoadDefault = True, - bool bConvertEncoding = False); + bool bLoadDefault = true, + bool bConvertEncoding = false); %name(Init2) bool Init(int language = wxLANGUAGE_DEFAULT, int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING); diff --git a/wxPython/src/_joystick.i b/wxPython/src/_joystick.i index add72d6b92..b446daeb68 100644 --- a/wxPython/src/_joystick.i +++ b/wxPython/src/_joystick.i @@ -64,7 +64,7 @@ public: int GetMovementThreshold() { return -1; } void SetMovementThreshold(int threshold) {} - bool IsOk(void) { return False; } + bool IsOk(void) { return false; } int GetNumberJoysticks() { return -1; } int GetManufacturerId() { return -1; } int GetProductId() { return -1; } @@ -88,16 +88,16 @@ public: int GetVMin() { return -1; } int GetVMax() { return -1; } - bool HasRudder() { return False; } - bool HasZ() { return False; } - bool HasU() { return False; } - bool HasV() { return False; } - bool HasPOV() { return False; } - bool HasPOV4Dir() { return False; } - bool HasPOVCTS() { return False; } + bool HasRudder() { return false; } + bool HasZ() { return false; } + bool HasU() { return false; } + bool HasV() { return false; } + bool HasPOV() { return false; } + bool HasPOV4Dir() { return false; } + bool HasPOVCTS() { return false; } - bool SetCapture(wxWindow* win, int pollingFreq = 0) { return False; } - bool ReleaseCapture() { return False; } + bool SetCapture(wxWindow* win, int pollingFreq = 0) { return false; } + bool ReleaseCapture() { return false; } }; #endif %} diff --git a/wxPython/src/_listbox.i b/wxPython/src/_listbox.i index 2b3da1dc43..63f0324ac1 100644 --- a/wxPython/src/_listbox.i +++ b/wxPython/src/_listbox.i @@ -70,12 +70,12 @@ public: // multiple selection logic virtual bool IsSelected(int n) const; - virtual void SetSelection(int n, bool select = True); + virtual void SetSelection(int n, bool select = true); virtual void Select(int n); void Deselect(int n); void DeselectAll(int itemToLeaveSelected = -1); - virtual bool SetStringSelection(const wxString& s, bool select = True); + virtual bool SetStringSelection(const wxString& s, bool select = true); // works for single as well as multiple selection listboxes (unlike // GetSelection which only works for listboxes with single selection) @@ -168,7 +168,7 @@ public: const wxString& name = wxPyListBoxNameStr); bool IsChecked(int index); - void Check(int index, int check = True); + void Check(int index, int check = true); #if defined(__WXMSW__) || defined(__WXGTK__) int GetItemHeight(); diff --git a/wxPython/src/_listctrl.i b/wxPython/src/_listctrl.i index c969897f71..314b4287a2 100644 --- a/wxPython/src/_listctrl.i +++ b/wxPython/src/_listctrl.i @@ -544,7 +544,7 @@ public: wxSize GetItemSpacing() const; #ifndef __WXMSW__ - void SetItemSpacing( int spacing, bool isSmall = False ); + void SetItemSpacing( int spacing, bool isSmall = false ); #endif // Gets the number of selected items in the list control @@ -561,7 +561,7 @@ public: long GetTopItem() const ; // Add or remove a single window style - void SetSingleStyle(long style, bool add = True) ; + void SetSingleStyle(long style, bool add = true) ; // Set the whole window style void SetWindowStyleFlag(long style) ; @@ -627,7 +627,7 @@ public: // Find an item whose label matches this string, starting from the item after 'start' // or the beginning if 'start' is -1. - long FindItem(long start, const wxString& str, bool partial = False); + long FindItem(long start, const wxString& str, bool partial = false); // Find an item whose data matches this data, starting from the item after 'start' // or the beginning if 'start' is -1. @@ -754,7 +754,7 @@ details in the second return value (see wxLIST_HITTEST_... flags.)", ""); // or zero if the two items are equivalent. bool SortItems(PyObject* func) { if (!PyCallable_Check(func)) - return False; + return false; return self->SortItems((wxListCtrlCompare)wxPyListCtrl_SortItems, (long)func); } } @@ -807,7 +807,7 @@ public: const wxString& name = wxPyListCtrlNameStr); // [de]select an item - void Select(long n, bool on = True); + void Select(long n, bool on = true); // focus and show the given item void Focus(long index); diff --git a/wxPython/src/_log.i b/wxPython/src/_log.i index 96214b20f6..22731e4678 100644 --- a/wxPython/src/_log.i +++ b/wxPython/src/_log.i @@ -61,7 +61,7 @@ public: static bool IsEnabled(); // change the flag state, return the previous one - static bool EnableLogging(bool doIt = True); + static bool EnableLogging(bool doIt = true); // static sink function static void OnLog(wxLogLevel level, const wxChar *szString, time_t t); @@ -94,7 +94,7 @@ public: // verbose mode is activated by standard command-line '-verbose' // option - static void SetVerbose(bool bVerbose = True); + static void SetVerbose(bool bVerbose = true); // Set log level. Log messages with level > logLevel will not be logged. static void SetLogLevel(wxLogLevel logLevel); @@ -181,10 +181,10 @@ class wxLogWindow : public wxLog public: wxLogWindow(wxFrame *pParent, // the parent frame (can be NULL) const wxString& szTitle, // the title of the frame - bool bShow = True, // show window immediately? - bool bPassToOld = True); // pass log messages to the old target? + bool bShow = true, // show window immediately? + bool bPassToOld = true); // pass log messages to the old target? - void Show(bool bShow = True); + void Show(bool bShow = true); wxFrame *GetFrame() const; wxLog *GetOldLog() const; bool IsPassingMessages() const; diff --git a/wxPython/src/_menu.i b/wxPython/src/_menu.i index f7584ed534..e1407bad00 100644 --- a/wxPython/src/_menu.i +++ b/wxPython/src/_menu.i @@ -249,7 +249,7 @@ public: virtual void EnableTop(size_t pos, bool enable); // is the menu enabled? - virtual bool IsEnabledTop(size_t WXUNUSED(pos)) const { return True; } + virtual bool IsEnabledTop(size_t WXUNUSED(pos)) const { return true; } // get or change the label of the menu at given position virtual void SetLabelTop(size_t pos, const wxString& label); @@ -345,10 +345,10 @@ public: wxMenu *GetSubMenu() const; // state - virtual void Enable(bool enable = True); + virtual void Enable(bool enable = true); virtual bool IsEnabled() const; - virtual void Check(bool check = True); + virtual void Check(bool check = true); virtual bool IsChecked() const; void Toggle(); @@ -384,7 +384,7 @@ public: bool IsOwnerDrawn(); // switch on/off owner-drawing the item - void SetOwnerDrawn(bool ownerDrawn = True); + void SetOwnerDrawn(bool ownerDrawn = true); void ResetOwnerDrawn(); #else // just to keep the global renamers in sync diff --git a/wxPython/src/_mimetype.i b/wxPython/src/_mimetype.i index de52e6af84..36098c8f7a 100644 --- a/wxPython/src/_mimetype.i +++ b/wxPython/src/_mimetype.i @@ -193,7 +193,7 @@ public: bool blocked = wxPyBeginBlockThreads(); PyObject* tuple = PyTuple_New(3); PyTuple_SetItem(tuple, 0, wxPyConstructObject(new wxIcon(loc), - wxT("wxIcon"), True)); + wxT("wxIcon"), true)); PyTuple_SetItem(tuple, 1, wx2PyString(iconFile)); PyTuple_SetItem(tuple, 2, PyInt_FromLong(iconIndex)); wxPyEndBlockThreads(blocked); @@ -266,7 +266,7 @@ public: // set an arbitrary command, ask confirmation if it already exists and // overwriteprompt is True bool SetCommand(const wxString& cmd, const wxString& verb, - bool overwriteprompt = True); + bool overwriteprompt = true); bool SetDefaultIcon(const wxString& cmd = wxPyEmptyString, int index = 0); @@ -353,7 +353,7 @@ public: // settings from other, previously parsed, files by this one: normally, // the files read most recently would override the older files, but with // fallback == True this won't happen - bool ReadMailcap(const wxString& filename, bool fallback = False); + bool ReadMailcap(const wxString& filename, bool fallback = false); // read in additional file in mime.types format bool ReadMimeTypes(const wxString& filename); diff --git a/wxPython/src/_misc.i b/wxPython/src/_misc.i index c4be5c674a..837e0fa653 100644 --- a/wxPython/src/_misc.i +++ b/wxPython/src/_misc.i @@ -66,7 +66,7 @@ public: void Move(const wxPoint& pt); %name(SetSizeWH) void SetSize(int width, int height); void SetSize(const wxSize& size); - void Show(int show = True); + void Show(int show = true); void Hide(); %pythoncode { def __nonzero__(self): return self.IsOk() } @@ -264,7 +264,7 @@ void wxDrawWindowOnDC(wxWindow* window, const wxDC& dc, int method) // WM_PRINT. For most native widgets nothing is drawn to the dc // at all, with or without Themes. typedef BOOL (WINAPI *PrintWindow_t)(HWND, HDC, UINT); - static bool s_triedToLoad = False; + static bool s_triedToLoad = false; static PrintWindow_t pfnPrintWindow = NULL; if ( !s_triedToLoad ) { diff --git a/wxPython/src/_notebook.i b/wxPython/src/_notebook.i index f17b14e993..0e14515827 100644 --- a/wxPython/src/_notebook.i +++ b/wxPython/src/_notebook.i @@ -98,14 +98,14 @@ public: // adds a new page to the control virtual bool AddPage(wxWindow *page, const wxString& text, - bool select = False, + bool select = false, int imageId = -1); // the same as AddPage(), but adds the page at the specified position virtual bool InsertPage(size_t n, wxWindow *page, const wxString& text, - bool select = False, + bool select = false, int imageId = -1)/* = 0*/; // set the currently selected page, return the index of the previously @@ -116,7 +116,7 @@ public: // cycle thru the pages - void AdvanceSelection(bool forward = True); + void AdvanceSelection(bool forward = true); static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); @@ -345,9 +345,6 @@ public: //--------------------------------------------------------------------------- -%{ -#include -%} /* * wxChoicebook flags diff --git a/wxPython/src/_panel.i b/wxPython/src/_panel.i index 0c014a92a0..a78146d4f0 100644 --- a/wxPython/src/_panel.i +++ b/wxPython/src/_panel.i @@ -95,7 +95,7 @@ public: virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, int noUnitsX, int noUnitsY, int xPos = 0, int yPos = 0, - bool noRefresh = False ); + bool noRefresh = false ); // scroll to the given (in logical coords) position virtual void Scroll(int x, int y); diff --git a/wxPython/src/_pen.i b/wxPython/src/_pen.i index 5f9f7a278e..860f18c987 100644 --- a/wxPython/src/_pen.i +++ b/wxPython/src/_pen.i @@ -107,8 +107,8 @@ public: %extend { - bool __eq__(const wxPen* other) { return other ? (*self == *other) : False; } - bool __ne__(const wxPen* other) { return other ? (*self != *other) : True; } + bool __eq__(const wxPen* other) { return other ? (*self == *other) : false; } + bool __ne__(const wxPen* other) { return other ? (*self != *other) : true; } } %pythoncode { def __nonzero__(self): return self.Ok() } }; diff --git a/wxPython/src/_printfw.i b/wxPython/src/_printfw.i index 39af033f2d..9c657ceebc 100644 --- a/wxPython/src/_printfw.i +++ b/wxPython/src/_printfw.i @@ -282,7 +282,7 @@ public: void CreateAbortWindow(wxWindow* parent, wxPyPrintout* printout); wxPrintDialogData& GetPrintDialogData(); - bool Print(wxWindow *parent, wxPyPrintout *printout, int prompt=True); + bool Print(wxWindow *parent, wxPyPrintout *printout, int prompt=true); wxDC* PrintDialog(wxWindow *parent); void ReportError(wxWindow *parent, wxPyPrintout *printout, const wxString& message); bool Setup(wxWindow *parent); @@ -299,7 +299,7 @@ public: // Since this one would be tough and ugly to do with the Macros... void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) { - bool hadErr = False; + bool hadErr = false; bool found; bool blocked = wxPyBeginBlockThreads(); @@ -310,22 +310,22 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p val = PyTuple_GetItem(result, 0); if (PyInt_Check(val)) *minPage = PyInt_AsLong(val); - else hadErr = True; + else hadErr = true; val = PyTuple_GetItem(result, 1); if (PyInt_Check(val)) *maxPage = PyInt_AsLong(val); - else hadErr = True; + else hadErr = true; val = PyTuple_GetItem(result, 2); if (PyInt_Check(val)) *pageFrom = PyInt_AsLong(val); - else hadErr = True; + else hadErr = true; val = PyTuple_GetItem(result, 3); if (PyInt_Check(val)) *pageTo = PyInt_AsLong(val); - else hadErr = True; + else hadErr = true; } else - hadErr = True; + hadErr = true; if (hadErr) { PyErr_SetString(PyExc_TypeError, "GetPageInfo should return a tuple of 4 integers."); @@ -560,30 +560,30 @@ public: %{ -#define DEC_PYCALLBACK_BOOL_PREWINDC(CBNAME) \ - bool CBNAME(wxPreviewCanvas* a, wxDC& b); \ +#define DEC_PYCALLBACK_BOOL_PREWINDC(CBNAME) \ + bool CBNAME(wxPreviewCanvas* a, wxDC& b); \ bool base_##CBNAME(wxPreviewCanvas* a, wxDC& b) -#define IMP_PYCALLBACK_BOOL_PREWINDC(CLASS, PCLASS, CBNAME) \ - bool CLASS::CBNAME(wxPreviewCanvas* a, wxDC& b) { \ - bool rval=False; \ - bool found; \ - bool blocked = wxPyBeginBlockThreads(); \ - if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ - PyObject* win = wxPyMake_wxObject(a,false); \ - PyObject* dc = wxPyMake_wxObject(&b,false); \ - rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", win, dc));\ - Py_DECREF(win); \ - Py_DECREF(dc); \ - } \ - wxPyEndBlockThreads(blocked); \ - if (! found) \ - rval = PCLASS::CBNAME(a, b); \ - return rval; \ - } \ - bool CLASS::base_##CBNAME(wxPreviewCanvas* a, wxDC& b) { \ - return PCLASS::CBNAME(a, b); \ +#define IMP_PYCALLBACK_BOOL_PREWINDC(CLASS, PCLASS, CBNAME) \ + bool CLASS::CBNAME(wxPreviewCanvas* a, wxDC& b) { \ + bool rval=false; \ + bool found; \ + bool blocked = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ + PyObject* win = wxPyMake_wxObject(a,false); \ + PyObject* dc = wxPyMake_wxObject(&b,false); \ + rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", win, dc)); \ + Py_DECREF(win); \ + Py_DECREF(dc); \ + } \ + wxPyEndBlockThreads(blocked); \ + if (! found) \ + rval = PCLASS::CBNAME(a, b); \ + return rval; \ + } \ + bool CLASS::base_##CBNAME(wxPreviewCanvas* a, wxDC& b) { \ + return PCLASS::CBNAME(a, b); \ } diff --git a/wxPython/src/_radio.i b/wxPython/src/_radio.i index 275dce10c6..93a78b647d 100644 --- a/wxPython/src/_radio.i +++ b/wxPython/src/_radio.i @@ -70,8 +70,8 @@ public: %pythoncode { SetItemLabel = SetString }; // change the individual radio button state - %name(EnableItem) virtual void Enable(int n, bool enable = True); - %name(ShowItem) virtual void Show(int n, bool show = True); + %name(EnableItem) virtual void Enable(int n, bool enable = true); + %name(ShowItem) virtual void Show(int n, bool show = true); #ifndef __WXGTK__ // layout parameters diff --git a/wxPython/src/_scrolbar.i b/wxPython/src/_scrolbar.i index a4c01b1c92..cb87fb1013 100644 --- a/wxPython/src/_scrolbar.i +++ b/wxPython/src/_scrolbar.i @@ -53,7 +53,7 @@ public: virtual void SetThumbPosition(int viewStart); virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize, - bool refresh = True); + bool refresh = true); static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); diff --git a/wxPython/src/_sizers.i b/wxPython/src/_sizers.i index 7c5b1abcce..f0eac7a127 100644 --- a/wxPython/src/_sizers.i +++ b/wxPython/src/_sizers.i @@ -263,8 +263,8 @@ isn't any.", ""); struct wxPySizerItemInfo { wxPySizerItemInfo() - : window(NULL), sizer(NULL), gotSize(False), - size(wxDefaultSize), gotPos(False), pos(-1) + : window(NULL), sizer(NULL), gotSize(false), + size(wxDefaultSize), gotPos(false), pos(-1) {} wxWindow* window; @@ -295,13 +295,13 @@ static wxPySizerItemInfo wxPySizerItemTypeHelper(PyObject* item, bool checkSize, // try wxSize or (w,h) if ( checkSize && wxSize_helper(item, &sizePtr)) { info.size = *sizePtr; - info.gotSize = True; + info.gotSize = true; } // or a single int if (checkIdx && PyInt_Check(item)) { info.pos = PyInt_AsLong(item); - info.gotPos = True; + info.gotPos = true; } } } @@ -482,7 +482,7 @@ public: wxPyUserData* data = NULL; bool blocked = wxPyBeginBlockThreads(); - wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, True, False); + wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false); if ( userData && (info.window || info.sizer || info.gotSize) ) data = new wxPyUserData(userData); wxPyEndBlockThreads(blocked); @@ -511,7 +511,7 @@ the item at index *before*. See `Add` for a description of the parameters.", "" wxPyUserData* data = NULL; bool blocked = wxPyBeginBlockThreads(); - wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, True, False); + wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false); if ( userData && (info.window || info.sizer || info.gotSize) ) data = new wxPyUserData(userData); wxPyEndBlockThreads(blocked); @@ -541,7 +541,7 @@ this sizer. See `Add` for a description of the parameters.", ""); wxPyUserData* data = NULL; bool blocked = wxPyBeginBlockThreads(); - wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, True, False); + wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false); if ( userData && (info.window || info.sizer || info.gotSize) ) data = new wxPyUserData(userData); wxPyEndBlockThreads(blocked); @@ -575,7 +575,7 @@ and removed.", " "); bool Remove(PyObject* item) { bool blocked = wxPyBeginBlockThreads(); - wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True); + wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true); wxPyEndBlockThreads(blocked); if ( info.window ) return self->Remove(info.window); @@ -584,7 +584,7 @@ and removed.", " else if ( info.gotPos ) return self->Remove(info.pos); else - return False; + return false; } @@ -597,7 +597,7 @@ zero-based index of the item to be detached. Returns True if the child item was found and detached.", ""); bool Detach(PyObject* item) { bool blocked = wxPyBeginBlockThreads(); - wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True); + wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true); wxPyEndBlockThreads(blocked); if ( info.window ) return self->Detach(info.window); @@ -606,13 +606,13 @@ was found and detached.", ""); else if ( info.gotPos ) return self->Detach(info.pos); else - return False; + return false; } void _SetItemMinSize(PyObject* item, const wxSize& size) { bool blocked = wxPyBeginBlockThreads(); - wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True); + wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true); wxPyEndBlockThreads(blocked); if ( info.window ) self->SetItemMinSize(info.window, size); @@ -793,7 +793,7 @@ this will set them appropriately. DocDeclStr( - void , Clear( bool deleteWindows=False ), + void , Clear( bool deleteWindows=false ), "Clear all items from the sizer, optionally destroying the window items as well.", ""); @@ -820,15 +820,15 @@ as well.", ""); %extend { DocAStr(Show, - "Show(self, item, bool show=True, bool recursive=False) -> bool", + "Show(self, item, bool show=True, bool recursive=false) -> bool", "Shows or hides an item managed by the sizer. To make a sizer item disappear or reappear, use Show followed by `Layout`. The *item* parameter can be either a window, a sizer, or the zero-based index of the item. Use the recursive parameter to show or hide an item in a subsizer. Returns True if the item was found.", ""); - bool Show(PyObject* item, bool show = True, bool recursive=False) { + bool Show(PyObject* item, bool show = true, bool recursive=false) { bool blocked = wxPyBeginBlockThreads(); - wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True); + wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true); wxPyEndBlockThreads(blocked); if ( info.window ) return self->Show(info.window, show, recursive); @@ -846,7 +846,7 @@ parameter can be either a window, a sizer, or the zero-based index of the item.", ""); bool IsShown(PyObject* item) { bool blocked = wxPyBeginBlockThreads(); - wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False); + wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, false); wxPyEndBlockThreads(blocked); if ( info.window ) return self->IsShown(info.window); @@ -855,16 +855,16 @@ the item.", ""); else if ( info.gotPos ) return self->IsShown(info.pos); else - return False; + return false; } } %pythoncode { - def Hide(self, item, recursive=False): + def Hide(self, item, recursive=false): """ A convenience method for Show(item, False, recursive). """ - return self.Show(item, False, recursive) + return self.Show(item, false, recursive) } diff --git a/wxPython/src/_sound.i b/wxPython/src/_sound.i index f82c444df1..9ddc7901c7 100644 --- a/wxPython/src/_sound.i +++ b/wxPython/src/_sound.i @@ -110,7 +110,7 @@ public: %#ifndef __WXMAC__ unsigned char* buffer; int size; - bool rv = False; + bool rv = false; bool blocked = wxPyBeginBlockThreads(); if (!PyArg_Parse(data, "t#", &buffer, &size)) @@ -124,7 +124,7 @@ public: PyErr_SetString(PyExc_NotImplementedError, "Create from data is not available on this platform."); wxPyEndBlockThreads(blocked); - return False; + return false; %#endif } } diff --git a/wxPython/src/_splitter.i b/wxPython/src/_splitter.i index af4516454a..a3f7f8953a 100644 --- a/wxPython/src/_splitter.i +++ b/wxPython/src/_splitter.i @@ -293,7 +293,7 @@ showing the top-level window.", ""); DocDeclStr( - void , SetSashPosition(int position, bool redraw = True), + void , SetSashPosition(int position, bool redraw = true), "Sets the sash position, in pixels. If redraw is Ttrue then the panes are resized and the sash and border are redrawn.", ""); diff --git a/wxPython/src/_stockobjs.i b/wxPython/src/_stockobjs.i index 885b0775f0..752e7574e7 100644 --- a/wxPython/src/_stockobjs.i +++ b/wxPython/src/_stockobjs.i @@ -128,7 +128,7 @@ public: void AddFont(wxFont* font); wxFont * FindOrCreateFont(int point_size, int family, int style, int weight, - bool underline = False, const wxString& facename = wxPyEmptyString, + bool underline = false, const wxString& facename = wxPyEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); void RemoveFont(wxFont *font); diff --git a/wxPython/src/_streams.i b/wxPython/src/_streams.i index df85f9914e..ed762b075e 100644 --- a/wxPython/src/_streams.i +++ b/wxPython/src/_streams.i @@ -27,15 +27,15 @@ %typemap(in) wxInputStream* (wxPyInputStream* temp, bool created) { if (wxPyConvertSwigPtr($input, (void **)&temp, wxT("wxPyInputStream"))) { $1 = temp->m_wxis; - created = False; + created = false; } else { PyErr_Clear(); // clear the failure of the wxPyConvert above - $1 = wxPyCBInputStream_create($input, False); + $1 = wxPyCBInputStream_create($input, false); if ($1 == NULL) { PyErr_SetString(PyExc_TypeError, "Expected wxInputStream or Python file-like object."); SWIG_fail; } - created = True; + created = true; } } %typemap(freearg) wxInputStream* { @@ -54,7 +54,7 @@ if ($1) { _ptr = new wxPyInputStream($1); } - $result = wxPyConstructObject(_ptr, wxT("wxPyInputStream"), True); + $result = wxPyConstructObject(_ptr, wxT("wxPyInputStream"), true); } diff --git a/wxPython/src/_textctrl.i b/wxPython/src/_textctrl.i index e54457e723..9a5cca80ea 100644 --- a/wxPython/src/_textctrl.i +++ b/wxPython/src/_textctrl.i @@ -305,7 +305,7 @@ the client area origin nor scrolling. ", "", #ifdef __WXMSW__ // Caret handling (Windows only) - bool ShowNativeCaret(bool show = True); + bool ShowNativeCaret(bool show = true); bool HideNativeCaret(); #endif diff --git a/wxPython/src/_timer.i b/wxPython/src/_timer.i index e09e7509d0..b84e0db64b 100644 --- a/wxPython/src/_timer.i +++ b/wxPython/src/_timer.i @@ -80,7 +80,7 @@ public: // // it is now valid to call Start() multiple times: this just restarts the // timer if it is already running - virtual bool Start(int milliseconds = -1, bool oneShot = False); + virtual bool Start(int milliseconds = -1, bool oneShot = false); // stop the timer virtual void Stop(); @@ -138,10 +138,10 @@ class wxTimerRunner public: %nokwargs wxTimerRunner; wxTimerRunner(wxTimer& timer); - wxTimerRunner(wxTimer& timer, int milli, bool oneShot = False); + wxTimerRunner(wxTimer& timer, int milli, bool oneShot = false); ~wxTimerRunner(); - void Start(int milli, bool oneShot = False); + void Start(int milli, bool oneShot = false); }; diff --git a/wxPython/src/_tipdlg.i b/wxPython/src/_tipdlg.i index cd839ccca8..2713eaf6e5 100644 --- a/wxPython/src/_tipdlg.i +++ b/wxPython/src/_tipdlg.i @@ -82,7 +82,7 @@ public: // // The function returns True if this checkbox is checked, False otherwise. MustHaveApp(wxShowTip); -bool wxShowTip(wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup = True); +bool wxShowTip(wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup = true); // a function which returns an implementation of wxTipProvider using the // specified text file as the source of tips (each line is a tip). diff --git a/wxPython/src/_toplvl.i b/wxPython/src/_toplvl.i index 2a42716275..6e288c279c 100644 --- a/wxPython/src/_toplvl.i +++ b/wxPython/src/_toplvl.i @@ -85,13 +85,13 @@ public: // No constructor as it can not be used directly from Python // maximize = True => maximize, otherwise - restore - virtual void Maximize(bool maximize = True); + virtual void Maximize(bool maximize = true); // undo Maximize() or Iconize() virtual void Restore(); // iconize = True => iconize, otherwise - restore - virtual void Iconize(bool iconize = True); + virtual void Iconize(bool iconize = true); // return True if the frame is maximized virtual bool IsMaximized() const; diff --git a/wxPython/src/_treectrl.i b/wxPython/src/_treectrl.i index 2e7da38712..50830f0e57 100644 --- a/wxPython/src/_treectrl.i +++ b/wxPython/src/_treectrl.i @@ -96,8 +96,8 @@ public: bool IsOk() const; %extend { - bool __eq__(const wxTreeItemId* other) { return other ? (*self == *other) : False; } - bool __ne__(const wxTreeItemId* other) { return other ? (*self != *other) : True; } + bool __eq__(const wxTreeItemId* other) { return other ? (*self == *other) : false; } + bool __ne__(const wxTreeItemId* other) { return other ? (*self != *other) : true; } } void* m_pItem; @@ -288,8 +288,8 @@ public: bool found; bool blocked = wxPyBeginBlockThreads(); if ((found = wxPyCBH_findCallback(m_myInst, "OnCompareItems"))) { - PyObject *o1 = wxPyConstructObject((void*)&item1, wxT("wxTreeItemId"), False); - PyObject *o2 = wxPyConstructObject((void*)&item2, wxT("wxTreeItemId"), False); + PyObject *o1 = wxPyConstructObject((void*)&item1, wxT("wxTreeItemId"), false); + PyObject *o2 = wxPyConstructObject((void*)&item2, wxT("wxTreeItemId"), false); rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)",o1,o2)); Py_DECREF(o1); Py_DECREF(o2); @@ -450,14 +450,14 @@ public: // allow the user to expand the items which don't have any children now // - but instead add them only when needed, thus minimizing memory // usage and loading time. - void SetItemHasChildren(const wxTreeItemId& item, bool has = True); + void SetItemHasChildren(const wxTreeItemId& item, bool has = true); // the item will be shown in bold - void SetItemBold(const wxTreeItemId& item, bool bold = True); + void SetItemBold(const wxTreeItemId& item, bool bold = true); #ifdef __WXMSW__ // the item will be shown with a drop highlight - void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = True); + void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true); #endif // set the items text colour @@ -489,7 +489,7 @@ public: // if 'recursively' is False, only immediate children count, otherwise // the returned number is the number of all items in this branch size_t GetChildrenCount(const wxTreeItemId& item, - bool recursively = True) /*const*/; + bool recursively = true) /*const*/; @@ -514,7 +514,7 @@ public: num = self->GetSelections(array); for (x=0; x < num; x++) { wxTreeItemId *tii = new wxTreeItemId(array.Item(x)); - PyObject* item = wxPyConstructObject((void*)tii, wxT("wxTreeItemId"), True); + PyObject* item = wxPyConstructObject((void*)tii, wxT("wxTreeItemId"), true); PyList_Append(rval, item); Py_DECREF(item); } @@ -539,7 +539,7 @@ public: wxTreeItemId* ritem = new wxTreeItemId(self->GetFirstChild(item, cookie)); bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), True)); + PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true)); PyTuple_SET_ITEM(tup, 1, wxPyMakeSwigPtr(cookie, wxT("void"))); wxPyEndBlockThreads(blocked); return tup; @@ -554,7 +554,7 @@ public: wxTreeItemId* ritem = new wxTreeItemId(self->GetNextChild(item, cookie)); bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), True)); + PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(ritem, wxT("wxTreeItemId"), true)); PyTuple_SET_ITEM(tup, 1, wxPyMakeSwigPtr(cookie, wxT("void"))); wxPyEndBlockThreads(blocked); return tup; @@ -651,7 +651,7 @@ public: void UnselectAll(); // select this item - void SelectItem(const wxTreeItemId& item, bool select = True); + void SelectItem(const wxTreeItemId& item, bool select = true); // toggle the item selection void ToggleItemSelection(const wxTreeItemId& item); @@ -678,7 +678,7 @@ public: #ifdef __WXMSW__ // end editing and accept or discard the changes to item label - void EndEditLabel(const wxTreeItemId& item, bool discardChanges = False); + void EndEditLabel(const wxTreeItemId& item, bool discardChanges = false); #endif @@ -702,12 +702,12 @@ value is set to a bitmask of wxTREE_HITTEST_xxx constants. %extend { // get the bounding rectangle of the item (or of its label only) - PyObject* GetBoundingRect(const wxTreeItemId& item, bool textOnly = False) { + PyObject* GetBoundingRect(const wxTreeItemId& item, bool textOnly = false) { wxRect rect; if (self->GetBoundingRect(item, rect, textOnly)) { bool blocked = wxPyBeginBlockThreads(); wxRect* r = new wxRect(rect); - PyObject* val = wxPyConstructObject((void*)r, wxT("wxRect"), True); + PyObject* val = wxPyConstructObject((void*)r, wxT("wxRect"), true); wxPyEndBlockThreads(blocked); return val; } diff --git a/wxPython/src/_validator.i b/wxPython/src/_validator.i index e68789f9e9..b3e4e55aa4 100644 --- a/wxPython/src/_validator.i +++ b/wxPython/src/_validator.i @@ -61,7 +61,7 @@ public: // validators beep by default if invalid key is pressed, these functions // allow to change it static bool IsSilent(); - static void SetBellOnError(int doIt = True); + static void SetBellOnError(int doIt = true); }; @@ -83,7 +83,7 @@ public: self._setOORInfo(self)" wxPyValidator(); - void _setCallbackInfo(PyObject* self, PyObject* _class, int incref=True); + void _setCallbackInfo(PyObject* self, PyObject* _class, int incref=true); }; diff --git a/wxPython/src/_vscroll.i b/wxPython/src/_vscroll.i index dc234c44ea..7a9b32dba6 100644 --- a/wxPython/src/_vscroll.i +++ b/wxPython/src/_vscroll.i @@ -87,7 +87,7 @@ public: // find the index of the line we need to show at the top of the window such // that the last (fully or partially) visible line is the given one - size_t FindFirstFromBottom(size_t lineLast, bool fullyVisible = False) + size_t FindFirstFromBottom(size_t lineLast, bool fullyVisible = false) { return wxVScrolledWindow::FindFirstFromBottom(lineLast, fullyVisible); } // get the total height of the lines between lineMin (inclusive) and @@ -399,7 +399,7 @@ public: // otherwise // // this function is only valid for the multiple selection listboxes - bool Select(size_t item, bool select = True); + bool Select(size_t item, bool select = true); // selects the items in the specified range whose end points may be given // in any order diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index ee7a56a782..e423775d55 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -232,7 +232,7 @@ public: DocDeclStr( - bool , Close( bool force = False ), + bool , Close( bool force = false ), "This function simply generates a EVT_CLOSE event whose handler usually tries to close the window. It doesn't close the window itself, however. If force is False (the default) then the window's close @@ -696,7 +696,7 @@ sizer, interior children, or other means)", ""); // ------------ DocDeclStr( - virtual bool , Show( bool show = True ), + virtual bool , Show( bool show = true ), "Shows or hides the window. You may need to call Raise for a top level window if you want to bring it to top, although this is not needed if Show is called immediately after the frame creation. Returns True if @@ -709,7 +709,7 @@ because it already was in the requested state.", ""); DocDeclStr( - virtual bool , Enable( bool enable = True ), + virtual bool , Enable( bool enable = true ), "Enable or disable the window for user input. Note that when a parent window is disabled, all of its children are disabled as well and they are reenabled again when the parent is. Returns true if the window @@ -772,7 +772,7 @@ SetWindowStyleFlag()", ""); DocDeclStr( - virtual void , MakeModal(bool modal = True), + virtual void , MakeModal(bool modal = true), "Disables all other windows in the application so that the user can only interact with this window. Passing False will reverse this effect.", ""); @@ -1015,7 +1015,7 @@ remove the event handler.", ""); DocDeclStr( - wxEvtHandler *, PopEventHandler( bool deleteHandler = False ), + wxEvtHandler *, PopEventHandler( bool deleteHandler = false ), "Removes and returns the top-most event handler on the event handler stack. If deleteHandler is True then the wx.EvtHandler object will be destroyed after it is popped.", ""); @@ -1110,7 +1110,7 @@ hotkey was registered successfully.", ""); %#if wxUSE_HOTKEY return self->RegisterHotKey(hotkeyId, modifiers, keycode); %#else - return False; + return false; %#endif } @@ -1121,7 +1121,7 @@ hotkey was registered successfully.", ""); #if wxUSE_HOTKEY return self->UnregisterHotKey(hotkeyId); #else - return False; + return false; #endif } } @@ -1200,7 +1200,7 @@ release the mouse as many times as you capture it.", ""); // ------------------- DocDeclStr( - virtual void , Refresh( bool eraseBackground = True, + virtual void , Refresh( bool eraseBackground = true, const wxRect *rect = NULL ), "Mark the specified rectangle (or the whole window) as \"dirty\" so it will be repainted. Causes an EVT_PAINT event to be generated and sent @@ -1610,7 +1610,7 @@ toplevel parent of the window.", ""); int position, int thumbSize, int range, - bool refresh = True ), + bool refresh = true ), "Sets the scrollbar properties of a built-in scrollbar.", " :param orientation: Determines the scrollbar whose page size is to @@ -1627,7 +1627,7 @@ toplevel parent of the window.", ""); "); DocDeclStr( - virtual void , SetScrollPos( int orientation, int pos, bool refresh = True ), + virtual void , SetScrollPos( int orientation, int pos, bool refresh = true ), "Sets the position of one of the built-in scrollbars.", ""); DocDeclStr( @@ -1814,16 +1814,16 @@ handler when the window is resized.", ""); DocDeclStr( - void , SetSizer(wxSizer *sizer, bool deleteOld = True ), + void , SetSizer(wxSizer *sizer, bool deleteOld = true ), "Sets the window to have the given layout sizer. The window will then own the object, and will take care of its deletion. If an existing layout sizer object is already owned by the window, it will be deleted if the deleteOld parameter is true. Note that this function will also call SetAutoLayout implicitly with a True parameter if the sizer is -non-NoneL and False otherwise.", ""); +non-None, and False otherwise.", ""); DocDeclStr( - void , SetSizerAndFit( wxSizer *sizer, bool deleteOld = True ), + void , SetSizerAndFit( wxSizer *sizer, bool deleteOld = true ), "The same as SetSizer, except it also sets the size hints for the window based on the sizer's minimum size.", ""); diff --git a/wxPython/src/_xmlhandler.i b/wxPython/src/_xmlhandler.i index 018d20777a..4cad2e6e67 100644 --- a/wxPython/src/_xmlhandler.i +++ b/wxPython/src/_xmlhandler.i @@ -69,7 +69,7 @@ public: int GetStyle(const wxString& param = wxT("style"), int defaults = 0) { return wxXmlResourceHandler::GetStyle(param, defaults); } - wxString GetText(const wxString& param, bool translate = True) + wxString GetText(const wxString& param, bool translate = true) { return wxXmlResourceHandler::GetText(param, translate); } int GetID() @@ -78,7 +78,7 @@ public: wxString GetName() { return wxXmlResourceHandler::GetName(); } - bool GetBool(const wxString& param, bool defaultv = False) + bool GetBool(const wxString& param, bool defaultv = false) { return wxXmlResourceHandler::GetBool(param, defaultv); } long GetLong( const wxString& param, long defaultv = 0 ) @@ -112,7 +112,7 @@ public: void SetupWindow(wxWindow *wnd) { wxXmlResourceHandler::SetupWindow(wnd); } - void CreateChildren(wxObject *parent, bool this_hnd_only = False) + void CreateChildren(wxObject *parent, bool this_hnd_only = false) { wxXmlResourceHandler::CreateChildren(parent, this_hnd_only); } void CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL) @@ -204,7 +204,7 @@ public: // - replaces \n, \r, \t by respective chars (according to C syntax) // - replaces _ by & and __ by _ (needed for _File => &File because of XML) // - calls wxGetTranslations (unless disabled in wxXmlResource) - wxString GetText(const wxString& param, bool translate = True); + wxString GetText(const wxString& param, bool translate = true); // Returns the XRCID. int GetID(); @@ -212,8 +212,8 @@ public: // Returns the resource name. wxString GetName(); - // Gets a bool flag (1, t, yes, on, true are True, everything else is False). - bool GetBool(const wxString& param, bool defaultv = False); + // Gets a bool flag (1, t, yes, on, true are True, everything else is false). + bool GetBool(const wxString& param, bool defaultv = false); // Gets the integer value from the parameter. long GetLong( const wxString& param, long defaultv = 0 ); @@ -247,7 +247,7 @@ public: void SetupWindow(wxWindow *wnd); // Creates children. - void CreateChildren(wxObject *parent, bool this_hnd_only = False); + void CreateChildren(wxObject *parent, bool this_hnd_only = false); // Helper function. void CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL); diff --git a/wxPython/src/calendar.i b/wxPython/src/calendar.i index b28a58bf7a..7dfc184c9b 100644 --- a/wxPython/src/calendar.i +++ b/wxPython/src/calendar.i @@ -292,20 +292,20 @@ creation.", ""); DocDeclStr( - void, EnableYearChange(bool enable = True), + void, EnableYearChange(bool enable = true), "This function should be used instead of changing CAL_NO_YEAR_CHANGE style bit directly. It allows or disallows the user to change the year interactively.", ""); DocDeclStr( - void, EnableMonthChange(bool enable = True), + void, EnableMonthChange(bool enable = true), "This function should be used instead of changing CAL_NO_MONTH_CHANGE style bit. It allows or disallows the user to change the month interactively. Note that if the month can not be changed, the year can not be changed either.", ""); DocDeclStr( - void, EnableHolidayDisplay(bool display = True), + void, EnableHolidayDisplay(bool display = true), "This function should be used instead of changing CAL_SHOW_HOLIDAYS style bit directly. It enables or disables the special highlighting of the holidays.", ""); diff --git a/wxPython/src/grid.i b/wxPython/src/grid.i index 90d1855378..5b46663356 100644 --- a/wxPython/src/grid.i +++ b/wxPython/src/grid.i @@ -835,7 +835,7 @@ public: bool EndEdit(int row, int col, wxGrid* grid) { - bool rv = False; + bool rv = false; bool blocked = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "EndEdit")) { PyObject* go = wxPyMake_wxObject(grid,false); @@ -993,7 +993,7 @@ public: %pythonAppend wxGridCellChoiceEditor "self._setOORInfo(self)" wxGridCellChoiceEditor(int choices = 0, const wxString* choices_array = NULL, - bool allowOthers = False); + bool allowOthers = false); virtual wxString GetValue(); }; @@ -1053,8 +1053,8 @@ public: void SetFont(const wxFont& font); void SetAlignment(int hAlign, int vAlign); void SetSize(int num_rows, int num_cols); - void SetOverflow( bool allow = True ); - void SetReadOnly(bool isReadOnly = True); + void SetOverflow( bool allow = true ); + void SetReadOnly(bool isReadOnly = true); void SetRenderer(wxGridCellRenderer *renderer); void SetEditor(wxGridCellEditor* editor); @@ -1453,7 +1453,7 @@ bool wxGridCellCoords_helper(PyObject* source, wxGridCellCoords** obj) { if (source == Py_None) { **obj = wxGridCellCoords(-1,-1); - return True; + return true; } // If source is an object instance then it may already be the right type @@ -1462,7 +1462,7 @@ bool wxGridCellCoords_helper(PyObject* source, wxGridCellCoords** obj) { if (! wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxGridCellCoords"))) goto error; *obj = ptr; - return True; + return true; } // otherwise a 2-tuple of integers is expected else if (PySequence_Check(source) && PyObject_Length(source) == 2) { @@ -1476,12 +1476,12 @@ bool wxGridCellCoords_helper(PyObject* source, wxGridCellCoords** obj) { **obj = wxGridCellCoords(PyInt_AsLong(o1), PyInt_AsLong(o2)); Py_DECREF(o1); Py_DECREF(o2); - return True; + return true; } error: PyErr_SetString(PyExc_TypeError, "Expected a 2-tuple of integers or a wxGridCellCoords object."); - return False; + return false; } @@ -1490,13 +1490,13 @@ bool wxGridCellCoords_typecheck(PyObject* source) { if (wxPySwigInstance_Check(source) && wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxGridCellCoords"))) - return True; + return true; PyErr_Clear(); if (PySequence_Check(source) && PySequence_Length(source) == 2) - return True; + return true; - return False; + return false; } %} @@ -1643,17 +1643,17 @@ public: wxGridTableBase * GetTable() const; - bool SetTable( wxGridTableBase *table, bool takeOwnership=False, + bool SetTable( wxGridTableBase *table, bool takeOwnership=false, WXGRIDSELECTIONMODES selmode = wxGrid::wxGridSelectCells ); void ClearGrid(); - bool InsertRows( int pos = 0, int numRows = 1, bool updateLabels=True ); - bool AppendRows( int numRows = 1, bool updateLabels=True ); - bool DeleteRows( int pos = 0, int numRows = 1, bool updateLabels=True ); - bool InsertCols( int pos = 0, int numCols = 1, bool updateLabels=True ); - bool AppendCols( int numCols = 1, bool updateLabels=True ); - bool DeleteCols( int pos = 0, int numCols = 1, bool updateLabels=True ); + bool InsertRows( int pos = 0, int numRows = 1, bool updateLabels=true ); + bool AppendRows( int numRows = 1, bool updateLabels=true ); + bool DeleteRows( int pos = 0, int numRows = 1, bool updateLabels=true ); + bool InsertCols( int pos = 0, int numCols = 1, bool updateLabels=true ); + bool AppendCols( int numCols = 1, bool updateLabels=true ); + bool DeleteCols( int pos = 0, int numCols = 1, bool updateLabels=true ); // this function is called when the current cell highlight must be redrawn @@ -1695,7 +1695,7 @@ public: bool IsEditable(); void EnableEditing( bool edit ); - void EnableCellEditControl( bool enable = True ); + void EnableCellEditControl( bool enable = true ); void DisableCellEditControl(); bool CanEnableCellControl() const; bool IsCellEditControlEnabled() const; @@ -1739,8 +1739,8 @@ public: // check to see if a cell is either wholly visible (the default arg) or // at least partially visible in the grid window // - bool IsVisible( int row, int col, bool wholeCellVisible = True ); - // TODO: ??? bool IsVisible( const wxGridCellCoords& coords, bool wholeCellVisible = True ); + bool IsVisible( int row, int col, bool wholeCellVisible = true ); + // TODO: ??? bool IsVisible( const wxGridCellCoords& coords, bool wholeCellVisible = true ); void MakeCellVisible( int row, int col ); // TODO: ??? void MakeCellVisible( const wxGridCellCoords& coords ); @@ -1801,17 +1801,17 @@ public: void SetCellHighlightPenWidth(int width); void SetCellHighlightROPenWidth(int width); - void EnableDragRowSize( bool enable = True ); + void EnableDragRowSize( bool enable = true ); void DisableDragRowSize(); bool CanDragRowSize(); - void EnableDragColSize( bool enable = True ); + void EnableDragColSize( bool enable = true ); void DisableDragColSize(); bool CanDragColSize(); - void EnableDragGridSize(bool enable = True); + void EnableDragGridSize(bool enable = true); void DisableDragGridSize(); bool CanDragGridSize(); - void EnableDragCell( bool enable = True ); + void EnableDragCell( bool enable = true ); void DisableDragCell(); bool CanDragCell(); @@ -1835,7 +1835,7 @@ public: void SetColFormatFloat(int col, int width = -1, int precision = -1); void SetColFormatCustom(int col, const wxString& typeName); - void EnableGridLines( bool enable = True ); + void EnableGridLines( bool enable = true ); bool GridLinesEnabled(); // ------ row and col formatting @@ -1866,22 +1866,22 @@ public: void, GetCellSize( int row, int col, int *OUTPUT, int *OUTPUT ), "GetCellSize(int row, int col) -> (num_rows, num_cols)"); - void SetDefaultRowSize( int height, bool resizeExistingRows = False ); + void SetDefaultRowSize( int height, bool resizeExistingRows = false ); void SetRowSize( int row, int height ); - void SetDefaultColSize( int width, bool resizeExistingCols = False ); + void SetDefaultColSize( int width, bool resizeExistingCols = false ); void SetColSize( int col, int width ); // automatically size the column or row to fit to its contents, if // setAsMin is True, this optimal width will also be set as minimal width // for this column - void AutoSizeColumn( int col, bool setAsMin = True ); - void AutoSizeRow( int row, bool setAsMin = True ); + void AutoSizeColumn( int col, bool setAsMin = true ); + void AutoSizeRow( int row, bool setAsMin = true ); // auto size all columns (very ineffective for big grids!) - void AutoSizeColumns( bool setAsMin = True ); - void AutoSizeRows( bool setAsMin = True ); + void AutoSizeColumns( bool setAsMin = true ); + void AutoSizeRows( bool setAsMin = true ); // auto size the grid, that is make the columns/rows of the "right" size // and also set the grid size to just fit its contents @@ -1944,15 +1944,15 @@ public: bool IsReadOnly(int row, int col) const; // make the cell editable/readonly - void SetReadOnly(int row, int col, bool isReadOnly = True); + void SetReadOnly(int row, int col, bool isReadOnly = true); // ------ selections of blocks of cells // - void SelectRow( int row, bool addToSelected = False ); - void SelectCol( int col, bool addToSelected = False ); + void SelectRow( int row, bool addToSelected = false ); + void SelectCol( int col, bool addToSelected = false ); void SelectBlock( int topRow, int leftCol, int bottomRow, int rightCol, - bool addToSelected = False ); + bool addToSelected = false ); // TODO: ??? void SelectBlock( const wxGridCellCoords& topLeft, // TODO: ??? const wxGridCellCoords& bottomRight ) @@ -2026,8 +2026,8 @@ class wxGridEvent : public wxNotifyEvent { public: wxGridEvent(int id, wxEventType type, wxGrid* obj, - int row=-1, int col=-1, int x=-1, int y=-1, bool sel = True, - bool control=False, bool shift=False, bool alt=False, bool meta=False); + int row=-1, int col=-1, int x=-1, int y=-1, bool sel = true, + bool control=false, bool shift=false, bool alt=false, bool meta=false); virtual int GetRow(); virtual int GetCol(); @@ -2046,7 +2046,7 @@ class wxGridSizeEvent : public wxNotifyEvent public: wxGridSizeEvent(int id, wxEventType type, wxGrid* obj, int rowOrCol=-1, int x=-1, int y=-1, - bool control=False, bool shift=False, bool alt=False, bool meta=False); + bool control=false, bool shift=false, bool alt=false, bool meta=false); int GetRowOrCol(); wxPoint GetPosition(); @@ -2064,9 +2064,9 @@ public: wxGridRangeSelectEvent(int id, wxEventType type, wxGrid* obj, const wxGridCellCoords& topLeft, const wxGridCellCoords& bottomRight, - bool sel = True, - bool control=False, bool shift=False, - bool alt=False, bool meta=False); + bool sel = true, + bool control=false, bool shift=false, + bool alt=false, bool meta=false); wxGridCellCoords GetTopLeftCoords(); wxGridCellCoords GetBottomRightCoords(); diff --git a/wxPython/src/html.i b/wxPython/src/html.i index 42fdb2f0bd..fa26472ed3 100644 --- a/wxPython/src/html.i +++ b/wxPython/src/html.i @@ -137,7 +137,7 @@ public: wxString GetName(); bool HasParam(const wxString& par); - wxString GetParam(const wxString& par, int with_commas = False); + wxString GetParam(const wxString& par, int with_commas = false); // Can't do this one as-is, but GetParam should be enough... //int ScanParam(const wxString& par, const char *format, void* param); @@ -635,7 +635,7 @@ public: // returns True if this filter is able to open&read given file virtual bool CanRead(const wxFSFile& file) const { - bool rval = False; + bool rval = false; bool found; bool blocked = wxPyBeginBlockThreads(); if ((found = wxPyCBH_findCallback(m_myInst, "CanRead"))) { @@ -947,7 +947,7 @@ public: void SetSize(int width, int height); void SetHtmlText(const wxString& html, const wxString& basepath = wxPyEmptyString, - bool isdir = True); + bool isdir = true); // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). %extend { void SetFonts(wxString normal_face, wxString fixed_face, PyObject* sizes=NULL) { @@ -962,7 +962,7 @@ public: // Sets font sizes to be relative to the given size or the system default size void NormalizeFontSizes(int size=-1); - int Render(int x, int y, int from = 0, int dont_render = False, int to = INT_MAX, + int Render(int x, int y, int from = 0, int dont_render = false, int to = INT_MAX, //int *known_pagebreaks = NULL, int number_of_pages = 0 int* choices=NULL, int LCOUNT = 0 ); @@ -988,7 +988,7 @@ public: void SetHtmlText(const wxString& html, const wxString &basepath = wxPyEmptyString, - bool isdir = True); + bool isdir = true); void SetHtmlFile(const wxString &htmlfile); void SetHeader(const wxString& header, int pg = wxPAGE_ALL); void SetFooter(const wxString& footer, int pg = wxPAGE_ALL); @@ -1188,7 +1188,7 @@ public: void SetTitleFormat(const wxString& format); void SetTempDir(const wxString& path); - bool AddBook(const wxString& book, int show_wait_msg = False); + bool AddBook(const wxString& book, int show_wait_msg = false); void Display(const wxString& x); %name(DisplayID) void Display(int id); void DisplayContents(); diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index 9e30c677f8..33f6d98e20 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -47,10 +47,10 @@ MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field) // wxString typemaps -%typemap(in) wxString& (bool temp=False) { +%typemap(in) wxString& (bool temp=false) { $1 = wxString_in_helper($input); if ($1 == NULL) SWIG_fail; - temp = True; + temp = true; } %typemap(freearg) wxString& { if (temp$argnum) @@ -101,7 +101,7 @@ MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field) //--------------------------------------------------------------------------- // wxMemoryBuffer (needed for wxSTC) -%typemap(in) wxMemoryBuffer& (bool temp=False) { +%typemap(in) wxMemoryBuffer& (bool temp=false) { if (!PyString_Check($input)) { PyErr_SetString(PyExc_TypeError, "String buffer expected"); SWIG_fail; @@ -109,7 +109,7 @@ MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field) char* str = PyString_AS_STRING($input); int len = PyString_GET_SIZE($input); $1 = new wxMemoryBuffer(len); - temp = True; + temp = true; memcpy($1->GetData(), str, len); $1->SetDataLen(len); } @@ -191,13 +191,13 @@ MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field) //--------------------------------------------------------------------------- // Typemap for wxArrayString from Python sequence objects -%typemap(in) wxArrayString& (bool temp=False) { +%typemap(in) wxArrayString& (bool temp=false) { if (! PySequence_Check($input)) { PyErr_SetString(PyExc_TypeError, "Sequence of strings expected."); SWIG_fail; } $1 = new wxArrayString; - temp = True; + temp = true; int i, len=PySequence_Length($input); for (i=0; i