Changed all TRUE/true --> True and all FALSE/false --> False so the

Python docstrings will have the correct case.

Started adding extra docstrings where needed.

Some other little tweaks and fixes.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2003-11-19 06:31:30 +00:00
parent cd303fbbc1
commit dd9f7fea29
74 changed files with 1130 additions and 860 deletions

View File

@ -272,8 +272,8 @@ public:
wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) {
PyObject* dcobj = wxPyMake_wxObject(&dc);
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);
@ -661,10 +661,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& col);
@ -697,12 +697,12 @@ public:
// is item text in bold font?
bool IsBold(const wxTreeItemId& item) const;
// if 'recursively' is FALSE, only immediate children count, otherwise
// 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
// wxTreeItemId.IsOk() will return False if there is no such item
// get the root tree item
wxTreeItemId GetRootItem() const;
@ -721,7 +721,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();
@ -858,8 +858,8 @@ 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);
// make sure this item is visible (expanding the parent item and/or
// scrolling to this item if necessary)
@ -873,7 +873,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)) {
wxPyBeginBlockThreads();

View File

@ -92,7 +92,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);
@ -101,8 +101,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);
@ -112,7 +112,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);
@ -175,21 +175,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);
@ -233,14 +233,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();
@ -299,8 +299,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);
@ -331,7 +331,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);
@ -345,7 +345,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);
@ -354,8 +354,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);
@ -365,7 +365,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);

View File

@ -143,8 +143,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);
@ -154,7 +154,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);
@ -194,8 +194,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);
@ -205,7 +205,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);
@ -245,8 +245,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);
@ -256,7 +256,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);
@ -323,8 +323,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);
@ -334,7 +334,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);
@ -445,8 +445,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);
@ -456,7 +456,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);
@ -496,8 +496,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);
@ -507,7 +507,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);
@ -571,8 +571,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);
@ -582,7 +582,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);

View File

@ -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);
@ -220,8 +220,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);
@ -231,7 +231,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);
@ -306,8 +306,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);
@ -317,7 +317,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);
@ -350,8 +350,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);
@ -361,7 +361,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);

View File

@ -135,7 +135,7 @@ public:
~wxXmlDocument();
// Parses .xml file and loads data. Returns TRUE on success, FALSE
// Parses .xml file and loads data. Returns True on success, False
// otherwise.
bool Load(const wxString& filename,
const wxString& encoding = wxPyUTF8String);

View File

@ -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);

View File

@ -195,7 +195,7 @@ public:
%pythoncode {
def XRCID(str_id):
return wxXmlResource_GetXRCID(str_id)
return XmlResource_GetXRCID(str_id)
def XRCCTRL(window, str_id, *ignoreargs):
return window.FindWindowById(XRCID(str_id))

View File

@ -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

View File

@ -97,7 +97,7 @@ static void wxPyCoreAPI_IMPORT() {
#define wxPyCBH_callCallbackObj(a, b) (wxPyCoreAPIPtr->p_wxPyCBH_callCallbackObj(a, b))
#define wxPyCBH_delete(a) (wxPyCoreAPIPtr->p_wxPyCBH_delete(a))
#define wxPyMake_wxObject(a) (wxPyCoreAPIPtr->p_wxPyMake_wxObject(a,TRUE))
#define wxPyMake_wxObject(a) (wxPyCoreAPIPtr->p_wxPyMake_wxObject(a,True))
#define wxPyMake_wxObject2(a,b) (wxPyCoreAPIPtr->p_wxPyMake_wxObject(a,b))
#define wxPyMake_wxSizer(a) (wxPyCoreAPIPtr->p_wxPyMake_wxSizer(a))
#define wxPyPtrTypeMap_Add(a, b) (wxPyCoreAPIPtr->p_wxPyPtrTypeMap_Add(a, b))

View File

@ -82,6 +82,9 @@
typedef unsigned char byte;
typedef wxPoint2DDouble wxPoint2D;
const bool True = true;
const bool False = false;
#ifndef wxPyUSE_EXPORTED_API
@ -105,7 +108,7 @@ PyObject* wxPyMakeSwigPtr(void* ptr, const char* classname);
PyObject* wx2PyString(const wxString& src);
wxString Py2wxString(PyObject* source);
PyObject* wxPyMake_wxObject(wxObject* source, bool checkEvtHandler=TRUE);
PyObject* wxPyMake_wxObject(wxObject* source, bool checkEvtHandler=True);
PyObject* wxPyMake_wxSizer(wxSizer* source);
void wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName);
@ -180,7 +183,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) {
@ -194,14 +197,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;
}
@ -256,7 +259,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; }
@ -493,7 +496,7 @@ public:
m_class = NULL;
m_self = NULL;
m_lastFound = NULL;
m_incRef = FALSE;
m_incRef = False;
}
~wxPyCallbackHelper() {
@ -504,7 +507,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;
@ -634,7 +637,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; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b)); \
@ -846,7 +849,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; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));\
@ -868,7 +871,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; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));\
@ -889,11 +892,11 @@ extern wxPyApp *wxPythonApp;
#define IMP_PYCALLBACK_BOOL_INT_pure(CLASS, PCLASS, CBNAME) \
bool CLASS::CBNAME(int a) { \
bool rval=FALSE; \
bool rval=False; \
wxPyBeginBlockThreads(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \
rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a)); \
else rval = FALSE; \
else rval = False; \
wxPyEndBlockThreads(); \
return rval; \
}
@ -1051,7 +1054,7 @@ extern wxPyApp *wxPythonApp;
bool CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) { \
bool found; \
wxPyBeginBlockThreads(); \
bool rval=FALSE; \
bool rval=False; \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
PyObject* obj = wxPyMake_wxObject(&a); \
rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));\
@ -1261,7 +1264,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; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
@ -1285,7 +1288,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; \
wxPyBeginBlockThreads(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
PyObject* s = wx2PyString(a); \
@ -1377,7 +1380,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; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
@ -1502,7 +1505,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; \
wxPyBeginBlockThreads(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
PyObject* obj = wxPyConstructObject((void*)&a, wxT("wxHtmlTag"), 0); \
@ -1625,7 +1628,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; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
@ -1651,7 +1654,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; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
@ -1703,7 +1706,7 @@ extern wxPyApp *wxPythonApp;
#define IMP_PYCALLBACK_BOOL_(CLASS, PCLASS, CBNAME) \
bool CLASS::CBNAME() { \
bool rval=FALSE; \
bool rval=False; \
bool found; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
@ -1726,7 +1729,7 @@ extern wxPyApp *wxPythonApp;
#define IMP_PYCALLBACK_BOOL_const(CLASS, PCLASS, CBNAME) \
bool CLASS::CBNAME() const { \
bool rval=FALSE; \
bool rval=False; \
bool found; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
@ -1798,7 +1801,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; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \
@ -1835,7 +1838,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; \
wxPyBeginBlockThreads(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
PyObject* s = wx2PyString(c); \
@ -1981,7 +1984,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; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
@ -2006,7 +2009,7 @@ extern wxPyApp *wxPythonApp;
#define IMP_PYCALLBACK_bool_anypure(CLASS, PCLASS, CBNAME, Type) \
bool CLASS::CBNAME(Type& a) { \
bool rv=FALSE; \
bool rv=False; \
wxPyBeginBlockThreads(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
PyObject* obj = wxPyConstructObject((void*)&a, wxT(#Type), 0); \
@ -2114,7 +2117,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; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
@ -2233,7 +2236,7 @@ extern wxPyApp *wxPythonApp;
#define IMP_PYCALLBACK_BOOL_NODE_pure(CLASS, PCLASS, CBNAME) \
bool CLASS::CBNAME(wxXmlNode* a) { \
bool rv=FALSE; \
bool rv=False; \
wxPyBeginBlockThreads(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
PyObject* obj = wxPyConstructObject((void*)a, wxT("wxXmlNode"), 0); \

View File

@ -717,7 +717,7 @@ swig_sources = run_swig(['gdi.i'], 'src', GENDIR, PKGDIR,
'src/_gdiobj.i', 'src/_icon.i',
'src/_imaglist.i', 'src/_pen.i',
'src/_region.i', 'src/_palette.i',
'src/_stockobjs.i', 'src/_dragimg.i',
'src/_stockobjs.i',
'src/_effects.i',
'src/_intl.i',
'src/_intl_ex.py',
@ -779,7 +779,7 @@ swig_sources = run_swig(['controls.i'], 'src', GENDIR, PKGDIR,
'src/_tglbtn.i', 'src/_notebook.i',
'src/_listctrl.i', 'src/_treectrl.i',
'src/_dirctrl.i', 'src/_pycontrol.i',
'src/_cshelp.i',
'src/_cshelp.i', 'src/_dragimg.i',
])
ext = Extension('_controls', swig_sources,
include_dirs = includes,

View File

@ -86,13 +86,13 @@ public:
// process all currently pending events right now
//
// it is an error to call Yield() recursively unless the value of
// onlyIfNeeded is TRUE
// onlyIfNeeded is True
//
// WARNING: this function is dangerous as it can lead to unexpected
// reentrancies (i.e. when called from an event handler it
// may result in calling the same event handler again), use
// with _extreme_ care or, better, don't use at all!
virtual bool Yield(bool onlyIfNeeded = false);
virtual bool Yield(bool onlyIfNeeded = False);
// make sure that idle events are sent again
virtual void WakeUpIdle();
@ -108,7 +108,7 @@ public:
// stop the program immediately!)
virtual void ExitMainLoop();
// returns TRUE if there are unprocessed events in the event queue
// returns True if there are unprocessed events in the event queue
virtual bool Pending();
// process the first event in the event queue (blocks until an event
@ -120,18 +120,18 @@ public:
// becomes idle and normally just sends wxIdleEvent to all interested
// parties
//
// it should return TRUE if more idle events are needed, FALSE if not
// it should return True if more idle events are needed, False if not
virtual bool ProcessIdle() ;
// Send idle event to window and all subwindows
// Returns TRUE if more idle time is requested.
// Returns True if more idle time is requested.
virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event);
// Perform standard OnIdle behaviour: call from port's OnIdle
void OnIdle(wxIdleEvent& event);
// return TRUE if our app has focus
// return True if our app has focus
virtual bool IsActive() const;
// set the "main" top level window
@ -145,7 +145,7 @@ public:
// control the exit behaviour: by default, the program will exit the
// main loop (and so, usually, terminate) when the last top-level
// program window is deleted. Beware that if you disable this behaviour
// (with SetExitOnFrameDelete(FALSE)), you'll have to call
// (with SetExitOnFrameDelete(False)), you'll have to call
// ExitMainLoop() explicitly from somewhere.
void SetExitOnFrameDelete(bool flag);
bool GetExitOnFrameDelete() const;
@ -220,7 +220,7 @@ void wxExit();
// Yield to other apps/messages
bool wxYield();
bool wxYieldIfNeeded();
bool wxSafeYield(wxWindow* win=NULL, bool onlyIfNeeded=FALSE);
bool wxSafeYield(wxWindow* win=NULL, bool onlyIfNeeded=False);
// Cause the message queue to become empty again
void wxWakeUpIdle();

View File

@ -65,7 +65,7 @@ public:
virtual bool Flush();
// X11 has two clipboards which get selected by this call. Empty on MSW.
virtual void UsePrimarySelection( bool primary = FALSE );
virtual void UsePrimarySelection( bool primary = False );
};

View File

@ -54,17 +54,17 @@ public:
// bool __eq__(PyObject* obj) {
// wxColour tmp;
// wxColour* ptr = &tmp;
// if (obj == Py_None) return FALSE;
// if (obj == Py_None) return False;
// wxPyBLOCK_THREADS(bool success = wxColour_helper(obj, &ptr); PyErr_Clear());
// if (! success) return FALSE;
// if (! success) return False;
// return *self == *ptr;
// }
// bool __ne__(PyObject* obj) {
// wxColour tmp;
// wxColour* ptr = &tmp;
// if (obj == Py_None) return TRUE;
// if (obj == Py_None) return True;
// wxPyBLOCK_THREADS(bool success = wxColour_helper(obj, &ptr); PyErr_Clear());
// if (! success) return TRUE;
// if (! success) return True;
// return *self != *ptr;
// }
}

View File

@ -78,7 +78,7 @@ public:
// get the config object, creates it on demand unless DontCreateOnDemand
// was called
static wxConfigBase *Get(bool createOnDemand = TRUE);
static wxConfigBase *Get(bool createOnDemand = True);
// create a new config object: this function will create the "best"
// implementation of wxConfig available for the current platform, see
@ -144,16 +144,16 @@ public:
// get number of entries/subgroups in the current group, with or without
// it's subgroups
virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const;
virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const;
virtual size_t GetNumberOfEntries(bool bRecursive = False) const;
virtual size_t GetNumberOfGroups(bool bRecursive = False) const;
// returns TRUE if the group by this name exists
// returns True if the group by this name exists
virtual bool HasGroup(const wxString& strName) const;
// same as above, but for an entry
virtual bool HasEntry(const wxString& strName) const;
// returns TRUE if either a group or an entry with a given name exist
// returns True if either a group or an entry with a given name exist
bool Exists(const wxString& strName) const;
// get the entry type
@ -174,7 +174,7 @@ public:
self->Read(key, &rv, defaultVal);
return rv;
}
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;
@ -182,7 +182,7 @@ public:
}
// write the value (return true on success)
// write the value (return True on success)
bool Write(const wxString& key, const wxString& value);
%name(WriteInt)bool Write(const wxString& key, long value);
%name(WriteFloat)bool Write(const wxString& key, double value);
@ -190,9 +190,9 @@ public:
// permanently writes all changes
virtual bool Flush(bool bCurrentOnly = FALSE);
virtual bool Flush(bool bCurrentOnly = False);
// renaming, all functions return FALSE on failure (probably because the new
// renaming, all functions return False on failure (probably because the new
// name is already taken by an existing entry)
// rename an entry
virtual bool RenameEntry(const wxString& oldName,
@ -202,9 +202,9 @@ public:
const wxString& newName);
// deletes the specified entry and the group it belongs to if
// it was the last key in it and the second parameter is true
// it was the last key in it and the second parameter is True
virtual bool DeleteEntry(const wxString& key,
bool bDeleteGroupIfEmpty = TRUE);
bool bDeleteGroupIfEmpty = True);
// delete the group (with all subgroups)
virtual bool DeleteGroup(const wxString& key);
@ -217,10 +217,10 @@ public:
// 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)
bool IsExpandingEnvVars() const;
void SetExpandEnvVars(bool bDoIt = TRUE);
void SetExpandEnvVars(bool bDoIt = True);
// recording of default values
void SetRecordDefaults(bool bDoIt = TRUE);
void SetRecordDefaults(bool bDoIt = True);
bool IsRecordingDefaults() const;
// does expansion only if needed

View File

@ -89,12 +89,12 @@ PyObject* wxPyConstructObject(void* ptr,
// Extract a pointer to the wrapped C++ object from a Python proxy object.
// Ensures that the proxy object is of the specified (or derived) type. If
// not able to perform the conversion then a Python exception is set and the
// error should be handled properly in the caller. Returns true on success.
// error should be handled properly in the caller. Returns True on success.
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;
}

View File

@ -63,7 +63,7 @@ public:
class wxContextHelp : public wxObject {
public:
wxContextHelp(wxWindow* window = NULL, bool doNow = TRUE);
wxContextHelp(wxWindow* window = NULL, bool doNow = True);
~wxContextHelp();
bool BeginContextHelp(wxWindow* window = NULL);

View File

@ -21,7 +21,7 @@ public:
%extend {
wxCursor(const wxString* cursorName, long flags, int hotSpotX=0, int hotSpotY=0) {
#ifdef __WXGTK__
wxCHECK_MSG(FALSE, NULL,
wxCHECK_MSG(False, NULL,
wxT("wxCursor constructor not implemented for wxGTK, use wxStockCursor, wxCursorFromImage, or wxCursorFromBits instead."));
#else
return new wxCursor(*cursorName, flags, hotSpotX, hotSpotY);

View File

@ -112,7 +112,7 @@ public:
// get the number of formats we support
virtual size_t GetFormatCount(Direction dir = Get) const;
// returns TRUE if this format is supported
// returns True if this format is supported
bool IsSupported(const wxDataFormat& format, Direction dir = Get) const;
// get the (total) size of data for the given format
@ -128,11 +128,11 @@ public:
Direction dir = Get) const;
// copy raw data (in the specified format) to the provided buffer, return
// TRUE if data copied successfully, FALSE otherwise
// True if data copied successfully, False otherwise
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const;
// get data from the buffer of specified length (in the given format),
// return TRUE if the data was read successfully, FALSE otherwise
// return True if the data was read successfully, False otherwise
virtual bool SetData(const wxDataFormat& format,
size_t len, const void * buf);
};
@ -143,7 +143,7 @@ public:
// wxDataObjectSimple is a wxDataObject which only supports one format (in
// both Get and Set directions, but you may return FALSE from GetDataHere() or
// both Get and Set directions, but you may return False from GetDataHere() or
// SetData() if one of them is not supported). This is the simplest possible
// wxDataObject implementation.
//
@ -186,7 +186,7 @@ bool wxPyDataObjectSimple::GetDataHere(void *buf) const {
// return either a string or None and then act appropriately with the
// C++ version.
bool rval = FALSE;
bool rval = False;
wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "GetDataHere")) {
PyObject* ro;
@ -205,7 +205,7 @@ bool wxPyDataObjectSimple::GetDataHere(void *buf) const {
bool wxPyDataObjectSimple::SetData(size_t len, const void *buf) const{
// For this one we simply need to make a string from buf and len
// and send it to the Python method.
bool rval = FALSE;
bool rval = False;
wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "SetData")) {
PyObject* data = PyString_FromStringAndSize((char*)buf, len);
@ -241,7 +241,7 @@ public:
wxDataObjectComposite();
%addtofunc Add "args[1].thisown = 0"
void Add(wxDataObjectSimple *dataObject, int preferred = FALSE);
void Add(wxDataObjectSimple *dataObject, int preferred = False);
};
//---------------------------------------------------------------------------
@ -330,7 +330,7 @@ wxBitmap wxPyBitmapDataObject::GetBitmap() const {
void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) {
wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "SetBitmap")) {
PyObject* bo = wxPyConstructObject((void*)&bitmap, wxT("wxBitmap"), false);
PyObject* bo = wxPyConstructObject((void*)&bitmap, wxT("wxBitmap"), False);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", bo));
Py_DECREF(bo);
}
@ -393,7 +393,7 @@ public:
else {
// raise a TypeError if not a string
PyErr_SetString(PyExc_TypeError, "String expected.");
return FALSE;
return False;
}
}
}

View File

@ -257,7 +257,7 @@ public:
// or use the default country with any other
// Western European countries: we assume that they all follow the same
// DST rules (true or false?)
// DST rules (True or False?)
Country_WesternEurope_Start,
Country_EEC = Country_WesternEurope_Start,
France,
@ -318,7 +318,7 @@ public:
// get the current country
static Country GetCountry();
// return TRUE if the country is a West European one (in practice,
// return True if the country is a West European one (in practice,
// this means that the same DST rules as for EEC apply)
static bool IsWestEuropeanCountry(Country country = Country_Default);
@ -334,7 +334,7 @@ public:
// return the current month
static Month GetCurrentMonth(Calendar cal = Gregorian);
// returns TRUE if the given year is a leap year in the given calendar
// returns True if the given year is a leap year in the given calendar
static bool IsLeapYear(int year = Inv_Year, Calendar cal = Gregorian);
// get the century (19 for 1999, 20 for 2000 and -5 for 492 BC)
@ -365,7 +365,7 @@ public:
// get the AM and PM strings in the current locale (may be empty)
static void GetAmPmStrings(wxString *OUTPUT, wxString *OUTPUT);
// return TRUE if the given country uses DST for this year
// return True if the given country uses DST for this year
static bool IsDSTApplicable(int year = Inv_Year,
Country country = Country_Default);
@ -478,7 +478,7 @@ public:
wxDateTime GetPrevWeekDay(WeekDay weekday);
// set to Nth occurence of given weekday in the given month of the
// given year (time is set to 0), return TRUE on success and FALSE on
// given year (time is set to 0), return True on success and False on
// failure. n may be positive (1..5) or negative to count from the end
// of the month (see helper function SetToLastWeekDay())
bool SetToWeekDay(WeekDay weekday,
@ -499,7 +499,7 @@ public:
int year = Inv_Year);
// sets the date to the given day of the given week in the year,
// returns TRUE on success and FALSE if given date doesn't exist (e.g.
// returns True on success and False if given date doesn't exist (e.g.
// numWeek is > 53)
bool SetToTheWeek(wxDateTime_t numWeek, WeekDay weekday = Mon, WeekFlags flags = Monday_First);
wxDateTime GetWeek(wxDateTime_t numWeek, WeekDay weekday = Mon, WeekFlags flags = Monday_First);
@ -556,12 +556,12 @@ public:
// timezone stuff
// transform to any given timezone
wxDateTime ToTimezone(const wxDateTime::TimeZone& tz, bool noDST = FALSE);
wxDateTime& MakeTimezone(const wxDateTime::TimeZone& tz, bool noDST = FALSE);
wxDateTime ToTimezone(const wxDateTime::TimeZone& tz, bool noDST = False);
wxDateTime& MakeTimezone(const wxDateTime::TimeZone& tz, bool noDST = False);
// transform to GMT/UTC
wxDateTime ToGMT(bool noDST = FALSE);
wxDateTime& MakeGMT(bool noDST = FALSE);
wxDateTime ToGMT(bool noDST = False);
wxDateTime& MakeGMT(bool noDST = False);
// is daylight savings time in effect at this moment according to the
// rules of the specified country?
@ -575,7 +575,7 @@ public:
// ------------------------------------------------------------------------
// accessors
// is the date valid (TRUE even for non initialized objects)?
// is the date valid (True even for non initialized objects)?
inline bool IsValid() const;
// get the number of seconds since the Unix epoch - returns (time_t)-1
@ -634,20 +634,20 @@ public:
// ------------------------------------------------------------------------
// comparison (see also functions below for operator versions)
// returns TRUE if the two moments are strictly identical
// returns True if the two moments are strictly identical
inline bool IsEqualTo(const wxDateTime& datetime) const;
// returns TRUE if the date is strictly earlier than the given one
// returns True if the date is strictly earlier than the given one
inline bool IsEarlierThan(const wxDateTime& datetime) const;
// returns TRUE if the date is strictly later than the given one
// returns True if the date is strictly later than the given one
inline bool IsLaterThan(const wxDateTime& datetime) const;
// returns TRUE if the date is strictly in the given range
// returns True if the date is strictly in the given range
inline bool IsStrictlyBetween(const wxDateTime& t1,
const wxDateTime& t2) const;
// returns TRUE if the date is in the given range
// returns True if the date is in the given range
inline bool IsBetween(const wxDateTime& t1, const wxDateTime& t2) const;
// do these two objects refer to the same date?
@ -908,12 +908,12 @@ public:
inline bool IsEqualTo(const wxTimeSpan& ts) const;
// compare two timestamps: works with the absolute values, i.e. -2
// hours is longer than 1 hour. Also, it will return FALSE if the
// hours is longer than 1 hour. Also, it will return False if the
// timespans are equal in absolute value.
inline bool IsLongerThan(const wxTimeSpan& ts) const;
// compare two timestamps: works with the absolute values, i.e. 1
// hour is shorter than -2 hours. Also, it will return FALSE if the
// hour is shorter than -2 hours. Also, it will return False if the
// timespans are equal in absolute value.
bool IsShorterThan(const wxTimeSpan& t) const;

View File

@ -75,12 +75,12 @@ public:
void DrawCircle(wxCoord x, wxCoord y, wxCoord radius);
void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = FALSE);
void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = False);
void DrawText(const wxString& text, wxCoord x, wxCoord y);
void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
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);
@ -140,8 +140,8 @@ public:
%name(DrawIconXY) void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
void DrawIcon(const wxIcon& icon, const wxPoint& pt);
%name(DrawBitmapXY) void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = FALSE);
void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, bool useMask = FALSE);
%name(DrawBitmapXY) void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = False);
void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, bool useMask = False);
%name(DrawTextXY) void DrawText(const wxString& text, wxCoord x, wxCoord y);
void DrawText(const wxString& text, const wxPoint& pt);
@ -152,11 +152,11 @@ public:
%name(BlitXY) 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);
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);
#endif
@ -585,7 +585,7 @@ class wxMirrorDC : public wxDC
public:
// constructs a mirror DC associated with the given real DC
//
// if mirror parameter is true, all vertical and horizontal coordinates are
// if mirror parameter is True, all vertical and horizontal coordinates are
// exchanged, otherwise this class behaves in exactly the same way as a
// plain DC
//
@ -603,7 +603,7 @@ class wxPostScriptDC : public wxDC {
public:
wxPostScriptDC(const wxPrintData& printData);
// %name(PostScriptDC2)wxPostScriptDC(const wxString& output,
// bool interactive = TRUE,
// bool interactive = True,
// wxWindow* parent = NULL);
wxPrintData& GetPrintData();
@ -697,7 +697,7 @@ public:
// %name(PrinterDC2) wxPrinterDC(const wxString& driver,
// const wxString& device,
// const wxString& output,
// bool interactive = TRUE,
// bool interactive = True,
// int orientation = wxPORTRAIT);
};
@ -719,7 +719,7 @@ public:
// %name(PrinterDC2) wxPrinterDC(const wxString& driver,
// const wxString& device,
// const wxString& output,
// bool interactive = TRUE,
// bool interactive = True,
// int orientation = wxPORTRAIT);
};
#endif

View File

@ -11,19 +11,31 @@
/////////////////////////////////////////////////////////////////////////////
// Globally turn on the autodoc feature
%feature("autodoc", "1"); // 0 == no param types, 1 == show param types
//---------------------------------------------------------------------------
// some type definitions to simplify things for SWIG
typedef int wxWindowID;
typedef int wxCoord;
typedef int wxInt32;
typedef unsigned int wxUint32;
// typedef int wxWindowID;
// typedef int wxCoord;
// typedef int wxInt32;
// typedef unsigned int wxUint32;
typedef int wxEventType;
typedef unsigned int size_t;
typedef unsigned int time_t;
typedef unsigned char byte;
#define wxWindowID int
#define wxCoord int
#define wxInt32 int
#define wxUint32 unsigned int
//#define wxEventType int
//#define size_t unsigned int
//#define time_t unsigned int
//#define byte unsigned char
//----------------------------------------------------------------------
// Various SWIG macros and such
@ -38,7 +50,7 @@ typedef unsigned char byte;
#ifndef %pythoncode
#define %pythoncode %insert("python")
#endif
#endif
#define WXUNUSED(x) x
@ -59,10 +71,124 @@ typedef unsigned char byte;
%typemap(constcode) wxEventType "PyDict_SetItemString(d, \"$symname\", PyInt_FromLong($value));";
// Macros for the docstring and autodoc features of SWIG.
// Set the docsring for the given full or partial declaration
#define DocStr(decl, docstr) %feature("docstring") decl docstr
// Set the autodoc string for a full or partial declaration
#define DocA(decl, astr) %feature("autodoc") decl astr
// Set both the autodoc and docstring for a full or partial declaration
%define DocAStr(decl, astr, docstr)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr
%enddef
// Set the detailed reference docs for full or partial declaration
#define DocRef(decl, str) %feature("docref") decl str
// Set the docstring for a decl and then define the decl too. Must use the
// full declaration of the item.
%define DocDeclStr(type, decl, docstr)
%feature("docstring") decl docstr;
type decl
%enddef
// As above, but also give the decl a new %name
%define DocDeclStrName(type, decl, docstr, newname)
%feature("docstring") decl docstr;
%name(newname) type decl
%enddef
// Set the autodoc string for a decl and then define the decl too. Must use the
// full declaration of the item.
%define DocDeclA(type, decl, astr)
%feature("autodoc") decl astr;
type decl
%enddef
// As above, but also give the decl a new %name
%define DocDeclAName(type, decl, astr, newname)
%feature("autodoc") decl astr;
%name(newname) type decl
%enddef
// Set the autodoc and the docstring for a decl and then define the decl too.
// Must use the full declaration of the item.
%define DocDeclAStr(type, decl, astr, docstr)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr;
type decl
%enddef
// As above, but also give the decl a new %name
%define DocDeclAStrName(type, decl, astr, docstr, newname)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr;
%name(newname) type decl
%enddef
// Set the docstring for a constructor decl and then define the decl too.
// Must use the full declaration of the item.
%define DocCtorStr(decl, docstr)
%feature("docstring") decl docstr;
decl
%enddef
// As above, but also give the decl a new %name
%define DocCtorStrName(decl, docstr, newname)
%feature("docstring") decl docstr;
%name(newname) decl
%enddef
// Set the autodoc string for a decl and then define the decl too. Must use the
// full declaration of the item.
%define DocCtorA(decl, astr)
%feature("autodoc") decl astr;
decl
%enddef
// As above, but also give the decl a new %name
%define DocCtorAname(decl, astr, newname)
%feature("autodoc") decl astr;
%name(newname) decl
%enddef
// Set the autodoc and the docstring for a decl and then define the decl too.
// Must use the full declaration of the item.
%define DocCtorAStr(decl, astr, docstr)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr;
decl
%enddef
// As above, but also give the decl a new %name
%define DocCtorAStrName(decl, astr, docstr, newname)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr;
%name(newname) decl
%enddef
%define %newgroup
%pythoncode {
%#---------------------------------------------------------------------------
}
}
%enddef
//---------------------------------------------------------------------------
@ -296,7 +422,7 @@ enum {
wxID_IGNORE,
wxID_HIGHEST,
wxOPEN,
wxSAVE,
wxHIDE_READONLY,

View File

@ -120,7 +120,7 @@ public:
// Find the child that matches the first part of 'path'.
// E.g. if a child path is "/usr" and 'path' is "/usr/include"
// then the child for /usr is returned.
// If the path string has been used (we're at the leaf), done is set to TRUE
// If the path string has been used (we're at the leaf), done is set to True
virtual wxTreeItemId FindChild(wxTreeItemId parentId, const wxString& path, bool& OUTPUT);
// Resize the components of the control

View File

@ -24,8 +24,8 @@
// flags for wxDropSource::DoDragDrop()
//
// NB: wxDrag_CopyOnly must be 0 (== FALSE) and wxDrag_AllowMove must be 1
// (== TRUE) for compatibility with the old DoDragDrop(bool) method!
// NB: wxDrag_CopyOnly must be 0 (== False) and wxDrag_AllowMove must be 1
// (== True) for compatibility with the old DoDragDrop(bool) method!
enum
{
wxDrag_CopyOnly = 0, // allow only copying
@ -149,7 +149,7 @@ public:
// execute or otherwise mouse movement would be too slow
DEC_PYCALLBACK_DR_2WXCDR(OnDragOver);
// called after OnDrop() returns TRUE: you will usually just call
// called after OnDrop() returns True: you will usually just call
// GetData() from here and, probably, also refresh something to update the
// new data and, finally, return the code indicating how did the operation
// complete (returning default value in case of success and wxDragError on
@ -157,7 +157,7 @@ public:
DEC_PYCALLBACK_DR_2WXCDR_pure(OnData);
// this function is called when data is dropped at position (x, y) - if it
// returns TRUE, OnData() will be called immediately afterwards which will
// returns True, OnData() will be called immediately afterwards which will
// allow to retrieve the data dropped.
DEC_PYCALLBACK_BOOL_INTINT(OnDrop);
@ -194,7 +194,7 @@ public:
bool base_OnDrop(wxCoord x, wxCoord y);
// may be called *only* from inside OnData() and will fill m_dataObject
// with the data from the drop source if it returns TRUE
// with the data from the drop source if it returns True
bool GetData();
};
@ -271,7 +271,7 @@ public:
bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y,
const wxArrayString& filenames) {
bool rval = FALSE;
bool rval = False;
wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "OnDropFiles")) {
PyObject* list = wxArrayString2PyList_helper(filenames);

View File

@ -37,9 +37,9 @@ public:
%name(DragString)wxGenericDragImage(const wxString& str,
const wxCursor& cursor = wxNullCursor);
%name(DragTreeItem)wxGenericDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id);
%name(DragTreeItem)wxGenericDragImage(const wxPyTreeCtrl& treeCtrl, wxTreeItemId& id);
%name(DragListItem)wxGenericDragImage(const wxListCtrl& listCtrl, long id);
%name(DragListItem)wxGenericDragImage(const wxPyListCtrl& listCtrl, long id);
~wxGenericDragImage();
@ -50,7 +50,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

View File

@ -382,7 +382,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.
@ -451,7 +451,7 @@ public:
// Get checkbox value
bool IsChecked() const;
// TRUE if the listbox event was a selection.
// True if the listbox event was a selection.
bool IsSelection() const;
void SetExtraLong(long extraLong);
@ -598,10 +598,16 @@ public:
// True if the mouse is just leaving the window
bool Leaving() const;
// Find the position of the event
wxPoint GetPosition();
%name(GetPositionTuple)void GetPosition(long *OUTPUT, long *OUTPUT);
DocStr(GetPosition, // sets the docstring for both
"Returns the position of the mouse in window coordinates when the event happened.");
wxPoint GetPosition();
DocDeclAName(
void, GetPosition(long *OUTPUT, long *OUTPUT),
"GetPositionTuple() -> (x,y)",
GetPositionTuple);
// Find the logical position of the event given the DC
wxPoint GetLogicalPosition(const wxDC& dc) const;
@ -707,9 +713,15 @@ public:
// get the raw key flags (platform-dependent)
wxUint32 GetRawKeyFlags() const;
// Find the position of the event
DocStr(GetPosition, // sets the docstring for both
"Find the position of the event.");
wxPoint GetPosition();
%name(GetPositionTuple) void GetPosition(long* OUTPUT, long* OUTPUT);
DocDeclAName(
void, GetPosition(long *OUTPUT, long *OUTPUT),
"GetPositionTuple() -> (x,y)",
GetPositionTuple);
// Get X position
wxCoord GetX() const;
@ -843,7 +855,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;
};
@ -888,7 +900,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;
@ -902,7 +914,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;
@ -916,7 +928,7 @@ public:
class wxIconizeEvent: public wxEvent
{
public:
wxIconizeEvent(int id = 0, bool iconized = TRUE);
wxIconizeEvent(int id = 0, bool iconized = True);
bool Iconized();
};
@ -1095,7 +1107,7 @@ class wxNavigationKeyEvent : public wxEvent
public:
wxNavigationKeyEvent();
// direction: forward (true) or backward (false)
// direction: forward (True) or backward (False)
bool GetDirection() const;
void SetDirection(bool bForward);
@ -1180,7 +1192,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

View File

@ -122,7 +122,7 @@ public:
wxFileSystem();
~wxFileSystem();
void ChangePathTo(const wxString& location, bool is_dir = FALSE);
void ChangePathTo(const wxString& location, bool is_dir = False);
wxString GetPath();
wxFSFile* OpenFile(const wxString& location);

View File

@ -261,7 +261,7 @@ struct wxNativeEncodingInfo
%}
// test for the existence of the font described by this facename/encoding,
// return TRUE if such font(s) exist, FALSE otherwise
// return True if such font(s) exist, False otherwise
bool wxTestFontEncoding(const wxNativeEncodingInfo& info);
#else
@ -271,7 +271,7 @@ bool wxTestFontEncoding(const wxNativeEncodingInfo& info);
{ PyErr_SetNone(PyExc_NotImplementedError); return NULL; }
bool wxTestFontEncoding(const wxNativeEncodingInfo& info)
{ PyErr_SetNone(PyExc_NotImplementedError); return false; }
{ PyErr_SetNone(PyExc_NotImplementedError); return False; }
%}
#endif
@ -284,11 +284,11 @@ bool wxTestFontEncoding(const wxNativeEncodingInfo& info);
// The default implementations of all functions will ask the user if they are
// not capable of finding the answer themselves and store the answer in a
// config file (configurable via SetConfigXXX functions). This behaviour may
// be disabled by giving the value of FALSE to "interactive" parameter.
// be disabled by giving the value of False to "interactive" parameter.
// However, the functions will always consult the config file to allow the
// user-defined values override the default logic and there is no way to
// disable this - which shouldn't be ever needed because if "interactive" was
// never TRUE, the config file is never created anyhow.
// never True, the config file is never created anyhow.
//
// This is a singleton class, font mapper objects can only be accessed using
// wxFontMapper::Get().
@ -309,9 +309,9 @@ public:
// wxFONTENCODING_SYSTEM if couldn't decode it
//
// interactive parameter is ignored in the base class, we behave as if it
// were always false
// were always False
virtual wxFontEncoding CharsetToEncoding(const wxString& charset,
bool interactive = true);
bool interactive = True);
// get the number of font encodings we know about
@ -347,7 +347,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);
@ -381,7 +381,7 @@ public:
class wxFont : public wxGDIObject {
public:
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();
@ -445,7 +445,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();
// the default encoding is used for creating all fonts with default
@ -487,7 +487,7 @@ public:
bool EnumerateFacenames(
wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all
bool fixedWidthOnly = FALSE);
bool fixedWidthOnly = False);
bool EnumerateEncodings(const wxString& facename = wxPyEmptyString);

View File

@ -32,7 +32,7 @@ long wxGetCurrentId();
void wxBell();
void wxEndBusyCursor();
long wxGetElapsedTime(bool resetTimer = TRUE);
long wxGetElapsedTime(bool resetTimer = True);
void wxGetMousePosition(int* OUTPUT, int* OUTPUT);
bool wxIsBusy();
wxString wxNow();
@ -118,7 +118,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);
wxString wxGetPasswordFromUser(const wxString& message,
const wxString& caption = wxPyEmptyString,
@ -131,21 +131,21 @@ 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);
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);
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);
@ -223,7 +223,7 @@ public:
#ifdef WXP_WITH_THREAD
return wxThread::IsMain();
#else
return TRUE;
return True;
#endif
}
%}

View File

@ -69,7 +69,12 @@ public:
bool operator!=(const wxGBPosition& p) const;
%extend {
PyObject* asTuple() {
void Set(int row=0, int col=0) {
self->SetRow(row);
self->SetCol(col);
}
PyObject* Get() {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->GetRow()));
@ -79,17 +84,18 @@ public:
}
}
%pythoncode {
def __str__(self): return str(self.asTuple())
def __repr__(self): return 'wxGBPosition'+str(self.asTuple())
def __len__(self): return len(self.asTuple())
def __getitem__(self, index): return self.asTuple()[index]
asTuple = Get
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.GBPosition'+str(self.Get())
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.Get()[index]
def __setitem__(self, index, val):
if index == 0: self.SetRow(val)
elif index == 1: self.SetCol(val)
else: raise IndexError
def __nonzero__(self): return self.asTuple() != (0,0)
def __nonzero__(self): return self.Get() != (0,0)
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __getstate__(self): return self.Get()
def __setstate__(self, state): self.Set(*state)
}
@ -116,7 +122,12 @@ public:
bool operator!=(const wxGBSpan& o) const;
%extend {
PyObject* asTuple() {
void Set(int rowspan=1, int colspan=1) {
self->SetRowspan(rowspan);
self->SetColspan(colspan);
}
PyObject* Get() {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->GetRowspan()));
@ -126,17 +137,18 @@ public:
}
}
%pythoncode {
def __str__(self): return str(self.asTuple())
def __repr__(self): return 'wxGBSpan'+str(self.asTuple())
def __len__(self): return len(self.asTuple())
def __getitem__(self, index): return self.asTuple()[index]
asTuple = Get
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.GBSpan'+str(self.Get())
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.Get()[index]
def __setitem__(self, index, val):
if index == 0: self.SetRowspan(val)
elif index == 1: self.SetColspan(val)
else: raise IndexError
def __nonzero__(self): return self.asTuple() != (0,0)
def __nonzero__(self): return self.Get() != (0,0)
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __getstate__(self): return self.Get()
def __setstate__(self, state): self.Set(*state)
}
@ -185,30 +197,30 @@ public:
// Get the grid position of the item
wxGBPosition GetPos() const;
%pythoncode { def GetPosTuple(self): return self.GetPos().asTuple() }
%pythoncode { def GetPosTuple(self): return self.GetPos().Get() }
// Get the row and column spanning of the item
wxGBSpan GetSpan() const;
%pythoncode { def GetSpanTuple(self): return self.GetSpan().asTuple() }
%pythoncode { def GetSpanTuple(self): return self.GetSpan().Get() }
// If the item is already a member of a sizer then first ensure that there
// is no other item that would intersect with this one at the new
// position, then set the new position. Returns true if the change is
// position, then set the new position. Returns True if the change is
// successful and after the next Layout the item will be moved.
bool SetPos( const wxGBPosition& pos );
// If the item is already a member of a sizer then first ensure that there
// is no other item that would intersect with this one with its new
// spanning size, then set the new spanning. Returns true if the change
// spanning size, then set the new spanning. Returns True if the change
// is successful and after the next Layout the item will be resized.
bool SetSpan( const wxGBSpan& span );
%nokwargs Intersects;
// Returns true if this item and the other item instersect
// Returns True if this item and the other item instersect
bool Intersects(const wxGBSizerItem& other);
// Returns true if the given pos/span would intersect with this item.
// Returns True if the given pos/span would intersect with this item.
bool Intersects(const wxGBPosition& pos, const wxGBSpan& span);
// Get the row and column of the endpoint of this item
@ -229,8 +241,8 @@ class wxGridBagSizer : public wxFlexGridSizer
public:
wxGridBagSizer(int vgap = 0, int hgap = 0 );
// The Add method returns true if the item was successfully placed at the
// given cell position, false if something was already there.
// The Add method returns True if the item was successfully placed at the
// given cell position, False if something was already there.
%extend {
bool Add( PyObject* item,
const wxGBPosition& pos,
@ -241,7 +253,7 @@ public:
wxPyUserData* data = NULL;
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();
@ -254,7 +266,7 @@ public:
else if (info.gotSize)
return self->Add(info.size.GetWidth(), info.size.GetHeight(),
pos, span, flag, border, data);
return false;
return False;
}
}
@ -271,9 +283,9 @@ public:
wxGBPosition GetItemPosition(wxSizer *sizer);
wxGBPosition GetItemPosition(size_t index);
// Set the grid position of the specified item. Returns true on success.
// Set the grid position of the specified item. Returns True on success.
// If the move is not allowed (because an item is already there) then
// false is returned.
// False is returned.
%nokwargs SetItemPosition;
bool SetItemPosition(wxWindow *window, const wxGBPosition& pos);
bool SetItemPosition(wxSizer *sizer, const wxGBPosition& pos);
@ -285,9 +297,9 @@ public:
wxGBSpan GetItemSpan(wxSizer *sizer);
wxGBSpan GetItemSpan(size_t index);
// Set the row/col spanning of the specified item. Returns true on
// Set the row/col spanning of the specified item. Returns True on
// success. If the move is not allowed (because an item is already there)
// then false is returned.
// then False is returned.
%nokwargs SetItemSpan;
bool SetItemSpan(wxWindow *window, const wxGBSpan& span);
bool SetItemSpan(wxSizer *sizer, const wxGBSpan& span);
@ -306,6 +318,13 @@ public:
wxGBSizerItem* FindItemAtPosition(const wxGBPosition& pos);
// Return the sizer item located at the point given in pt, or NULL if
// there is no item at that point. The (x,y) coordinates in pt correspond
// to the client coordinates of the window using the sizer for
// layout. (non-recursive)
wxGBSizerItem* FindItemAtPoint(const wxPoint& pt);
// Return the sizer item that has a matching user data (it only compares
// pointer values) or NULL if not found. (non-recursive)
wxGBSizerItem* FindItemWithData(const wxObject* userData);
@ -317,7 +336,7 @@ public:
// Look at all items and see if any intersect (or would overlap) the given
// item. Returns true if so, false if there would be no overlap. If an
// item. Returns True if so, False if there would be no overlap. If an
// excludeItem is given then it will not be checked for intersection, for
// example it may be the item we are checking the position of.
%nokwargs CheckForIntersection;

View File

@ -109,37 +109,67 @@ enum wxStockCursor
//---------------------------------------------------------------------------
%newgroup
DocStr( wxSize,
"wx.Size is a useful data structure used to represent the size of something.
It simply contians integer width and height proprtites. In most places in
wxPython where a wx.Size is expected a (width,height) tuple can be used
instead.");
class wxSize
{
public:
//int x; // TODO: Can these be removed and just use width and height?
//int y;
%name(width) int x;
%name(height)int y;
wxSize(int w=0, int h=0);
DocCtorStr(
wxSize(int w=0, int h=0),
"Creates a size object.");
~wxSize();
bool operator==(const wxSize& sz) const;
bool operator!=(const wxSize& sz) const;
DocDeclStr(
bool, operator==(const wxSize& sz),
"Test for equality of wx.Size objects.");
wxSize operator+(const wxSize& sz);
wxSize operator-(const wxSize& sz);
DocDeclStr(
bool, operator!=(const wxSize& sz),
"Test for inequality.");
void IncTo(const wxSize& sz);
void DecTo(const wxSize& sz);
DocDeclStr(
wxSize, operator+(const wxSize& sz),
"Add sz's proprties to this and return the result.");
void Set(int xx, int yy);
DocDeclStr(
wxSize, operator-(const wxSize& sz),
"Subtract sz's properties from this and return the result.");
DocDeclStr(
void, IncTo(const wxSize& sz),
"Increments this object so that both of its dimensions are not less\n"
"than the corresponding dimensions of the size.");
DocDeclStr(
void, DecTo(const wxSize& sz),
"Decrements this object so that both of its dimensions are not greater\n"
"than the corresponding dimensions of the size.");
DocDeclStr(
void, Set(int w, int h),
"Set both width and height.");
void SetWidth(int w);
void SetHeight(int h);
int GetWidth() const;
int GetHeight() const;
int GetX() const;
int GetY() const;
//int GetX() const;
//int GetY() const;
%extend {
PyObject* asTuple() {
DocAStr(Get,
"Get() -> (width,height)",
"Returns the width and height properties as a tuple.");
PyObject* Get() {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
@ -149,17 +179,18 @@ public:
}
}
%pythoncode {
def __str__(self): return str(self.asTuple())
def __repr__(self): return 'wxSize'+str(self.asTuple())
def __len__(self): return len(self.asTuple())
def __getitem__(self, index): return self.asTuple()[index]
asTuple = Get
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.Size'+str(self.Get())
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.Get()[index]
def __setitem__(self, index, val):
if index == 0: self.width = val
elif index == 1: self.height = val
else: raise IndexError
def __nonzero__(self): return self.asTuple() != (0,0)
def __nonzero__(self): return self.Get() != (0,0)
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __getstate__(self): return self.Get()
def __setstate__(self, state): self.Set(*state)
}
@ -168,28 +199,51 @@ public:
//---------------------------------------------------------------------------
%newgroup
DocStr( wxRealPoint,
"A data structure for representing a point or position with floating point x
and y properties. In wxPython most places that expect a wx.RealPoint can also
accept a (x,y) tuple.");
class wxRealPoint
{
public:
double x;
double y;
wxRealPoint(double x=0.0, double y=0.0);
DocCtorStr(
wxRealPoint(double x=0.0, double y=0.0),
"Create a wx.RealPoint object");
~wxRealPoint();
wxRealPoint operator+(const wxRealPoint& pt) const;
wxRealPoint operator-(const wxRealPoint& pt) const;
DocDeclStr(
bool, operator==(const wxRealPoint& pt),
"Test for equality of wx.RealPoint objects.");
DocDeclStr(
bool, operator!=(const wxRealPoint& pt),
"Test for inequality of wx.RealPoint objects.");
DocDeclStr(
wxRealPoint, operator+(const wxRealPoint& pt),
"Add pt's proprties to this and return the result.");
DocDeclStr(
wxRealPoint, operator-(const wxRealPoint& pt),
"Subtract pt's proprties from this and return the result");
bool operator==(const wxRealPoint& pt) const;
bool operator!=(const wxRealPoint& pt) const;
%extend {
DocStr(Set, "Set both the x and y properties");
void Set(double x, double y) {
self->x = x;
self->y = y;
}
PyObject* asTuple() {
DocAStr(Get,
"Get() -> (x,y)",
"Return the x and y properties as a tuple. ");
PyObject* Get() {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x));
@ -200,48 +254,82 @@ public:
}
%pythoncode {
def __str__(self): return str(self.asTuple())
def __repr__(self): return 'wxRealPoint'+str(self.asTuple())
def __len__(self): return len(self.asTuple())
def __getitem__(self, index): return self.asTuple()[index]
asTuple = Get
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.RealPoint'+str(self.Get())
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.Get()[index]
def __setitem__(self, index, val):
if index == 0: self.width = val
elif index == 1: self.height = val
if index == 0: self.x = val
elif index == 1: self.y = val
else: raise IndexError
def __nonzero__(self): return self.asTuple() != (0.0, 0.0)
def __nonzero__(self): return self.Get() != (0.0, 0.0)
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __getstate__(self): return self.Get()
def __setstate__(self, state): self.Set(*state)
}
};
//---------------------------------------------------------------------------
%newgroup
DocStr(wxPoint,
"A data structure for representing a point or position with integer x and y
properties. Most places in wxPython that expect a wx.Point can also accept a
(x,y) tuple.");
class wxPoint
{
public:
int x, y;
wxPoint(int x=0, int y=0);
DocCtorStr(
wxPoint(int x=0, int y=0),
"Create a wx.Point object");
~wxPoint();
bool operator==(const wxPoint& p) const;
bool operator!=(const wxPoint& p) const;
DocDeclStr(
bool, operator==(const wxPoint& pt),
"Test for equality of wx.Point objects.");
wxPoint operator+(const wxPoint& p) const;
wxPoint operator-(const wxPoint& p) const;
DocDeclStr(
bool, operator!=(const wxPoint& pt),
"Test for inequality of wx.Point objects.");
wxPoint& operator+=(const wxPoint& p);
wxPoint& operator-=(const wxPoint& p);
DocDeclStr(
wxPoint, operator+(const wxPoint& pt),
"Add pt's proprties to this and return the result.");
DocDeclStr(
wxPoint, operator-(const wxPoint& pt),
"Subtract pt's proprties from this and return the result");
DocDeclStr(
wxPoint&, operator+=(const wxPoint& pt),
"Add pt to this object.");
DocDeclStr(
wxPoint&, operator-=(const wxPoint& pt),
"Subtract pt from this object.");
%extend {
DocStr(Set, "Set both the x and y properties");
void Set(long x, long y) {
self->x = x;
self->y = y;
}
PyObject* asTuple() {
DocAStr(Get,
"Get() -> (x,y)",
"Return the x and y properties as a tuple. ");
PyObject* Get() {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
@ -252,17 +340,18 @@ public:
}
%pythoncode {
def __str__(self): return str(self.asTuple())
def __repr__(self): return 'wxPoint'+str(self.asTuple())
def __len__(self): return len(self.asTuple())
def __getitem__(self, index): return self.asTuple()[index]
asTuple = Get
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.Point'+str(self.Get())
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.Get()[index]
def __setitem__(self, index, val):
if index == 0: self.x = val
elif index == 1: self.y = val
else: raise IndexError
def __nonzero__(self): return self.asTuple() != (0,0)
def __nonzero__(self): return self.Get() != (0,0)
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __getstate__(self): return self.Get()
def __setstate__(self, state): self.Set(*state)
}
};
@ -271,12 +360,28 @@ public:
%newgroup
DocStr(wxRect,
"A class for representing and manipulating rectangles. It has x, y, width and
height properties. In wxPython most palces that expect a wx.Rect can also
accept a (x,y,width,height) tuple.");
class wxRect
{
public:
wxRect(int x=0, int y=0, int width=0, int height=0);
%name(RectPP) wxRect(const wxPoint& topLeft, const wxPoint& bottomRight);
%name(RectPS) wxRect(const wxPoint& pos, const wxSize& size);
DocCtorStr(
wxRect(int x=0, int y=0, int width=0, int height=0),
"Create a new Rect object.");
DocCtorStrName(
wxRect(const wxPoint& topLeft, const wxPoint& bottomRight),
"Create a new Rect object from Points representing two corners.",
RectPP);
DocCtorStrName(
wxRect(const wxPoint& pos, const wxSize& size),
"Create a new Rect from a position and size.",
RectPS);
~wxRect();
int GetX() const;
@ -307,39 +412,83 @@ public:
void SetTop(int top);
void SetBottom(int bottom);
wxRect& Inflate(wxCoord dx, wxCoord dy);
wxRect& Deflate(wxCoord dx, wxCoord dy);
%pythoncode {
position = property(GetPosition, SetPosition)
size = property(GetSize, SetSize)
left = property(GetLeft, SetLeft)
right = property(GetRight, SetRight)
top = property(GetTop, SetTop)
bottom = property(GetBottom, SetBottom)
}
%name(OffsetXY)void Offset(wxCoord dx, wxCoord dy);
void Offset(const wxPoint& pt);
DocDeclStr(
wxRect&, Inflate(wxCoord dx, wxCoord dy),
"Increase the rectangle size by dx in x direction and dy in y direction. Both\n"
"(or one of) parameters may be negative to decrease the rectangle size.");
wxRect& Intersect(const wxRect& rect);
DocDeclStr(
wxRect&, Deflate(wxCoord dx, wxCoord dy),
"Decrease the rectangle size by dx in x direction and dy in y direction. Both\n"
"(or one of) parameters may be negative to increase the rectngle size. This\n"
"method is the opposite of Inflate.");
wxRect operator+(const wxRect& rect) const;
wxRect& operator+=(const wxRect& rect);
DocDeclStrName(
void, Offset(wxCoord dx, wxCoord dy),
"Moves the rectangle by the specified offset. If dx is positive, the rectangle\n"
"is moved to the right, if dy is positive, it is moved to the bottom, otherwise\n"
"it is moved to the left or top respectively.",
OffsetXY);
DocDeclStr(
void, Offset(const wxPoint& pt),
"Same as OffsetXY but uses dx,dy from Point");
bool operator==(const wxRect& rect) const;
bool operator!=(const wxRect& rect) const { return !(*this == rect); }
DocDeclStr(
wxRect&, Intersect(const wxRect& rect),
"Return the intersectsion of this rectangle and rect.");
// return TRUE if the point is (not strcitly) inside the rect
DocDeclStr(
wxRect, operator+(const wxRect& rect) const,
"Add the properties of rect to this rectangle and return the result.");
DocDeclStr(
wxRect&, operator+=(const wxRect& rect),
"Add the properties of rect to this rectangle, updating this rectangle.");
DocDeclStr(
bool, operator==(const wxRect& rect) const,
"Test for equality.");
DocDeclStr(
bool, operator!=(const wxRect& rect) const,
"Test for inequality.");
DocStr( Inside, "Return True if the point is (not strcitly) inside the rect.");
%name(InsideXY)bool Inside(int x, int y) const;
bool Inside(const wxPoint& pt) const;
// return TRUE if the rectangles have a non empty intersection
bool Intersects(const wxRect& rect) const;
DocDeclStr(
bool, Intersects(const wxRect& rect) const,
"Returns True if the rectangles have a non empty intersection.");
int x, y, width, height;
%extend {
void Set(int x=0, int y=0, int width=0, int height=0) {
DocStr(Set, "Set all rectangle properties.");
void Set(int x=0, int y=0, int width=0, int height=0) {
self->x = x;
self->y = y;
self->width = width;
self->height = height;
}
PyObject* asTuple() {
DocAStr(Get,
"Get() -> (x,y,width,height)",
"Return the rectangle properties as a tuple.");
PyObject* Get() {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(4);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
@ -352,24 +501,28 @@ public:
}
%pythoncode {
def __str__(self): return str(self.asTuple())
def __repr__(self): return 'wxRect'+str(self.asTuple())
def __len__(self): return len(self.asTuple())
def __getitem__(self, index): return self.asTuple()[index]
asTuple = Get
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.Rect'+str(self.Get())
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.Get()[index]
def __setitem__(self, index, val):
if index == 0: self.x = val
elif index == 1: self.y = val
elif index == 2: self.width = val
elif index == 3: self.height = val
else: raise IndexError
def __nonzero__(self): return self.asTuple() != (0,0,0,0)
def __nonzero__(self): return self.Get() != (0,0,0,0)
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __getstate__(self): return self.Get()
def __setstate__(self, state): self.Set(*state)
}
};
DocAStr(wxIntersectRect,
"IntersectRect(Rect r1, Rect r2) -> Rect",
"Calculate and return the intersection of r1 and r2.");
%inline %{
PyObject* wxIntersectRect(wxRect* r1, wxRect* r2) {
wxRegion reg1(*r1);
@ -383,7 +536,7 @@ public:
if (dest != wxRect(0,0,0,0)) {
wxPyBeginBlockThreads();
wxRect* newRect = new wxRect(dest);
obj = wxPyConstructObject((void*)newRect, wxT("wxRect"), true);
obj = wxPyConstructObject((void*)newRect, wxT("wxRect"), True);
wxPyEndBlockThreads();
return obj;
}
@ -396,23 +549,32 @@ public:
%newgroup
// wxPoint2Ds represent a point or a vector in a 2d coordinate system
DocStr(wxPoint2D,
"wx.Point2Ds represent a point or a vector in a 2d coordinate system with floating point values.");
class wxPoint2D
{
public :
public:
DocStr(wxPoint2D, "Create a w.Point2D object.");
wxPoint2D( double x=0.0 , double y=0.0 );
%name(Point2DCopy) wxPoint2D( const wxPoint2D &pt );
%name(Point2DFromPoint) wxPoint2D( const wxPoint &pt );
// two different conversions to integers, floor and rounding
void GetFloor( int *OUTPUT , int *OUTPUT ) const;
void GetRounded( int *OUTPUT , int *OUTPUT ) const;
DocDeclAStr(
void, GetFloor( int *OUTPUT , int *OUTPUT ) const,
"GetFloor() -> (x,y)",
"Convert to integer");
DocDeclAStr(
void, GetRounded( int *OUTPUT , int *OUTPUT ) const,
"GetRounded() -> (x,y)",
"Convert to integer");
double GetVectorLength() const;
double GetVectorAngle() const ;
void SetVectorLength( double length );
void SetVectorAngle( double degrees );
// LinkError: void SetPolarCoordinates( double angle , double length );
// LinkError: void Normalize();
%pythoncode {
@ -428,8 +590,9 @@ public :
double GetDotProduct( const wxPoint2D &vec ) const;
double GetCrossProduct( const wxPoint2D &vec ) const;
// the reflection of this point
wxPoint2D operator-();
DocDeclStr(
wxPoint2D, operator-(),
"the reflection of this point");
wxPoint2D& operator+=(const wxPoint2D& pt);
wxPoint2D& operator-=(const wxPoint2D& pt);
@ -437,11 +600,14 @@ public :
wxPoint2D& operator*=(const wxPoint2D& pt);
wxPoint2D& operator/=(const wxPoint2D& pt);
bool operator==(const wxPoint2D& pt) const;
bool operator!=(const wxPoint2D& pt) const;
DocDeclStr(
bool, operator==(const wxPoint2D& pt) const,
"Test for equality");
DocDeclStr(
bool, operator!=(const wxPoint2D& pt) const,
"Test for inequality");
double m_x;
double m_y;
%name(x)double m_x;
%name(y)double m_y;
@ -450,7 +616,11 @@ public :
self->m_x = x;
self->m_y = y;
}
PyObject* asTuple() {
DocAStr(Get,
"Get() -> (x,y)",
"Return x and y properties as a tuple.");
PyObject* Get() {
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->m_x));
@ -461,17 +631,18 @@ public :
}
%pythoncode {
def __str__(self): return str(self.asTuple())
def __repr__(self): return 'wxPoint2D'+str(self.asTuple())
def __len__(self): return len(self.asTuple())
def __getitem__(self, index): return self.asTuple()[index]
asTuple = Get
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.Point2D'+str(self.Get())
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.Get()[index]
def __setitem__(self, index, val):
if index == 0: self.m_x = val
elif index == 1: self.m_yt = val
if index == 0: self.x = val
elif index == 1: self.y = val
else: raise IndexError
def __nonzero__(self): return self.asTuple() != (0.0, 0.0)
def __nonzero__(self): return self.Get() != (0.0, 0.0)
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __getstate__(self): return self.Get()
def __setstate__(self, state): self.Set(*state)
}

View File

@ -93,7 +93,7 @@ public:
~wxIconLocation();
// returns true if this object is valid/initialized
// returns True if this object is valid/initialized
bool IsOk() const;
%pythoncode { def __nonzero__(self): return self.Ok() }

View File

@ -52,22 +52,22 @@ class wxImageHistogram /* : public wxImageHistogramBase */
public:
wxImageHistogram();
// get the key in the histogram for the given RGB values
DocStr(MakeKey, "Get the key in the histogram for the given RGB values");
static unsigned long MakeKey(unsigned char r,
unsigned char g,
unsigned char b);
// find first colour that is not used in the image and has higher
// RGB values than RGB(startR, startG, startB)
//
// returns true and puts this colour in r, g, b (each of which may be NULL)
// on success or returns false if there are no more free colours
bool FindFirstUnusedColour(unsigned char *OUTPUT,
unsigned char *OUTPUT,
unsigned char *OUTPUT,
unsigned char startR = 1,
unsigned char startG = 0,
unsigned char startB = 0 ) const;
DocDeclAStr(
bool, FindFirstUnusedColour(unsigned char *OUTPUT,
unsigned char *OUTPUT,
unsigned char *OUTPUT,
unsigned char startR = 1,
unsigned char startG = 0,
unsigned char startB = 0 ) const,
"FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)",
"Find first colour that is not used in the image and has higher RGB values than\n"
"startR, startG, startB. Returns a tuple consisting of a success flag and rgb\n"
"values.");
};
@ -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
@ -103,7 +103,7 @@ public:
return NULL;
}
memcpy(copy, data, width*height*3);
return new wxImage(width, height, copy, FALSE);
return new wxImage(width, height, copy, False);
}
}
@ -125,8 +125,14 @@ public:
// find first colour that is not used in the image and has higher
// RGB values than <startR,startG,startB>
bool FindFirstUnusedColour( byte *OUTPUT, byte *OUTPUT, byte *OUTPUT,
byte startR = 0, byte startG = 0, byte startB = 0 ) const;
DocDeclAStr(
bool, FindFirstUnusedColour( byte *OUTPUT, byte *OUTPUT, byte *OUTPUT,
byte startR = 0, byte startG = 0, byte startB = 0 ) const,
"FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)",
"Find first colour that is not used in the image and has higher RGB values than\n"
"startR, startG, startB. Returns a tuple consisting of a success flag and rgb\n"
"values.");
// Set image's mask to the area of 'mask' that has <mr,mg,mb> colour
bool SetMaskFromImage(const wxImage & mask,
@ -270,13 +276,13 @@ public:
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 );

View File

@ -41,7 +41,7 @@ enum {
// 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);
@ -56,7 +56,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);

View File

@ -317,8 +317,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);
@ -350,7 +350,7 @@ public:
// is used, the US default value is returned if everything else fails
// static wxString GetInfo(wxLocaleInfo index, wxLocaleCategory cat);
// return TRUE if the locale was set successfully
// return True if the locale was set successfully
bool IsOk() const;
%pythoncode { def __nonzero__(self): return self.IsOk() };
@ -381,7 +381,7 @@ public:
//
// The loaded catalog will be used for message lookup by GetString().
//
// Returns 'true' if it was successfully loaded
// Returns 'True' if it was successfully loaded
bool AddCatalog(const wxString& szDomain);
// check if the given catalog is loaded
@ -504,7 +504,7 @@ public:
// both modes gurantee that output string will have same length
// as input string
//
// Returns FALSE if given conversion is impossible, TRUE otherwise
// Returns False if given conversion is impossible, True otherwise
// (conversion may be impossible either if you try to convert
// to Unicode with non-Unicode build of wxWindows or if input
// or output encoding is not supported.)
@ -564,7 +564,7 @@ public:
// equivalent encodings, regardless the platform, including itself.
static wxFontEncodingArray GetAllEquivalents(wxFontEncoding enc);
// Return true if [any text in] one multibyte encoding can be
// Return True if [any text in] one multibyte encoding can be
// converted to another one losslessly.
//
// Do not call this with wxFONTENCODING_UNICODE, it doesn't make

View File

@ -63,7 +63,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; }
@ -87,16 +87,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
%}

View File

@ -64,12 +64,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)
@ -99,7 +99,7 @@ public:
// listbox and ensures that it is visible i.e. not scrolled out of view
void AppendAndEnsureVisible(const wxString& s);
// return TRUE if this listbox is sorted
// return True if this listbox is sorted
bool IsSorted() const;
};
@ -133,7 +133,7 @@ public:
const wxString& name = wxPyListBoxNameStr);
bool IsChecked(int index);
void Check(int index, int check = TRUE);
void Check(int index, int check = True);
#ifndef __WXMAC__
int GetItemHeight();

View File

@ -179,6 +179,7 @@ public:
//---------------------------------------------------------------------------
%newgroup
// wxListItem: the item or column info, used to exchange data with wxListCtrl
class wxListItem : public wxObject {
public:
@ -542,7 +543,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
@ -559,7 +560,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) ;
@ -581,7 +582,7 @@ public:
%addtofunc AssignImageList "args[1].thisown = 0";
void AssignImageList(wxImageList *imageList, int which);
// returns true if it is a virtual list control
// returns True if it is a virtual list control
bool IsVirtual() const;
// refresh items selectively (only useful for virtual list controls)
@ -621,7 +622,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.
@ -677,18 +678,18 @@ public:
%# Some helpers...
def Select(self, idx, on=1):
'''[de]select an item'''
if on: state = wxLIST_STATE_SELECTED
if on: state = wx.LIST_STATE_SELECTED
else: state = 0
self.SetItemState(idx, state, wxLIST_STATE_SELECTED)
self.SetItemState(idx, state, wx.LIST_STATE_SELECTED)
def Focus(self, idx):
'''Focus and show the given item'''
self.SetItemState(idx, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED)
self.SetItemState(idx, wx.LIST_STATE_FOCUSED, wx.LIST_STATE_FOCUSED)
self.EnsureVisible(idx)
def GetFocusedItem(self):
'''get the currently focused item or -1 if none'''
return self.GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED)
return self.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_FOCUSED)
def GetFirstSelected(self, *args):
'''return first selected item, or -1 when none'''
@ -696,22 +697,22 @@ public:
def GetNextSelected(self, item):
'''return subsequent selected items, or -1 when no more'''
return self.GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED)
return self.GetNextItem(item, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
def IsSelected(self, idx):
'''return TRUE if the item is selected'''
return self.GetItemState(idx, wxLIST_STATE_SELECTED) != 0
'''return True if the item is selected'''
return self.GetItemState(idx, wx.LIST_STATE_SELECTED) != 0
def SetColumnImage(self, col, image):
item = self.GetColumn(col)
# preserve all other attributes too
item.SetMask( wxLIST_MASK_STATE |
wxLIST_MASK_TEXT |
wxLIST_MASK_IMAGE |
wxLIST_MASK_DATA |
wxLIST_SET_ITEM |
wxLIST_MASK_WIDTH |
wxLIST_MASK_FORMAT )
%# preserve all other attributes too
item.SetMask( wx.LIST_MASK_STATE |
wx.LIST_MASK_TEXT |
wx.LIST_MASK_IMAGE |
wx.LIST_MASK_DATA |
wx.LIST_SET_ITEM |
wx.LIST_MASK_WIDTH |
wx.LIST_MASK_FORMAT )
item.SetImage(image)
self.SetColumn(col, item)
@ -722,7 +723,7 @@ public:
'''Append an item to the list control. The entry parameter should be a
sequence with an item for each column'''
if len(entry):
if wx.wxUSE_UNICODE:
if wx.USE_UNICODE:
cvtfunc = unicode
else:
cvtfunc = str
@ -745,7 +746,7 @@ public:
// 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);
}
}
@ -793,7 +794,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);
@ -805,7 +806,7 @@ public:
long GetNextSelected(long item) const;
long GetFirstSelected() const;
// return TRUE if the item is selected
// return True if the item is selected
bool IsSelected(long index);
void SetColumnImage(int col, int image);

View File

@ -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;

View File

@ -210,10 +210,10 @@ public:
wxMenuBar(long style = 0);
// append a menu to the end of menubar, return TRUE if ok
// append a menu to the end of menubar, return True if ok
virtual bool Append(wxMenu *menu, const wxString& title);
// insert a menu before the given position into the menubar, return TRUE
// insert a menu before the given position into the menubar, return True
// if inserted ok
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
@ -236,7 +236,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);
@ -277,7 +277,7 @@ public:
// get the frame we are attached to (may return NULL)
wxFrame *GetFrame() const;
// returns TRUE if we're attached to a frame
// returns True if we're attached to a frame
bool IsAttached() const;
// associate the menubar with the frame
@ -331,10 +331,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();
@ -370,7 +370,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

View File

@ -193,7 +193,7 @@ public:
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();
@ -264,9 +264,9 @@ public:
// set an arbitrary command, ask confirmation if it already exists and
// overwriteprompt is TRUE
// 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);
@ -313,7 +313,7 @@ public:
// check if the given MIME type is the same as the other one: the
// second argument may contain wildcards ('*'), but not the first. If
// the types are equal or if the mimeType matches wildcard the function
// returns TRUE, otherwise it returns FALSE
// returns True, otherwise it returns False
static bool IsOfType(const wxString& mimeType, const wxString& wildcard);
// ctor
@ -342,18 +342,18 @@ public:
%newobject GetFileTypeFromMimeType;
wxFileType *GetFileTypeFromMimeType(const wxString& mimeType);
// other operations: return TRUE if there were no errors or FALSE if there
// other operations: return True if there were no errors or False if there
// were some unreckognized entries (the good entries are always read anyhow)
//
// read in additional file (the standard ones are read automatically)
// in mailcap format (see mimetype.cpp for description)
//
// 'fallback' parameter may be set to TRUE to avoid overriding the
// 'fallback' parameter may be set to True to avoid overriding the
// 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);
// fallback == True this won't happen
bool ReadMailcap(const wxString& filename, bool fallback = False);
// read in additional file in mime.types format
bool ReadMimeTypes(const wxString& filename);
@ -369,7 +369,7 @@ public:
// these functions can be used to provide default values for some of the
// MIME types inside the program itself (you may also use
// ReadMailcap(filenameWithDefaultTypes, TRUE /* use as fallback */) to
// ReadMailcap(filenameWithDefaultTypes, True /* use as fallback */) to
// achieve the same goal, but this requires having this info in a file).
//
void AddFallback(const wxFileTypeInfo& ft);

View File

@ -49,7 +49,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();
%pragma(python) addtoclass = "def __nonzero__(self): return self.IsOk()"
@ -173,7 +173,7 @@ public:
// path is optional and is ignored under Win32 and used as the directory to
// create the lock file in under Unix (default is wxGetHomeDir())
//
// returns FALSE if initialization failed, it doesn't mean that another
// returns False if initialization failed, it doesn't mean that another
// instance is running - use IsAnotherRunning() to check it
bool Create(const wxString& name, const wxString& path = wxPyEmptyString);
@ -241,12 +241,12 @@ 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 )
{
s_triedToLoad = true;
s_triedToLoad = True;
wxDynamicLibrary dllUser32(_T("user32.dll"));
if ( dllUser32.IsLoaded() )
{

View File

@ -97,14 +97,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
@ -115,7 +115,7 @@ public:
// cycle thru the pages
void AdvanceSelection(bool forward = true);
void AdvanceSelection(bool forward = True);
};
@ -299,7 +299,7 @@ public:
long style = 0,
const wxString& name = wxPyEmptyString);
// returns true if we have wxLB_TOP or wxLB_BOTTOM style
// returns True if we have wxLB_TOP or wxLB_BOTTOM style
bool IsVertical() const;
};

View File

@ -16,14 +16,22 @@
//---------------------------------------------------------------------------
%newgroup
DocStr(wxObject,
"The base class for most wx objects, although in wxPython not
much functionality is needed nor exposed.");
class wxObject {
public:
%extend {
DocStr(GetClassName,
"Returns the class name of the C++ object using wxRTTI.");
wxString GetClassName() {
return self->GetClassInfo()->GetClassName();
}
DocStr(Destroy,
"Deletes the C++ object this Python object is a proxy for.");
void Destroy() {
delete self;
}

View File

@ -18,7 +18,6 @@
%{
%}
//---------------------------------------------------------------------------
%newgroup
@ -30,7 +29,7 @@ public:
%addtofunc wxPanel() ""
wxPanel(wxWindow* parent,
const wxWindowID id,
const wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
@ -54,7 +53,7 @@ public:
// TODO: Add wrappers for the wxScrollHelper class, make wxScrolledWindow
// derive from it and wxPanel. But what to do about wxGTK where this
// is not true?
// is not True?
class wxScrolledWindow : public wxPanel
{
@ -82,7 +81,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);
@ -94,13 +93,17 @@ public:
// Set the x, y scrolling increments.
void SetScrollRate( int xstep, int ystep );
// get the size of one logical unit in physical ones
%feature("autodoc") GetScrollPixelsPerUnit
"GetScrollPixelsPerUnit() -> (xUnit, yUnit)";
%feature("docstring") GetScrollPixelsPerUnit "
get the size of one logical unit in physical ones
"
virtual void GetScrollPixelsPerUnit(int *OUTPUT,
int *OUTPUT) const;
// Enable/disable Windows scrolling in either direction. If TRUE, wxWindows
// Enable/disable Windows scrolling in either direction. If True, wxWindows
// scrolls the canvas and only a bit of the canvas is invalidated; no
// Clear() is necessary. If FALSE, the whole canvas is invalidated and a
// Clear() is necessary. If False, the whole canvas is invalidated and a
// Clear() is necessary. Disable for when the scroll increment is used to
// actually scroll a non-constant distance
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);

View File

@ -246,7 +246,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);
@ -263,7 +263,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;
wxPyBeginBlockThreads();
@ -274,22 +274,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.");
@ -507,7 +507,7 @@ public:
#define IMP_PYCALLBACK_BOOL_PREWINDC(CLASS, PCLASS, CBNAME) \
bool CLASS::CBNAME(wxPreviewCanvas* a, wxDC& b) { \
bool rval=FALSE; \
bool rval=False; \
bool found; \
wxPyBeginBlockThreads(); \
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \

View File

@ -113,10 +113,10 @@ public:
void CloseOutput();
// return TRUE if the child process stdout is not closed
// return True if the child process stdout is not closed
bool IsInputOpened() const;
// return TRUE if any input is available on the child process stdout/err
// return True if any input is available on the child process stdout/err
bool IsInputAvailable() const;
bool IsErrorAvailable() const;
};

View File

@ -66,8 +66,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

View File

@ -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);
};
//---------------------------------------------------------------------------

View File

@ -161,7 +161,7 @@ public:
// get a system-dependent metric
static int GetMetric(wxSystemMetric index);
// return true if the port has certain feature
// return True if the port has certain feature
static bool HasFeature(wxSystemFeature index);

View File

@ -96,8 +96,8 @@ public:
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;
@ -128,13 +128,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;
}
}
}
@ -175,7 +175,7 @@ public:
wxPyUserData* data = NULL;
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();
@ -196,7 +196,7 @@ public:
wxPyUserData* data = NULL;
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();
@ -218,7 +218,7 @@ public:
wxPyUserData* data = NULL;
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();
@ -236,7 +236,7 @@ public:
bool Remove(PyObject* item) {
wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true);
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True);
wxPyEndBlockThreads();
if ( info.window )
return self->Remove(info.window);
@ -245,13 +245,13 @@ public:
else if ( info.gotPos )
return self->Remove(info.pos);
else
return FALSE;
return False;
}
void _SetItemMinSize(PyObject* item, wxSize size) {
void _SetItemMinSize(PyObject* item, const wxSize& size) {
wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true);
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True);
wxPyEndBlockThreads();
if ( info.window )
self->SetItemMinSize(info.window, size);
@ -270,7 +270,7 @@ public:
%pythoncode {
def AddMany(self, widgets):
for childinfo in widgets:
if type(childinfo) != type(()):
if type(childinfo) != type(()) or (len(childinfo) == 2 and type(childinfo[0]) == type(1)):
childinfo = (childinfo, )
self.Add(*childinfo)
@ -316,7 +316,7 @@ public:
void SetSizeHints( wxWindow *window );
void SetVirtualSizeHints( wxWindow *window );
void Clear( bool delete_windows=FALSE );
void Clear( bool delete_windows=False );
void DeleteWindows();
@ -333,8 +333,8 @@ public:
// in the layout calculations or not.
%extend {
void Show(PyObject* item, bool show = TRUE) {
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, false);
void Show(PyObject* item, bool show = True) {
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False);
if ( info.window )
self->Show(info.window, show);
else if ( info.sizer )
@ -343,7 +343,7 @@ public:
void Hide(PyObject* item) {
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, false);
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False);
if ( info.window )
self->Hide(info.window);
else if ( info.sizer )
@ -352,13 +352,13 @@ public:
bool IsShown(PyObject* item) {
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, false);
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False);
if ( info.window )
return self->IsShown(info.window);
else if ( info.sizer )
return self->IsShown(info.sizer);
else
return false;
return False;
}
}
@ -483,6 +483,10 @@ public:
// flexible
void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode);
wxFlexSizerGrowMode GetNonFlexibleGrowMode();
// Read-only access to the row heights and col widths arrays
const wxArrayInt& GetRowHeights() const;
const wxArrayInt& GetColWidths() const;
};
//---------------------------------------------------------------------------

View File

@ -90,7 +90,7 @@ public:
// Associates the given window with window 2, drawing the appropriate sash
// and changing the split mode.
// Does nothing and returns FALSE if the window is already split.
// Does nothing and returns False if the window is already split.
// A sashPosition of 0 means choose a default sash position,
// negative sashPosition specifies the size of right/lower pane as it's
// absolute value rather than the size of left/upper pane.
@ -126,7 +126,7 @@ public:
int GetBorderSize() const;
// Set the sash position
void SetSashPosition(int position, bool redraw = TRUE);
void SetSashPosition(int position, bool redraw = True);
// Gets the sash position
int GetSashPosition() const;

View File

@ -69,7 +69,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);

View File

@ -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);
}

View File

@ -137,7 +137,7 @@ public:
long GetRightIndent() const;
long GetFlags() const;
// returns false if we have any attributes set, true otherwise
// returns False if we have any attributes set, True otherwise
bool IsDefault() const;
// return the attribute having the valid font and colours: it uses the
@ -221,7 +221,7 @@ public:
virtual void AppendText(const wxString& text);
// insert the character which would have resulted from this key event,
// return TRUE if anything has been inserted
// return True if anything has been inserted
virtual bool EmulateKeyPress(const wxKeyEvent& event);
// text control under some platforms supports the text styles: these
@ -268,7 +268,7 @@ public:
#ifdef __WXMSW__
// Caret handling (Windows only)
bool ShowNativeCaret(bool show = true);
bool ShowNativeCaret(bool show = True);
bool HideNativeCaret();
#endif

View File

@ -58,7 +58,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();
@ -67,13 +67,13 @@ public:
// messages in it, use non default ctor or SetOwner() otherwise
virtual void Notify();
// return TRUE if the timer is running
// return True if the timer is running
virtual bool IsRunning() const;
// get the (last) timer interval in the milliseconds
int GetInterval() const;
// return TRUE if the timer is one shot
// return True if the timer is one shot
bool IsOneShot() const;
};
@ -111,10 +111,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);
};

View File

@ -80,8 +80,8 @@ public:
// the user to disable this (however, it's the program which should show, or
// not, the dialog on startup depending on its value, not this class).
//
// The function returns TRUE if this checkbox is checked, FALSE otherwise.
bool wxShowTip(wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup = TRUE);
// The function returns True if this checkbox is checked, False otherwise.
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).

View File

@ -376,7 +376,7 @@ public:
// there is no tool at this point (corrdinates are client)
wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y);
// return TRUE if this is a vertical toolbar, otherwise FALSE
// return True if this is a vertical toolbar, otherwise False
bool IsVertical();
};

View File

@ -59,19 +59,19 @@ public:
// No constructor as it can not be used directly from Python
// maximize = TRUE => maximize, otherwise - restore
virtual void Maximize(bool maximize = TRUE);
// maximize = True => maximize, otherwise - restore
virtual void Maximize(bool maximize = True);
// undo Maximize() or Iconize()
virtual void Restore();
// iconize = TRUE => iconize, otherwise - restore
virtual void Iconize(bool iconize = TRUE);
// iconize = True => iconize, otherwise - restore
virtual void Iconize(bool iconize = True);
// return TRUE if the frame is maximized
// return True if the frame is maximized
virtual bool IsMaximized() const;
// return TRUE if the frame is iconized
// return True if the frame is iconized
virtual bool IsIconized() const;
// get the frame icon
@ -86,14 +86,14 @@ public:
// maximize the window to cover entire screen
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
// return TRUE if the frame is in fullscreen mode
// return True if the frame is in fullscreen mode
virtual bool IsFullScreen() const;
virtual void SetTitle(const wxString& title);
virtual wxString GetTitle() const;
// Set the shape of the window to the given region.
// Returns TRUE if the platform supports this feature (and the operation
// Returns True if the platform supports this feature (and the operation
// is successful.)
virtual bool SetShape(const wxRegion& region);
@ -149,7 +149,7 @@ public:
virtual wxMenuBar *GetMenuBar() const;
// process menu command: returns TRUE if processed
// process menu command: returns True if processed
bool ProcessCommand(int winid);
%pythoncode { Command = ProcessCommand }
@ -204,8 +204,8 @@ public:
virtual void SetToolBar(wxToolBar *toolbar);
// show help text (typically in the statusbar); show is FALSE
// if you are hiding the help, TRUE otherwise
// show help text (typically in the statusbar); show is False
// if you are hiding the help, True otherwise
virtual void DoGiveHelp(const wxString& text, bool show);
@ -263,7 +263,7 @@ public:
// may be called to terminate the dialog with the given return code
virtual void EndModal(int retCode);
// returns TRUE if we're in a modal loop
// returns True if we're in a modal loop
%extend {
bool IsModalShowing() {
#ifdef __WXGTK__

View File

@ -99,12 +99,12 @@ public:
%extend {
bool operator==(const wxTreeItemId* other) {
if (!other) return false;
if (!other) return False;
return *self == *other;
}
bool operator!=(const wxTreeItemId* other) {
if (!other) return true;
if (!other) return True;
return *self != *other;
}
}
@ -295,8 +295,8 @@ public:
bool found;
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);
@ -451,14 +451,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
@ -487,19 +487,19 @@ public:
bool IsBold(const wxTreeItemId& item) const;
// if 'recursively' is FALSE, only immediate children count, otherwise
// 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*/;
// get the root tree item
// wxTreeItemId.IsOk() will return FALSE if there is no such item
// wxTreeItemId.IsOk() will return False if there is no such item
wxTreeItemId GetRootItem() const;
// get the item currently selected
// wxTreeItemId.IsOk() will return FALSE if there is no such item
// wxTreeItemId.IsOk() will return False if there is no such item
wxTreeItemId GetSelection() const;
%extend {
@ -515,7 +515,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();
@ -524,7 +524,7 @@ public:
}
// get the parent of this item
// wxTreeItemId.IsOk() will return FALSE if there is no such item
// wxTreeItemId.IsOk() will return False if there is no such item
wxTreeItemId GetItemParent(const wxTreeItemId& item) const;
@ -537,8 +537,8 @@ public:
wxTreeItemId ritem = self->GetFirstChild(item, cookie);
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), true));
PyTuple_SET_ITEM(tup, 1, wxPyConstructObject(cookie, wxT("wxTreeItemIdValue"), true));
PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), True));
PyTuple_SET_ITEM(tup, 1, wxPyConstructObject(cookie, wxT("wxTreeItemIdValue"), True));
wxPyEndBlockThreads();
return tup;
}
@ -552,8 +552,8 @@ public:
wxTreeItemId ritem = self->GetNextChild(item, cookie);
wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), true));
PyTuple_SET_ITEM(tup, 1, wxPyConstructObject(cookie, wxT("wxTreeItemIdValue"), true));
PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), True));
PyTuple_SET_ITEM(tup, 1, wxPyConstructObject(cookie, wxT("wxTreeItemIdValue"), True));
wxPyEndBlockThreads();
return tup;
}
@ -669,7 +669,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
@ -692,12 +692,12 @@ 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)) {
wxPyBeginBlockThreads();
wxRect* r = new wxRect(rect);
PyObject* val = wxPyConstructObject((void*)r, wxT("wxRect"), true);
PyObject* val = wxPyConstructObject((void*)r, wxT("wxRect"), True);
wxPyEndBlockThreads();
return val;
}

View File

@ -56,7 +56,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);
};
@ -78,7 +78,7 @@ public:
self._setOORInfo(self)"
wxPyValidator();
void _setCallbackInfo(PyObject* self, PyObject* _class, int incref=TRUE);
void _setCallbackInfo(PyObject* self, PyObject* _class, int incref=True);
};

View File

@ -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
@ -159,7 +159,7 @@ public:
// scroll to the specified line: it will become the first visible line in
// the window
//
// return true if we scrolled the window, false if nothing was done
// return True if we scrolled the window, False if nothing was done
bool ScrollToLine(size_t line);
// scroll by the specified number of lines/pages
@ -368,16 +368,16 @@ public:
// selects or deselects the specified item which must be valid (i.e. not
// equal to wxNOT_FOUND)
//
// return true if the items selection status has changed or false
// return True if the items selection status has changed or False
// 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
//
// return true if any items selection status has changed, false otherwise
// return True if any items selection status has changed, False otherwise
//
// this function is only valid for the single selection listboxes
bool SelectRange(size_t from, size_t to);
@ -390,7 +390,7 @@ public:
// select all items in the listbox
//
// the return code indicates if any items were affected by this operation
// (true) or if nothing has changed (false)
// (True) or if nothing has changed (False)
bool SelectAll();
// unselect all items in the listbox

View File

@ -28,7 +28,7 @@
class wxWave : public wxObject
{
public:
wxWave(const wxString& fileName, bool isResource = FALSE) {
wxWave(const wxString& fileName, bool isResource = False) {
wxPyBeginBlockThreads();
PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform.");
wxPyEndBlockThreads();
@ -41,8 +41,8 @@ public:
~wxWave() {}
bool IsOk() const { return FALSE; }
bool Play(bool async = TRUE, bool looped = FALSE) const { return FALSE; }
bool IsOk() const { return False; }
bool Play(bool async = True, bool looped = False) const { return False; }
};
#endif
@ -53,7 +53,7 @@ public:
class wxWave /*: public wxObject*/
{
public:
wxWave(const wxString& fileName, bool isResource = FALSE);
wxWave(const wxString& fileName, bool isResource = False);
%extend {
%name(WaveData) wxWave(const wxString& data) {
return new wxWave(data.Len(), (wxByte*)data.c_str());
@ -63,7 +63,7 @@ public:
~wxWave();
bool IsOk() const;
bool Play(bool async = TRUE, bool looped = FALSE) const;
bool Play(bool async = True, bool looped = False) const;
%pythoncode { def __nonzero__(self): return self.IsOk() }
};

View File

@ -18,6 +18,8 @@
%{
%}
MAKE_CONST_WXSTRING(PanelNameStr);
//---------------------------------------------------------------------------
%newgroup
@ -45,14 +47,14 @@ public:
// deleting the window
// -------------------
// ask the window to close itself, return TRUE if the event handler
// ask the window to close itself, return True if the event handler
// honoured our request
bool Close( bool force = FALSE );
bool Close( bool force = False );
// delete window unconditionally (dangerous!), returns TRUE if ok
// delete window unconditionally (dangerous!), returns True if ok
virtual bool Destroy();
// delete all children of this window, returns TRUE if ok
// delete all children of this window, returns True if ok
bool DestroyChildren();
// is the window being deleted?
@ -127,21 +129,34 @@ public:
%name(SetClientRect) void SetClientSize(const wxRect& rect);
// get the window position
wxPoint GetPosition() const;
%name(GetPositionTuple) void GetPosition( int *OUTPUT, int *OUTPUT ) const;
DocStr(GetPosition, // sets the docstring for both
"Get the window's position.");
wxPoint GetPosition();
DocDeclAName(
void, GetPosition(int *OUTPUT, int *OUTPUT),
"GetPositionTuple() -> (x,y)",
GetPositionTuple);
// get the window size
DocStr(GetSize, "Get the window size.");
wxSize GetSize() const;
%name(GetSizeTuple) void GetSize( int *OUTPUT, int *OUTPUT ) const;
DocDeclAName(
void, GetSize( int *OUTPUT, int *OUTPUT ) const,
"GetSizeTuple() -> (width, height)",
GetSizeTuple);
// get the window position and size
wxRect GetRect() const;
// get the window's client size
DocStr(GetClientSize, "Get the window's client size.");
wxSize GetClientSize() const;
%name(GetClientSizeTuple) void GetClientSize( int *OUTPUT, int *OUTPUT ) const;
DocDeclAName(
void, GetClientSize( int *OUTPUT, int *OUTPUT ) const,
"GetClientSizeTuple() -> (width, height)",
GetClientSizeTuple);
// get the origin of the client area of the window relative to the
@ -152,10 +167,15 @@ public:
// get the client rectangle in window (i.e. client) coordinates
wxRect GetClientRect() const;
// get the size best suited for the window (in fact, minimal
// acceptable size using which it will still look "nice")
DocStr(GetBestSize,
"Get the size best suited for the window (in fact, minimal acceptable size\n"
"using which it will still look \"nice\")");
wxSize GetBestSize() const;
%name(GetBestSizeTuple) void GetBestSize(int *OUTPUT, int *OUTPUT) const;
DocDeclAName(
void, GetBestSize(int *OUTPUT, int *OUTPUT) const,
"GetBestSizeTuple() -> (width, height)",
GetBestSizeTuple);
// There are times (and windows) where 'Best' size and 'Min' size
// are vastly out of sync. This should be remedied somehow, but in
@ -203,16 +223,24 @@ public:
// Override this method to control the values given to Sizers etc.
virtual wxSize GetMaxSize() const;
// Methods for accessing the virtual size of a window. For most
// windows this is just the client area of the window, but for
// some like scrolled windows it is more or less independent of
// the screen window size. You may override the DoXXXVirtual
// methods below for classes where that is is the case.
void SetVirtualSize( const wxSize &size );
DocStr(SetVirtualSize,
"Set the the virtual size of a window. For most windows this is just the\n"
"client area of the window, but for some like scrolled windows it is more or\n"
"less independent of the screen window size.");
void SetVirtualSize(const wxSize& size );
%name(SetVirtualSizeWH) void SetVirtualSize( int w, int h );
DocStr(GetVirtualSize,
"Get the the virtual size of the window. For most windows this is just\n"
"the client area of the window, but for some like scrolled windows it is\n"
"more or less independent of the screen window size.");
wxSize GetVirtualSize() const;
%name(GetVirtualSizeTuple)void GetVirtualSize( int *OUTPUT, int *OUTPUT ) const;
DocDeclAName(
void, GetVirtualSize( int *OUTPUT, int *OUTPUT ) const,
"GetVirtualSizeTuple() -> (width, height)",
GetVirtualSizeTuple);
// TODO: using directors?
@ -232,13 +260,13 @@ public:
// window state
// ------------
// returns TRUE if window was shown/hidden, FALSE if the nothing was
// returns True if window was shown/hidden, False if the nothing was
// done (window was already shown/hidden)
virtual bool Show( bool show = TRUE );
virtual bool Show( bool show = True );
bool Hide();
// returns TRUE if window was enabled/disabled, FALSE if nothing done
virtual bool Enable( bool enable = TRUE );
// returns True if window was enabled/disabled, False if nothing done
virtual bool Enable( bool enable = True );
bool Disable();
bool IsShown() const;
@ -263,14 +291,14 @@ public:
long GetExtraStyle() const;
// make the window modal (all other windows unresponsive)
virtual void MakeModal(bool modal = TRUE);
virtual void MakeModal(bool modal = True);
virtual void SetThemeEnabled(bool enableTheme);
virtual bool GetThemeEnabled() const;
// controls by default inherit the colours of their parents, if a
// particular control class doesn't want to do it, it can override
// ShouldInheritColours() to return false
// ShouldInheritColours() to return False
virtual bool ShouldInheritColours() const;
@ -325,8 +353,8 @@ public:
// is this window a top level one?
virtual bool IsTopLevel() const;
// change the real parent of this window, return TRUE if the parent
// was changed, FALSE otherwise (error or newParent == oldParent)
// change the real parent of this window, return True if the parent
// was changed, False otherwise (error or newParent == oldParent)
virtual bool Reparent( wxWindow *newParent );
// implementation mostly
@ -357,11 +385,11 @@ public:
// push/pop event handler: allows to chain a custom event handler to
// alreasy existing ones
void PushEventHandler( wxEvtHandler *handler );
wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
wxEvtHandler *PopEventHandler( bool deleteHandler = False );
// find the given handler in the event handler chain and remove (but
// not delete) it from the event handler chain, return TRUE if it was
// found and FALSE otherwise (this also results in an assert failure so
// not delete) it from the event handler chain, return True if it was
// found and False otherwise (this also results in an assert failure so
// this function should only be called when the handler is supposed to
// be there)
bool RemoveEventHandler(wxEvtHandler *handler);
@ -394,7 +422,7 @@ public:
#if wxUSE_HOTKEY
return self->RegisterHotKey(hotkeyId, modifiers, keycode);
#else
return FALSE;
return False;
#endif
}
@ -402,7 +430,7 @@ public:
#if wxUSE_HOTKEY
return self->UnregisterHotKey(hotkeyId);
#else
return FALSE;
return False;
#endif
}
}
@ -449,7 +477,7 @@ public:
// mark the specified rectangle (or the whole window) as "dirty" so it
// will be repainted
virtual void Refresh( bool eraseBackground = TRUE,
virtual void Refresh( bool eraseBackground = True,
const wxRect *rect = NULL );
// a less awkward wrapper for Refresh
@ -489,19 +517,19 @@ public:
// --------------------------
// set/retrieve the window colours (system defaults are used by
// default): Set functions return TRUE if colour was changed
// default): Set functions return True if colour was changed
virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetForegroundColour( const wxColour &colour );
wxColour GetBackgroundColour() const;
wxColour GetForegroundColour() const;
// set/retrieve the cursor for this window (SetCursor() returns TRUE
// set/retrieve the cursor for this window (SetCursor() returns True
// if the cursor was really changed)
virtual bool SetCursor( const wxCursor &cursor );
wxCursor& GetCursor();
// set/retrieve the font for the window (SetFont() returns TRUE if the
// set/retrieve the font for the window (SetFont() returns True if the
// font really changed)
virtual bool SetFont( const wxFont &font );
wxFont& GetFont();
@ -516,13 +544,19 @@ public:
virtual int GetCharHeight() const;
virtual int GetCharWidth() const;
// get the width/height/... of the text using current or specified
// font
virtual void GetTextExtent(const wxString& string, int *OUTPUT, int *OUTPUT); // x, y
%name(GetFullTextExtent) virtual void GetTextExtent(const wxString& string,
int *OUTPUT, int *OUTPUT, // x, y
int *OUTPUT, int* OUTPUT, // descent, externalLeading
const wxFont* font = NULL);
DocDeclAStr(
void, GetTextExtent(const wxString& string, int *OUTPUT, int *OUTPUT),
"GetTextExtent(wxString string) -> (width, height)",
"Get the width and height of the text using the current font.");
DocDeclAStrName(
void, GetTextExtent(const wxString& string,
int *OUTPUT, int *OUTPUT, int *OUTPUT, int* OUTPUT,
const wxFont* font = NULL),
"GetFullTextExtent(wxString string, Font font=None) ->\n (width, height, descent, externalLeading)",
"Get the width, height, decent and leading of the text using the current or specified font.",
GetFullTextExtent);
// client <-> screen coords
@ -554,7 +588,7 @@ public:
// get border for the flags of this window
wxBorder GetBorder() const { return GetBorder(GetWindowStyleFlag()); }
// send wxUpdateUIEvents to this window, and children if recurse is TRUE
// send wxUpdateUIEvents to this window, and children if recurse is True
virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE);
// TODO: using directors?
@ -589,8 +623,8 @@ public:
int pos,
int thumbvisible,
int range,
bool refresh = TRUE );
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
bool refresh = True );
virtual void SetScrollPos( int orient, int pos, bool refresh = True );
virtual int GetScrollPos( int orient ) const;
virtual int GetScrollThumb( int orient ) const;
virtual int GetScrollRange( int orient ) const;
@ -601,7 +635,7 @@ public:
// scrolls window by line/page: note that not all controls support this
//
// return TRUE if the position changed, FALSE otherwise
// return True if the position changed, False otherwise
virtual bool ScrollLines(int WXUNUSED(lines));
virtual bool ScrollPages(int WXUNUSED(pages));
@ -674,8 +708,8 @@ public:
virtual bool Layout();
// sizers
void SetSizer(wxSizer *sizer, bool deleteOld = TRUE );
void SetSizerAndFit( wxSizer *sizer, bool deleteOld = TRUE );
void SetSizer(wxSizer *sizer, bool deleteOld = True );
void SetSizerAndFit( wxSizer *sizer, bool deleteOld = True );
wxSizer *GetSizer() const;

View File

@ -190,13 +190,13 @@ public:
// should be used instead for them
// corresponds to wxCAL_NO_YEAR_CHANGE bit
void EnableYearChange(bool enable = TRUE);
void EnableYearChange(bool enable = True);
// corresponds to wxCAL_NO_MONTH_CHANGE bit
void EnableMonthChange(bool enable = TRUE);
void EnableMonthChange(bool enable = True);
// corresponds to wxCAL_SHOW_HOLIDAYS bit
void EnableHolidayDisplay(bool display = TRUE);
void EnableHolidayDisplay(bool display = True);
// customization
// -------------
@ -238,8 +238,8 @@ public:
wxDateTime::WeekDay *wd = NULL);
bool Enable(bool enable = TRUE);
bool Show(bool show = TRUE);
bool Enable(bool enable = True);
bool Show(bool show = True);
};

View File

@ -55,6 +55,7 @@
%include _dirctrl.i
%include _pycontrol.i
%include _cshelp.i
%include _dragimg.i
//---------------------------------------------------------------------------

View File

@ -49,7 +49,7 @@ wx = _sys.modules[__name__]
%{
DECLARE_DEF_STRING(EmptyString);
DECLARE_DEF_STRING(PanelNameStr);
// DECLARE_DEF_STRING(PanelNameStr);
%}
//---------------------------------------------------------------------------

View File

@ -146,10 +146,10 @@ bool wxPyDrawXXXPoint(wxDC& dc, PyObject* coords) {
if (! wxPy2int_seq_helper(coords, &x, &y)) {
PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y) sequences.");
return FALSE;
return False;
}
dc.DrawPoint(x, y);
return TRUE;
return True;
}
bool wxPyDrawXXXLine(wxDC& dc, PyObject* coords) {
@ -157,10 +157,10 @@ bool wxPyDrawXXXLine(wxDC& dc, PyObject* coords) {
if (! wxPy4int_seq_helper(coords, &x1, &y1, &x2, &y2)) {
PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x1,y1, x1,y2) sequences.");
return FALSE;
return False;
}
dc.DrawLine(x1,y1, x2,y2);
return TRUE;
return True;
}
bool wxPyDrawXXXRectangle(wxDC& dc, PyObject* coords) {
@ -168,10 +168,10 @@ bool wxPyDrawXXXRectangle(wxDC& dc, PyObject* coords) {
if (! wxPy4int_seq_helper(coords, &x, &y, &w, &h)) {
PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y, w,h) sequences.");
return FALSE;
return False;
}
dc.DrawRectangle(x, y, w, h);
return TRUE;
return True;
}
bool wxPyDrawXXXEllipse(wxDC& dc, PyObject* coords) {
@ -179,10 +179,10 @@ bool wxPyDrawXXXEllipse(wxDC& dc, PyObject* coords) {
if (! wxPy4int_seq_helper(coords, &x, &y, &w, &h)) {
PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y, w,h) sequences.");
return FALSE;
return False;
}
dc.DrawEllipse(x, y, w, h);
return TRUE;
return True;
}
@ -193,10 +193,10 @@ bool wxPyDrawXXXPolygon(wxDC& dc, PyObject* coords) {
points = wxPoint_LIST_helper(coords, &numPoints);
if (! points) {
PyErr_SetString(PyExc_TypeError, "Expected a sequence of sequences of (x,y) sequences.");
return FALSE;
return False;
}
dc.DrawPolygon(numPoints, points);
return TRUE;
return True;
}

View File

@ -47,7 +47,6 @@
%include _dc.i
%include _imaglist.i
%include _stockobjs.i
%include _dragimg.i
%include _effects.i

View File

@ -59,7 +59,7 @@ PyObject* wxPyMake_##TYPE(TYPE* source) { \
/* Otherwise make a new wrapper for it the old fashioned way and \
give it the OOR treatment */ \
if (! target) { \
target = wxPyConstructObject(source, wxT(#TYPE), FALSE); \
target = wxPyConstructObject(source, wxT(#TYPE), False); \
if (target) \
source->SetClientObject(new wxPyOORClientData(target)); \
} \
@ -796,7 +796,7 @@ public:
bool EndEdit(int row, int col, wxGrid* grid) {
bool rv = FALSE;
bool rv = False;
wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "EndEdit")) {
PyObject* go = wxPyMake_wxObject(grid);
@ -954,7 +954,7 @@ public:
%addtofunc wxGridCellChoiceEditor "self._setOORInfo(self)"
wxGridCellChoiceEditor(int LCOUNT = 0,
const wxString* choices = NULL,
bool allowOthers = FALSE);
bool allowOthers = False);
virtual wxString GetValue();
};
@ -1013,8 +1013,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);
@ -1438,7 +1438,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) {
@ -1452,12 +1452,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;
}
@ -1466,13 +1466,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;
}
%}
@ -1553,17 +1553,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
@ -1597,7 +1597,7 @@ public:
void EndBatch();
int GetBatchCount();
void ForceRefresh();
void Refresh(bool eraseb=TRUE, const wxRect* rect= NULL);
void Refresh(bool eraseb=True, const wxRect* rect= NULL);
// ------ edit control functions
@ -1605,7 +1605,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;
@ -1649,8 +1649,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 );
@ -1704,13 +1704,13 @@ 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();
@ -1727,7 +1727,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
@ -1748,22 +1748,22 @@ public:
bool GetCellOverflow( int row, int col );
void GetCellSize( int row, int col, int *OUTPUT, int *OUTPUT );
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
// 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
@ -1822,19 +1822,19 @@ public:
void SetCellValue( int row, int col, const wxString& s );
// TODO: ??? void SetCellValue( const wxGridCellCoords& coords, const wxString& s )
// returns TRUE if the cell can't be edited
// returns True if the cell can't be edited
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 )
@ -1906,8 +1906,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();
@ -1926,7 +1926,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();
@ -1944,9 +1944,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();

View File

@ -41,8 +41,8 @@
//----------------------------------------------------------------------
wxPyApp* wxPythonApp = NULL; // Global instance of application object
bool wxPyDoCleanup = FALSE;
bool wxPyDoingCleanup = FALSE;
bool wxPyDoCleanup = False;
bool wxPyDoingCleanup = False;
#ifdef WXP_WITH_THREAD
@ -85,7 +85,7 @@ BOOL WINAPI DllMain(
// the inatance has already been set.
if (! wxGetInstance())
wxSetInstance(hinstDLL);
return TRUE;
return True;
}
#endif
@ -98,7 +98,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyApp, wxApp);
wxPyApp::wxPyApp() {
m_assertMode = wxPYAPP_ASSERT_EXCEPTION;
m_startupComplete = false;
m_startupComplete = False;
}
@ -108,7 +108,7 @@ wxPyApp::~wxPyApp() {
// This one isn't acutally called... We fake it with _BootstrapApp
bool wxPyApp::OnInit() {
return FALSE;
return False;
}
@ -130,7 +130,7 @@ int wxPyApp::MainLoop() {
bool wxPyApp::OnInitGui() {
bool rval=TRUE;
bool rval=True;
wxApp::OnInitGui(); // in this case always call the base class version
wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "OnInitGui"))
@ -359,10 +359,10 @@ void wxPyApp::_BootstrapApp()
// The stock objects were all NULL when they were loaded into
// SWIG generated proxies, so re-init those now...
wxPy_ReinitStockObjects(false);
wxPy_ReinitStockObjects(False);
// It's now ok to generate exceptions for assertion errors.
wxPythonApp->SetStartupComplete(true);
wxPythonApp->SetStartupComplete(True);
// Call the Python wxApp's OnInit function
if (wxPyCBH_findCallback(m_myInst, "OnInit")) {
@ -376,7 +376,7 @@ void wxPyApp::_BootstrapApp()
}
else {
// Is it okay if there is no OnInit? Probably so...
result = true;
result = True;
}
@ -464,15 +464,15 @@ void __wxPyPreStart(PyObject* moduleDict)
wxApp::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, "wxPython");
// Init the stock objects to a non-NULL value so SWIG doesn't create them as None
wxPy_ReinitStockObjects(true);
wxPy_ReinitStockObjects(True);
}
void __wxPyCleanup() {
wxPyDoingCleanup = TRUE;
wxPyDoingCleanup = True;
if (wxPyDoCleanup) {
wxPyDoCleanup = FALSE;
wxPyDoCleanup = False;
wxEntryCleanup();
}
#ifdef WXP_WITH_THREAD
@ -540,7 +540,7 @@ PyObject* __wxPySetDictionary(PyObject* /* self */, PyObject* args)
//---------------------------------------------------------------------------
// Python's PyInstance_Check does not return true for instances of new-style
// Python's PyInstance_Check does not return True for instances of new-style
// classes. This should get close enough for both new and old classes but I
// should re-evaluate the need for doing instance checks...
bool wxPyInstance_Check(PyObject* obj) {
@ -754,14 +754,14 @@ void wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName) {
PyObject* wxPyMake_wxObject(wxObject* source, bool checkEvtHandler) {
PyObject* target = NULL;
bool isEvtHandler = FALSE;
bool isEvtHandler = False;
if (source) {
// If it's derived from wxEvtHandler then there may
// already be a pointer to a Python object that we can use
// in the OOR data.
if (checkEvtHandler && wxIsKindOf(source, wxEvtHandler)) {
isEvtHandler = TRUE;
isEvtHandler = True;
wxEvtHandler* eh = (wxEvtHandler*)source;
wxPyOORClientData* data = (wxPyOORClientData*)eh->GetClientObject();
if (data) {
@ -785,7 +785,7 @@ PyObject* wxPyMake_wxObject(wxObject* source, bool checkEvtHandler) {
exists = wxPyCheckSwigType(name);
}
if (info) {
target = wxPyConstructObject((void*)source, name, FALSE);
target = wxPyConstructObject((void*)source, name, False);
if (target && isEvtHandler)
((wxEvtHandler*)source)->SetClientObject(new wxPyOORClientData(target));
} else {
@ -817,7 +817,7 @@ PyObject* wxPyMake_wxSizer(wxSizer* source) {
}
}
if (! target) {
target = wxPyMake_wxObject(source, FALSE);
target = wxPyMake_wxObject(source, False);
if (target != Py_None)
((wxSizer*)source)->SetClientObject(new wxPyOORClientData(target));
}
@ -946,7 +946,7 @@ bool wxPyInputStream::eof() {
if (m_wxis)
return m_wxis->Eof();
else
return TRUE;
return True;
}
wxPyInputStream::~wxPyInputStream() {
@ -1256,7 +1256,7 @@ void wxPyCallback::EventThunker(wxEvent& event) {
PyObject* result;
PyObject* arg;
PyObject* tuple;
bool checkSkip = FALSE;
bool checkSkip = False;
wxPyBeginBlockThreads();
wxString className = event.GetClassInfo()->GetClassName();
@ -1435,7 +1435,7 @@ bool wxPyCallbackHelper::findCallback(const char* name) const {
int wxPyCallbackHelper::callCallback(PyObject* argTuple) const {
PyObject* result;
int retval = FALSE;
int retval = False;
result = callCallbackObj(argTuple);
if (result) { // Assumes an integer return type...
@ -1502,7 +1502,7 @@ void wxPyCBH_delete(wxPyCallbackHelper* cbh) {
wxPyEvtSelfRef::wxPyEvtSelfRef() {
//m_self = Py_None; // **** We don't do normal ref counting to prevent
//Py_INCREF(m_self); // circular loops...
m_cloned = FALSE;
m_cloned = False;
}
wxPyEvtSelfRef::~wxPyEvtSelfRef() {
@ -1519,7 +1519,7 @@ void wxPyEvtSelfRef::SetSelf(PyObject* self, bool clone) {
m_self = self;
if (clone) {
Py_INCREF(m_self);
m_cloned = TRUE;
m_cloned = True;
}
wxPyEndBlockThreads();
}
@ -1542,7 +1542,7 @@ wxPyEvent::wxPyEvent(int winid, wxEventType commandType)
wxPyEvent::wxPyEvent(const wxPyEvent& evt)
: wxEvent(evt)
{
SetSelf(evt.m_self, TRUE);
SetSelf(evt.m_self, True);
}
@ -1558,7 +1558,7 @@ wxPyCommandEvent::wxPyCommandEvent(wxEventType commandType, int id)
wxPyCommandEvent::wxPyCommandEvent(const wxPyCommandEvent& evt)
: wxCommandEvent(evt)
{
SetSelf(evt.m_self, TRUE);
SetSelf(evt.m_self, True);
}
@ -1671,13 +1671,13 @@ wxString* wxString_in_helper(PyObject* source) {
wxString Py2wxString(PyObject* source)
{
wxString target;
bool doDecRef = FALSE;
bool doDecRef = False;
#if PYTHON_API_VERSION >= 1009 // Have Python unicode API
if (!PyString_Check(source) && !PyUnicode_Check(source)) {
// Convert to String if not one already... (TODO: Unicode too?)
source = PyObject_Str(source);
doDecRef = TRUE;
doDecRef = True;
}
#if wxUSE_UNICODE
@ -1703,7 +1703,7 @@ wxString Py2wxString(PyObject* source)
if (!PyString_Check(source)) {
// Convert to String if not one already...
source = PyObject_Str(source);
doDecRef = TRUE;
doDecRef = True;
}
target = wxString(PyString_AS_STRING(source), PyString_GET_SIZE(source));
#endif
@ -1827,24 +1827,24 @@ static inline bool wxPointFromObjects(PyObject* o1, PyObject* o2, wxPoint* point
if (PyInt_Check(o1) && PyInt_Check(o2)) {
point->x = PyInt_AS_LONG(o1);
point->y = PyInt_AS_LONG(o2);
return true;
return True;
}
if (PyFloat_Check(o1) && PyFloat_Check(o2)) {
point->x = (int)PyFloat_AS_DOUBLE(o1);
point->y = (int)PyFloat_AS_DOUBLE(o2);
return true;
return True;
}
if (wxPySwigInstance_Check(o1) || wxPySwigInstance_Check(o2)) { // TODO: Why???
// Disallow instances because they can cause havok
return false;
return False;
}
if (PyNumber_Check(o1) && PyNumber_Check(o2)) {
// I believe this excludes instances, so this should be safe without INCREFFing o1 and o2
point->x = PyInt_AsLong(o1);
point->y = PyInt_AsLong(o2);
return true;
return True;
}
return false;
return False;
}
@ -2070,7 +2070,7 @@ bool wxPy2int_seq_helper(PyObject* source, int* i1, int* i2) {
PyObject *o1, *o2;
if (!PySequence_Check(source) || PySequence_Length(source) != 2)
return FALSE;
return False;
if (isFast) {
o1 = PySequence_Fast_GET_ITEM(source, 0);
@ -2088,7 +2088,7 @@ bool wxPy2int_seq_helper(PyObject* source, int* i1, int* i2) {
Py_DECREF(o1);
Py_DECREF(o2);
}
return TRUE;
return True;
}
@ -2097,7 +2097,7 @@ bool wxPy4int_seq_helper(PyObject* source, int* i1, int* i2, int* i3, int* i4) {
PyObject *o1, *o2, *o3, *o4;
if (!PySequence_Check(source) || PySequence_Length(source) != 4)
return FALSE;
return False;
if (isFast) {
o1 = PySequence_Fast_GET_ITEM(source, 0);
@ -2123,7 +2123,7 @@ bool wxPy4int_seq_helper(PyObject* source, int* i1, int* i2, int* i3, int* i4) {
Py_DECREF(o3);
Py_DECREF(o4);
}
return TRUE;
return True;
}
@ -2135,13 +2135,13 @@ bool wxPySimple_typecheck(PyObject* source, const wxChar* classname, int seqLen)
if (wxPySwigInstance_Check(source) &&
wxPyConvertSwigPtr(source, (void **)&ptr, classname))
return true;
return True;
PyErr_Clear();
if (PySequence_Check(source) && PySequence_Length(source) == seqLen)
return true;
return True;
return false;
return False;
}
bool wxSize_helper(PyObject* source, wxSize** obj)
@ -2165,7 +2165,7 @@ bool wxRealPoint_helper(PyObject* source, wxRealPoint** obj) {
if (! wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxRealPoint")))
goto error;
*obj = ptr;
return TRUE;
return True;
}
// otherwise a 2-tuple of floats is expected
else if (PySequence_Check(source) && PyObject_Length(source) == 2) {
@ -2179,12 +2179,12 @@ bool wxRealPoint_helper(PyObject* source, wxRealPoint** obj) {
**obj = wxRealPoint(PyFloat_AsDouble(o1), PyFloat_AsDouble(o2));
Py_DECREF(o1);
Py_DECREF(o2);
return TRUE;
return True;
}
error:
PyErr_SetString(PyExc_TypeError, "Expected a 2-tuple of floats or a wxRealPoint object.");
return FALSE;
return False;
}
@ -2197,7 +2197,7 @@ bool wxRect_helper(PyObject* source, wxRect** obj) {
if (! wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxRect")))
goto error;
*obj = ptr;
return TRUE;
return True;
}
// otherwise a 4-tuple of integers is expected
else if (PySequence_Check(source) && PyObject_Length(source) == 4) {
@ -2219,12 +2219,12 @@ bool wxRect_helper(PyObject* source, wxRect** obj) {
Py_DECREF(o2);
Py_DECREF(o3);
Py_DECREF(o4);
return TRUE;
return True;
}
error:
PyErr_SetString(PyExc_TypeError, "Expected a 4-tuple of integers or a wxRect object.");
return FALSE;
return False;
}
@ -2237,7 +2237,7 @@ bool wxColour_helper(PyObject* source, wxColour** obj) {
if (! wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxColour")))
goto error;
*obj = ptr;
return TRUE;
return True;
}
// otherwise check for a string
else if (PyString_Check(source) || PyUnicode_Check(source)) {
@ -2250,11 +2250,11 @@ bool wxColour_helper(PyObject* source, wxColour** obj) {
spec.Mid(5,2).ToLong(&blue, 16);
**obj = wxColour(red, green, blue);
return TRUE;
return True;
}
else { // it's a colour name
**obj = wxColour(spec);
return TRUE;
return True;
}
}
// last chance: 3-tuple of integers is expected
@ -2272,25 +2272,25 @@ bool wxColour_helper(PyObject* source, wxColour** obj) {
Py_DECREF(o1);
Py_DECREF(o2);
Py_DECREF(o3);
return TRUE;
return True;
}
error:
PyErr_SetString(PyExc_TypeError,
"Expected a wxColour object or a string containing a colour name or '#RRGGBB'.");
return FALSE;
return False;
}
bool wxColour_typecheck(PyObject* source) {
if (wxPySimple_typecheck(source, wxT("wxColour"), 3))
return true;
return True;
if (PyString_Check(source) || PyUnicode_Check(source))
return true;
return True;
return false;
return False;
}
@ -2302,7 +2302,7 @@ bool wxPoint2D_helper(PyObject* source, wxPoint2D** obj) {
if (! wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxPoint2D")))
goto error;
*obj = ptr;
return TRUE;
return True;
}
// otherwise a length-2 sequence of floats is expected
if (PySequence_Check(source) && PySequence_Length(source) == 2) {
@ -2317,11 +2317,11 @@ bool wxPoint2D_helper(PyObject* source, wxPoint2D** obj) {
**obj = wxPoint2D(PyFloat_AsDouble(o1), PyFloat_AsDouble(o2));
Py_DECREF(o1);
Py_DECREF(o2);
return TRUE;
return True;
}
error:
PyErr_SetString(PyExc_TypeError, "Expected a 2-tuple of floats or a wxPoint2D object.");
return FALSE;
return False;
}

View File

@ -126,7 +126,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);
@ -508,7 +508,7 @@ public:
// Can the line be broken before this cell?
bool IsLinebreakAllowed() const;
// Returns true for simple == terminal cells, i.e. not composite ones.
// Returns True for simple == terminal cells, i.e. not composite ones.
// This if for internal usage only and may disappear in future versions!
bool IsTerminalCell() const;
@ -532,9 +532,9 @@ public:
// (if it is the root, depth is 0)
unsigned GetDepth() const;
// Returns true if the cell appears before 'cell' in natural order of
// Returns True if the cell appears before 'cell' in natural order of
// cells (= as they are read). If cell A is (grand)parent of cell B,
// then both A.IsBefore(B) and B.IsBefore(A) always return true.
// then both A.IsBefore(B) and B.IsBefore(A) always return True.
bool IsBefore(wxHtmlCell *cell) const;
// Converts the cell into text representation. If sel != NULL then
@ -610,9 +610,9 @@ class wxPyHtmlFilter : public wxHtmlFilter {
public:
wxPyHtmlFilter() : wxHtmlFilter() {}
// returns TRUE if this filter is able to open&read given file
// 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;
wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "CanRead"))) {
@ -790,7 +790,7 @@ public:
// Set HTML page and display it. !! source is HTML document itself,
// it is NOT address/filename of HTML document. If you want to
// specify document location, use LoadPage() istead
// Return value : FALSE if an error occured, TRUE otherwise
// Return value : False if an error occured, True otherwise
bool SetPage(const wxString& source);
// Load HTML page from given location. Location can be either
@ -851,7 +851,7 @@ public:
void WriteCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString);
// Goes to previous/next page (in browsing history)
// Returns TRUE if successful, FALSE otherwise
// Returns True if successful, False otherwise
bool HistoryBack();
bool HistoryForward();
bool HistoryCanBack();
@ -898,7 +898,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) {
@ -909,7 +909,7 @@ public:
delete [] temp;
}
}
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
);
@ -933,7 +933,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);
@ -1120,7 +1120,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();

View File

@ -37,140 +37,15 @@
// %typemap(python,build) int LCOUNT {
// if (_in_choices) {
// $target = PyList_Size(_in_choices);
// }
// else {
// $target = 0;
// }
// }
// %typemap(python,in) byte* choices {
// $target = byte_LIST_helper($source);
// if ($target == NULL) {
// return NULL;
// }
// }
// %typemap(python,freearg) byte* choices {
// delete [] $source;
// }
// // wxDash is a signed char
// %typemap(python,in) wxDash* choices {
// $target = (wxDash*)byte_LIST_helper($source);
// if ($target == NULL) {
// return NULL;
// }
// }
// %typemap(python,freearg) wxDash* choices {
// delete [] $source;
// }
// %typemap(python,in) int* choices {
// $target = int_LIST_helper($source);
// if ($target == NULL) {
// return NULL;
// }
// }
// %typemap(python,freearg) int* choices {
// delete [] $source;
// }
// %typemap(python,in) long* choices {
// $target = long_LIST_helper($source);
// if ($target == NULL) {
// return NULL;
// }
// }
// %typemap(python,freearg) long* choices {
// delete [] $source;
// }
// %typemap(python,in) unsigned long* choices {
// $target = (unsigned long*)long_LIST_helper($source);
// if ($target == NULL) {
// return NULL;
// }
// }
// %typemap(python,freearg) unsigned long* choices {
// delete [] $source;
// }
// %typemap(python,in) char** choices {
// $target = string_LIST_helper($source);
// if ($target == NULL) {
// return NULL;
// }
// }
// %typemap(python,freearg) char** choices {
// delete [] $source;
// }
// %typemap(python,in) wxBitmap** choices {
// $target = wxBitmap_LIST_helper($source);
// if ($target == NULL) {
// return NULL;
// }
// }
// %typemap(python,freearg) wxBitmap** choices {
// delete [] $source;
// }
// %typemap(python,in) wxString* choices {
// $target = wxString_LIST_helper($source);
// if ($target == NULL) {
// return NULL;
// }
// }
// %typemap(python,freearg) wxString* choices {
// delete [] $source;
// }
// %typemap(python,in) wxAcceleratorEntry* choices {
// $target = wxAcceleratorEntry_LIST_helper($source);
// if ($target == NULL) {
// return NULL;
// }
// }
// %typemap(python,freearg) wxAcceleratorEntry* choices {
// delete [] $source;
// }
// %typemap(python,build) int PCOUNT {
// $target = NPOINTS;
// }
// %typemap(python,in) wxPoint* points (int NPOINTS) {
// $target = wxPoint_LIST_helper($source, &NPOINTS);
// if ($target == NULL) {
// return NULL;
// }
// }
// %typemap(python,freearg) wxPoint* points {
// delete [] $source;
// }
//---------------------------------------------------------------------------
// 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)
delete $1;
@ -186,7 +61,7 @@
%#endif
}
%typemap(python, out) wxString* {
%typemap(out) wxString* {
%#if wxUSE_UNICODE
$result = PyUnicode_FromWideChar($1->c_str(), $1->Len());
%#else
@ -194,7 +69,7 @@
%#endif
}
%typemap(python, varout) wxString {
%typemap(varout) wxString {
%#if wxUSE_UNICODE
$result = PyUnicode_FromWideChar($1.c_str(), $1.Len());
%#else
@ -203,6 +78,14 @@
}
%typemap(in) wxString {
wxString* sptr = wxString_in_helper($input);
if (sptr == NULL) SWIG_fail;
$1 = *sptr;
delete sptr;
}
// //---------------------------------------------------------------------------

View File

@ -58,12 +58,12 @@ class wxWizardEvent : public wxNotifyEvent
public:
wxWizardEvent(wxEventType type = wxEVT_NULL,
int id = -1,
bool direction = TRUE,
bool direction = True,
wxWizardPage* page = NULL);
// for EVT_WIZARD_PAGE_CHANGING, return TRUE if we're going forward or
// FALSE otherwise and for EVT_WIZARD_PAGE_CHANGED return TRUE if we came
// from the previous page and FALSE if we returned from the next one
// for EVT_WIZARD_PAGE_CHANGING, return True if we're going forward or
// False otherwise and for EVT_WIZARD_PAGE_CHANGED return True if we came
// from the previous page and False if we returned from the next one
// (this function doesn't make sense for CANCEL events)
bool GetDirection() const { return m_direction; }
@ -319,8 +319,8 @@ public:
void Init();
// executes the wizard starting from the given page, returns TRUE if it was
// successfully finished, FALSE if user cancelled it
// executes the wizard starting from the given page, returns True if it was
// successfully finished, False if user cancelled it
virtual bool RunWizard(wxWizardPage *firstPage);
// get the current page (NULL if RunWizard() isn't running)
@ -355,9 +355,9 @@ public:
bool IsRunning() const { return m_page != NULL; }
// show the prev/next page, but call TransferDataFromWindow on the current
// page first and return FALSE without changing the page if
// TransferDataFromWindow() returns FALSE - otherwise, returns TRUE
bool ShowPage(wxWizardPage *page, bool goingForward = TRUE);
// page first and return False without changing the page if
// TransferDataFromWindow() returns False - otherwise, returns True
bool ShowPage(wxWizardPage *page, bool goingForward = True);
bool HasNextPage(wxWizardPage* page);
bool HasPrevPage(wxWizardPage* page);