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);
// 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);
// 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;
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();
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)
%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();
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);
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);
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);
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);
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();
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
~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);
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()
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 )
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)
// - 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();
// 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 );
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);
%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))
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; }
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
#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))
typedef unsigned char byte;
typedef wxPoint2DDouble wxPoint2D;
+const bool True = true;
+const bool False = false;
+
#ifndef wxPyUSE_EXPORTED_API
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);
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) {
**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;
}
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; }
m_class = NULL;
m_self = NULL;
m_lastFound = NULL;
- m_incRef = FALSE;
+ m_incRef = False;
}
~wxPyCallbackHelper() {
#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;
#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)); \
#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));\
#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));\
#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; \
}
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));\
#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))) { \
#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); \
#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))) { \
#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); \
#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))) { \
#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))) { \
#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))) \
#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))) \
#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))) \
#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); \
#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))) { \
#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); \
#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))) { \
#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); \
'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',
'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,
// 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();
// 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
// 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
// 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;
// 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();
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 );
};
// 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;
// }
}
// 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
// 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
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;
}
- // 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);
// 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,
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);
// 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
// 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;
}
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);
%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);
// 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
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);
};
// 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.
//
// 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;
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);
wxDataObjectComposite();
%addtofunc Add "args[1].thisown = 0"
- void Add(wxDataObjectSimple *dataObject, int preferred = FALSE);
+ void Add(wxDataObjectSimple *dataObject, int preferred = False);
};
//---------------------------------------------------------------------------
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);
}
else {
// raise a TypeError if not a string
PyErr_SetString(PyExc_TypeError, "String expected.");
- return FALSE;
+ return False;
}
}
}
// 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,
// 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);
// 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)
// 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);
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,
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);
// 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?
// ------------------------------------------------------------------------
// 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
// ------------------------------------------------------------------------
// 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?
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;
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);
%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);
%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
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
//
public:
wxPostScriptDC(const wxPrintData& printData);
// %name(PostScriptDC2)wxPostScriptDC(const wxString& output,
-// bool interactive = TRUE,
+// bool interactive = True,
// wxWindow* parent = NULL);
wxPrintData& GetPrintData();
// %name(PrinterDC2) wxPrinterDC(const wxString& driver,
// const wxString& device,
// const wxString& output,
-// bool interactive = TRUE,
+// bool interactive = True,
// int orientation = wxPORTRAIT);
};
// %name(PrinterDC2) wxPrinterDC(const wxString& driver,
// const wxString& device,
// const wxString& output,
-// bool interactive = TRUE,
+// bool interactive = True,
// int orientation = wxPORTRAIT);
};
#endif
/////////////////////////////////////////////////////////////////////////////
+// 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
#ifndef %pythoncode
#define %pythoncode %insert("python")
-#endif
+#endif
#define WXUNUSED(x) x
%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
//---------------------------------------------------------------------------
wxID_IGNORE,
wxID_HIGHEST,
-
+
wxOPEN,
wxSAVE,
wxHIDE_READONLY,
// 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
// 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
// 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
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);
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();
};
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);
%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();
// 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
// (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.
// 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);
// True if the mouse is just leaving the window
bool Leaving() const;
- // Find the position of the event
+
+ DocStr(GetPosition, // sets the docstring for both
+ "Returns the position of the mouse in window coordinates when the event happened.");
wxPoint GetPosition();
- %name(GetPositionTuple)void GetPosition(long *OUTPUT, long *OUTPUT);
+ 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;
// 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;
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;
};
void SetLoggingOff(bool logOff);
bool GetLoggingOff() const;
- void Veto(bool veto = TRUE);
+ void Veto(bool veto = True);
void SetCanVeto(bool canVeto);
bool CanVeto() const;
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;
class wxIconizeEvent: public wxEvent
{
public:
- wxIconizeEvent(int id = 0, bool iconized = TRUE);
+ wxIconizeEvent(int id = 0, bool iconized = True);
bool Iconized();
};
public:
wxNavigationKeyEvent();
- // direction: forward (true) or backward (false)
+ // direction: forward (True) or backward (False)
bool GetDirection() const;
void SetDirection(bool bForward);
public:
wxIdleEvent();
- void RequestMore(bool needMore = TRUE);
+ void RequestMore(bool needMore = True);
bool MoreRequested() const;
// Specify how wxWindows will send idle events: to
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);
%}
// 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
{ PyErr_SetNone(PyExc_NotImplementedError); return NULL; }
bool wxTestFontEncoding(const wxNativeEncodingInfo& info)
- { PyErr_SetNone(PyExc_NotImplementedError); return false; }
+ { PyErr_SetNone(PyExc_NotImplementedError); return False; }
%}
#endif
// 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().
// 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
%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);
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();
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
bool EnumerateFacenames(
wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all
- bool fixedWidthOnly = FALSE);
+ bool fixedWidthOnly = False);
bool EnumerateEncodings(const wxString& facename = wxPyEmptyString);
void wxBell();
void wxEndBusyCursor();
-long wxGetElapsedTime(bool resetTimer = TRUE);
+long wxGetElapsedTime(bool resetTimer = True);
void wxGetMousePosition(int* OUTPUT, int* OUTPUT);
bool wxIsBusy();
wxString wxNow();
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,
// 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);
#ifdef WXP_WITH_THREAD
return wxThread::IsMain();
#else
- return TRUE;
+ return True;
#endif
}
%}
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()));
}
}
%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)
}
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()));
}
}
%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)
}
// 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
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,
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();
else if (info.gotSize)
return self->Add(info.size.GetWidth(), info.size.GetHeight(),
pos, span, flag, border, data);
- return false;
+ return False;
}
}
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);
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);
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);
// 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;
//---------------------------------------------------------------------------
%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.");
+
+ DocDeclStr(
+ bool, operator!=(const wxSize& sz),
+ "Test for inequality.");
- wxSize operator+(const wxSize& sz);
- wxSize operator-(const wxSize& sz);
+ DocDeclStr(
+ wxSize, operator+(const wxSize& sz),
+ "Add sz's proprties to this and return the result.");
- void IncTo(const wxSize& sz);
- void DecTo(const wxSize& sz);
+ DocDeclStr(
+ wxSize, operator-(const wxSize& sz),
+ "Subtract sz's properties from this and return the result.");
- void Set(int xx, int yy);
+ 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));
}
}
%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)
}
//---------------------------------------------------------------------------
%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));
}
%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));
}
%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)
}
};
%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;
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)
+ }
+
+ 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.");
+
+ 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.");
+
+ 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");
+
+ DocDeclStr(
+ wxRect&, Intersect(const wxRect& rect),
+ "Return the intersectsion of this rectangle and rect.");
- %name(OffsetXY)void Offset(wxCoord dx, wxCoord dy);
- void Offset(const wxPoint& pt);
+ DocDeclStr(
+ wxRect, operator+(const wxRect& rect) const,
+ "Add the properties of rect to this rectangle and return the result.");
- wxRect& Intersect(const wxRect& rect);
+ DocDeclStr(
+ wxRect&, operator+=(const wxRect& rect),
+ "Add the properties of rect to this rectangle, updating this rectangle.");
- wxRect operator+(const wxRect& rect) const;
- wxRect& operator+=(const wxRect& rect);
+ DocDeclStr(
+ bool, operator==(const wxRect& rect) const,
+ "Test for equality.");
- bool operator==(const wxRect& rect) const;
- bool operator!=(const wxRect& rect) const { return !(*this == rect); }
+ DocDeclStr(
+ bool, operator!=(const wxRect& rect) const,
+ "Test for inequality.");
- // return TRUE if the point is (not strcitly) inside the rect
+
+ 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));
}
%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);
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;
}
%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 {
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);
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;
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));
}
%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)
}
~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() }
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.");
};
%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
return NULL;
}
memcpy(copy, data, width*height*3);
- return new wxImage(width, height, copy, FALSE);
+ return new wxImage(width, height, copy, False);
}
}
// 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,
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 );
// 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);
#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);
%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);
// 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() };
//
// 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
// 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.)
// 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
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; }
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
%}
// 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)
// 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;
};
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();
//---------------------------------------------------------------------------
%newgroup
+
// wxListItem: the item or column info, used to exchange data with wxListCtrl
class wxListItem : public wxObject {
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
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) ;
%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)
// 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.
%# 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'''
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)
'''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
// 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);
}
}
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);
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);
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);
// 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);
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;
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);
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);
// 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
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();
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
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();
// 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);
// 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
%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);
// 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);
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()"
// 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);
// 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() )
{
// 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
// cycle thru the pages
- void AdvanceSelection(bool forward = true);
+ void AdvanceSelection(bool forward = True);
};
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;
};
//---------------------------------------------------------------------------
%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;
}
%{
%}
-
//---------------------------------------------------------------------------
%newgroup
%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,
// 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
{
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);
// 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);
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);
// 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();
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.");
#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))) { \
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;
};
%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
virtual void SetThumbPosition(int viewStart);
virtual void SetScrollbar(int position, int thumbSize,
int range, int pageSize,
- bool refresh = TRUE);
+ bool refresh = True);
};
//---------------------------------------------------------------------------
// 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);
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;
// 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;
}
}
}
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();
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();
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();
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);
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);
%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)
void SetSizeHints( wxWindow *window );
void SetVirtualSizeHints( wxWindow *window );
- void Clear( bool delete_windows=FALSE );
+ void Clear( bool delete_windows=False );
void DeleteWindows();
// 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 )
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 )
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;
}
}
// 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;
};
//---------------------------------------------------------------------------
// 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.
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;
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);
%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* {
if ($1) {
_ptr = new wxPyInputStream($1);
}
- $result = wxPyConstructObject(_ptr, wxT("wxPyInputStream"), true);
+ $result = wxPyConstructObject(_ptr, wxT("wxPyInputStream"), True);
}
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
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
#ifdef __WXMSW__
// Caret handling (Windows only)
- bool ShowNativeCaret(bool show = true);
+ bool ShowNativeCaret(bool show = True);
bool HideNativeCaret();
#endif
//
// 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();
// 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;
};
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);
};
// 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).
// 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();
};
// 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
// 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);
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 }
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);
// 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__
%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;
}
}
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);
// 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
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 {
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();
}
// 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;
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;
}
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;
}
#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
%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;
}
// 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);
};
self._setOORInfo(self)"
wxPyValidator();
- void _setCallbackInfo(PyObject* self, PyObject* _class, int incref=TRUE);
+ void _setCallbackInfo(PyObject* self, PyObject* _class, int incref=True);
};
// 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
// 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
// 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);
// 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
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();
~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
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());
~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() }
};
%{
%}
+MAKE_CONST_WXSTRING(PanelNameStr);
+
//---------------------------------------------------------------------------
%newgroup
// 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?
%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
- wxSize GetSize() const;
- %name(GetSizeTuple) void GetSize( int *OUTPUT, int *OUTPUT ) const;
+
+ DocStr(GetSize, "Get the window size.");
+ wxSize GetSize() 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
// 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
// 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?
// 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;
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;
// 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
// 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);
#if wxUSE_HOTKEY
return self->RegisterHotKey(hotkeyId, modifiers, keycode);
#else
- return FALSE;
+ return False;
#endif
}
#if wxUSE_HOTKEY
return self->UnregisterHotKey(hotkeyId);
#else
- return FALSE;
+ return False;
#endif
}
}
// 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
// --------------------------
// 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();
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
// 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?
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;
// 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));
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;
// 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
// -------------
wxDateTime::WeekDay *wd = NULL);
- bool Enable(bool enable = TRUE);
- bool Show(bool show = TRUE);
+ bool Enable(bool enable = True);
+ bool Show(bool show = True);
};
%include _dirctrl.i
%include _pycontrol.i
%include _cshelp.i
+%include _dragimg.i
//---------------------------------------------------------------------------
%{
DECLARE_DEF_STRING(EmptyString);
- DECLARE_DEF_STRING(PanelNameStr);
+// DECLARE_DEF_STRING(PanelNameStr);
%}
//---------------------------------------------------------------------------
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) {
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) {
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) {
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;
}
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;
}
%include _dc.i
%include _imaglist.i
%include _stockobjs.i
-%include _dragimg.i
%include _effects.i
/* 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)); \
} \
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);
%addtofunc wxGridCellChoiceEditor "self._setOORInfo(self)"
wxGridCellChoiceEditor(int LCOUNT = 0,
const wxString* choices = NULL,
- bool allowOthers = FALSE);
+ bool allowOthers = False);
virtual wxString GetValue();
};
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);
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) {
**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;
}
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;
}
%}
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
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
bool IsEditable();
void EnableEditing( bool edit );
- void EnableCellEditControl( bool enable = TRUE );
+ void EnableCellEditControl( bool enable = True );
void DisableCellEditControl();
bool CanEnableCellControl() const;
bool IsCellEditControlEnabled() const;
// 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 );
void SetCellHighlightPenWidth(int width);
void SetCellHighlightROPenWidth(int width);
- void EnableDragRowSize( bool enable = TRUE );
+ void EnableDragRowSize( bool enable = True );
void DisableDragRowSize();
bool CanDragRowSize();
- void EnableDragColSize( bool enable = TRUE );
+ void EnableDragColSize( bool enable = True );
void DisableDragColSize();
bool CanDragColSize();
- void EnableDragGridSize(bool enable = TRUE);
+ void EnableDragGridSize(bool enable = True);
void DisableDragGridSize();
bool CanDragGridSize();
void 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
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
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 )
{
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();
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();
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();
//----------------------------------------------------------------------
wxPyApp* wxPythonApp = NULL; // Global instance of application object
-bool wxPyDoCleanup = FALSE;
-bool wxPyDoingCleanup = FALSE;
+bool wxPyDoCleanup = False;
+bool wxPyDoingCleanup = False;
#ifdef WXP_WITH_THREAD
// the inatance has already been set.
if (! wxGetInstance())
wxSetInstance(hinstDLL);
- return TRUE;
+ return True;
}
#endif
wxPyApp::wxPyApp() {
m_assertMode = wxPYAPP_ASSERT_EXCEPTION;
- m_startupComplete = false;
+ m_startupComplete = False;
}
// This one isn't acutally called... We fake it with _BootstrapApp
bool wxPyApp::OnInit() {
- return FALSE;
+ return False;
}
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"))
// 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")) {
}
else {
// Is it okay if there is no OnInit? Probably so...
- result = true;
+ result = True;
}
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
//---------------------------------------------------------------------------
-// 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) {
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) {
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 {
}
}
if (! target) {
- target = wxPyMake_wxObject(source, FALSE);
+ target = wxPyMake_wxObject(source, False);
if (target != Py_None)
((wxSizer*)source)->SetClientObject(new wxPyOORClientData(target));
}
if (m_wxis)
return m_wxis->Eof();
else
- return TRUE;
+ return True;
}
wxPyInputStream::~wxPyInputStream() {
PyObject* result;
PyObject* arg;
PyObject* tuple;
- bool checkSkip = FALSE;
+ bool checkSkip = False;
wxPyBeginBlockThreads();
wxString className = event.GetClassInfo()->GetClassName();
int wxPyCallbackHelper::callCallback(PyObject* argTuple) const {
PyObject* result;
- int retval = FALSE;
+ int retval = False;
result = callCallbackObj(argTuple);
if (result) { // Assumes an integer return type...
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() {
m_self = self;
if (clone) {
Py_INCREF(m_self);
- m_cloned = TRUE;
+ m_cloned = True;
}
wxPyEndBlockThreads();
}
wxPyEvent::wxPyEvent(const wxPyEvent& evt)
: wxEvent(evt)
{
- SetSelf(evt.m_self, TRUE);
+ SetSelf(evt.m_self, True);
}
wxPyCommandEvent::wxPyCommandEvent(const wxPyCommandEvent& evt)
: wxCommandEvent(evt)
{
- SetSelf(evt.m_self, TRUE);
+ SetSelf(evt.m_self, True);
}
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
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
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;
}
PyObject *o1, *o2;
if (!PySequence_Check(source) || PySequence_Length(source) != 2)
- return FALSE;
+ return False;
if (isFast) {
o1 = PySequence_Fast_GET_ITEM(source, 0);
Py_DECREF(o1);
Py_DECREF(o2);
}
- return TRUE;
+ return True;
}
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);
Py_DECREF(o3);
Py_DECREF(o4);
}
- return TRUE;
+ return True;
}
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)
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) {
**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;
}
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) {
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;
}
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)) {
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
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;
}
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) {
**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;
}
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);
// 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;
// (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
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"))) {
// 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
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();
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) {
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
);
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);
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();
-// %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;
%#endif
}
-%typemap(python, out) wxString* {
+%typemap(out) wxString* {
%#if wxUSE_UNICODE
$result = PyUnicode_FromWideChar($1->c_str(), $1->Len());
%#else
%#endif
}
-%typemap(python, varout) wxString {
+%typemap(varout) wxString {
%#if wxUSE_UNICODE
$result = PyUnicode_FromWideChar($1.c_str(), $1.Len());
%#else
}
+%typemap(in) wxString {
+ wxString* sptr = wxString_in_helper($input);
+ if (sptr == NULL) SWIG_fail;
+ $1 = *sptr;
+ delete sptr;
+}
+
+
// //---------------------------------------------------------------------------
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; }
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)
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);