From 2ba06d5a8ccf8c224fcfbd52fa01a55abf7befbd Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Wed, 9 Jun 2004 16:42:34 +0000 Subject: [PATCH] -1->wxID_ANY, TRUE->true, FALSE->false and tabs replacements. Correct help system in non MSW builds of OGL-Studio sample. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27708 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/ogl/basic.h | 60 +++---- contrib/include/wx/ogl/basicp.h | 4 +- contrib/include/wx/ogl/bmpshape.h | 4 +- contrib/include/wx/ogl/canvas.h | 4 +- contrib/include/wx/ogl/composit.h | 22 +-- contrib/include/wx/ogl/constrnt.h | 4 +- contrib/include/wx/ogl/divided.h | 4 +- contrib/include/wx/ogl/drawn.h | 12 +- contrib/include/wx/ogl/drawnp.h | 8 +- contrib/include/wx/ogl/lines.h | 18 +-- contrib/include/wx/ogl/linesp.h | 4 +- contrib/include/wx/ogl/mfutils.h | 192 +++++++++++------------ contrib/include/wx/ogl/misc.h | 2 +- contrib/include/wx/ogl/ogl.h | 2 +- contrib/include/wx/ogl/ogldiag.h | 2 +- contrib/samples/ogl/ogledit/doc.cpp | 82 +++++----- contrib/samples/ogl/ogledit/doc.h | 4 +- contrib/samples/ogl/ogledit/ogledit.cpp | 10 +- contrib/samples/ogl/ogledit/ogledit.h | 2 +- contrib/samples/ogl/ogledit/palette.cpp | 22 +-- contrib/samples/ogl/ogledit/palette.h | 2 +- contrib/samples/ogl/ogledit/view.cpp | 18 +-- contrib/samples/ogl/ogledit/view.h | 6 +- contrib/samples/ogl/studio/cspalette.cpp | 26 +-- contrib/samples/ogl/studio/cspalette.h | 4 +- contrib/samples/ogl/studio/csprint.cpp | 26 +-- contrib/samples/ogl/studio/dialogs.cpp | 16 +- contrib/samples/ogl/studio/doc.cpp | 82 +++++----- contrib/samples/ogl/studio/doc.h | 2 +- contrib/samples/ogl/studio/mainfrm.cpp | 26 +-- contrib/samples/ogl/studio/project.cpp | 9 +- contrib/samples/ogl/studio/shapes.cpp | 60 +++---- contrib/samples/ogl/studio/shapes.h | 4 +- contrib/samples/ogl/studio/studio.cpp | 81 +++++----- contrib/samples/ogl/studio/studio.h | 11 +- contrib/samples/ogl/studio/symbols.cpp | 2 +- contrib/samples/ogl/studio/view.cpp | 40 ++--- contrib/samples/ogl/studio/view.h | 8 +- contrib/src/ogl/basic.cpp | 134 ++++++++-------- contrib/src/ogl/basic2.cpp | 56 +++---- contrib/src/ogl/bmpshape.cpp | 2 +- contrib/src/ogl/canvas.cpp | 42 ++--- contrib/src/ogl/composit.cpp | 134 ++++++++-------- contrib/src/ogl/constrnt.cpp | 154 +++++++++--------- contrib/src/ogl/divided.cpp | 14 +- contrib/src/ogl/drawn.cpp | 50 +++--- contrib/src/ogl/lines.cpp | 102 ++++++------ contrib/src/ogl/mfutils.cpp | 32 ++-- contrib/src/ogl/ogldiag.cpp | 30 ++-- contrib/src/ogl/oglmisc.cpp | 18 +-- 50 files changed, 835 insertions(+), 818 deletions(-) diff --git a/contrib/include/wx/ogl/basic.h b/contrib/include/wx/ogl/basic.h index 8a2debc068..0e4e5f34a1 100644 --- a/contrib/include/wx/ogl/basic.h +++ b/contrib/include/wx/ogl/basic.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_BASIC_H_ @@ -145,7 +145,7 @@ class WXDLLIMPEXP_OGL wxShapeEvtHandler: public wxObject, public wxClientDataCon virtual void OnDelete(); virtual void OnDraw(wxDC& dc); virtual void OnDrawContents(wxDC& dc); - virtual void OnDrawBranches(wxDC& dc, bool erase = FALSE); + virtual void OnDrawBranches(wxDC& dc, bool erase = false); virtual void OnMoveLinks(wxDC& dc); virtual void OnErase(wxDC& dc); virtual void OnEraseContents(wxDC& dc); @@ -154,8 +154,8 @@ class WXDLLIMPEXP_OGL wxShapeEvtHandler: public wxObject, public wxClientDataCon virtual void OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0); virtual void OnRightClick(double x, double y, int keys = 0, int attachment = 0); virtual void OnSize(double x, double y); - virtual bool OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE); - virtual void OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE); + virtual bool OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + virtual void OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); virtual void OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); // Erase if draw false virtual void OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -166,7 +166,7 @@ class WXDLLIMPEXP_OGL wxShapeEvtHandler: public wxObject, public wxClientDataCon virtual void OnDrawOutline(wxDC& dc, double x, double y, double w, double h); virtual void OnDrawControlPoints(wxDC& dc); virtual void OnEraseControlPoints(wxDC& dc); - virtual void OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE); + virtual void OnMoveLink(wxDC& dc, bool moveControlPoints = true); // Control points ('handles') redirect control to the actual shape, to make it easier // to override sizing behaviour. @@ -234,8 +234,8 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler virtual void OnLeftDoubleClick(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys) = 0, int WXUNUSED(attachment) = 0) {} virtual void OnRightClick(double x, double y, int keys = 0, int attachment = 0); virtual void OnSize(double x, double y); - virtual bool OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE); - virtual void OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE); + virtual bool OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); + virtual void OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); virtual void OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); // Erase if draw false virtual void OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); @@ -268,24 +268,24 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler virtual void MakeMandatoryControlPoints(); virtual void ResetMandatoryControlPoints(); - inline virtual bool Recompute() { return TRUE; }; + inline virtual bool Recompute() { return true; }; // Calculate size recursively, if size changes. Size might depend on children. inline virtual void CalculateSize() { }; - virtual void Select(bool select = TRUE, wxDC* dc = NULL); - virtual void SetHighlight(bool hi = TRUE, bool recurse = FALSE); + virtual void Select(bool select = true, wxDC* dc = NULL); + virtual void SetHighlight(bool hi = true, bool recurse = false); inline virtual bool IsHighlighted() const { return m_highlighted; }; virtual bool Selected() const; virtual bool AncestorSelected() const; - void SetSensitivityFilter(int sens = OP_ALL, bool recursive = FALSE); + void SetSensitivityFilter(int sens = OP_ALL, bool recursive = false); int GetSensitivityFilter() const { return m_sensitivity; } - void SetDraggable(bool drag, bool recursive = FALSE); + void SetDraggable(bool drag, bool recursive = false); inline void SetFixedSize(bool x, bool y) { m_fixedWidth = x; m_fixedHeight = y; }; inline void GetFixedSize(bool *x, bool *y) const { *x = m_fixedWidth; *y = m_fixedHeight; }; inline bool GetFixedWidth() const { return m_fixedWidth; } inline bool GetFixedHeight() const { return m_fixedHeight; } inline void SetSpaceAttachments(bool sp) { m_spaceAttachments = sp; }; inline bool GetSpaceAttachments() const { return m_spaceAttachments; }; - void SetShadowMode(int mode, bool redraw = FALSE); + void SetShadowMode(int mode, bool redraw = false); inline int GetShadowMode() const { return m_shadowMode; } virtual bool HitTest(double x, double y, int *attachment, double *distance); inline void SetCentreResize(bool cr) { m_centreResize = cr; } @@ -305,19 +305,19 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler virtual void Show(bool show); virtual bool IsShown() const { return m_visible; } - virtual void Move(wxDC& dc, double x1, double y1, bool display = TRUE); + virtual void Move(wxDC& dc, double x1, double y1, bool display = true); virtual void Erase(wxDC& dc); virtual void EraseContents(wxDC& dc); virtual void Draw(wxDC& dc); virtual void Flash(); virtual void MoveLinks(wxDC& dc); virtual void DrawContents(wxDC& dc); // E.g. for drawing text label - virtual void SetSize(double x, double y, bool recursive = TRUE); + virtual void SetSize(double x, double y, bool recursive = true); virtual void SetAttachmentSize(double x, double y); void Attach(wxShapeCanvas *can); void Detach(); - inline virtual bool Constrain() { return FALSE; } ; + inline virtual bool Constrain() { return false; } ; void AddLine(wxLineShape *line, wxShape *other, int attachFrom = 0, int attachTo = 0, @@ -413,13 +413,13 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler virtual wxRealPoint CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPoint& pt2, int nth, int noArcs, wxLineShape* line); - // Returns TRUE if pt1 <= pt2 in the sense that one point comes before another on an + // Returns true if pt1 <= pt2 in the sense that one point comes before another on an // edge of the shape. // attachmentPoint is the attachment point (= side) in question. virtual bool AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, const wxRealPoint& pt2); - virtual void EraseLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE); - virtual void DrawLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE); + virtual void EraseLinks(wxDC& dc, int attachment = -1, bool recurse = false); + virtual void DrawLinks(wxDC& dc, int attachment = -1, bool recurse = false); virtual bool MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move, double x, double y); @@ -462,8 +462,8 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler virtual int GetAttachmentLineCount(int attachment) const; // Draw the branches (not the actual arcs though) - virtual void OnDrawBranches(wxDC& dc, int attachment, bool erase = FALSE); - virtual void OnDrawBranches(wxDC& dc, bool erase = FALSE); + virtual void OnDrawBranches(wxDC& dc, int attachment, bool erase = false); + virtual void OnDrawBranches(wxDC& dc, bool erase = false); // Branching attachment settings inline void SetBranchNeckLength(int len) { m_branchNeckLength = len; } @@ -490,13 +490,13 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler // This is really to distinguish between lines and other images. // For lines, want to pass drag to canvas, since lines tend to prevent // dragging on a canvas (they get in the way.) - virtual bool Draggable() const { return TRUE; } + virtual bool Draggable() const { return true; } - // Returns TRUE if image is a descendant of this image + // Returns true if image is a descendant of this image bool HasDescendant(wxShape *image); // Creates a copy of this shape. - wxShape *CreateNewCopy(bool resetMapping = TRUE, bool recompute = TRUE); + wxShape *CreateNewCopy(bool resetMapping = true, bool recompute = true); // Does the copying for this object virtual void Copy(wxShape& copy); @@ -549,11 +549,11 @@ class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler bool m_draggable; int m_attachmentMode; // 0 for no attachments, 1 if using normal attachments, // 2 for branching attachments - bool m_spaceAttachments; // TRUE if lines at one side should be spaced + bool m_spaceAttachments; // true if lines at one side should be spaced bool m_fixedWidth; bool m_fixedHeight; - bool m_centreResize; // Default is to resize keeping the centre constant (TRUE) - bool m_drawHandles; // Don't draw handles if FALSE, usually TRUE + bool m_centreResize; // Default is to resize keeping the centre constant (true) + bool m_drawHandles; // Don't draw handles if false, usually true wxList m_children; // In case it's composite wxShape* m_parent; // In case it's a child int m_formatMode; @@ -589,7 +589,7 @@ class WXDLLIMPEXP_OGL wxPolygonShape: public wxShape double x2, double y2, double *x3, double *y3); bool HitTest(double x, double y, int *attachment, double *distance); - void SetSize(double x, double y, bool recursive = TRUE); + void SetSize(double x, double y, bool recursive = true); void OnDraw(wxDC& dc); void OnDrawOutline(wxDC& dc, double x, double y, double w, double h); @@ -661,7 +661,7 @@ class WXDLLIMPEXP_OGL wxRectangleShape: public wxShape double x2, double y2, double *x3, double *y3); void OnDraw(wxDC& dc); - void SetSize(double x, double y, bool recursive = TRUE); + void SetSize(double x, double y, bool recursive = true); void SetCornerRadius(double rad); // If > 0, rounded corners double GetCornerRadius() const { return m_cornerRadius; } @@ -715,7 +715,7 @@ class WXDLLIMPEXP_OGL wxEllipseShape: public wxShape double *x3, double *y3); void OnDraw(wxDC& dc); - void SetSize(double x, double y, bool recursive = TRUE); + void SetSize(double x, double y, bool recursive = true); #if wxUSE_PROLOGIO void WriteAttributes(wxExpr *clause); diff --git a/contrib/include/wx/ogl/basicp.h b/contrib/include/wx/ogl/basicp.h index f9ce75c669..c4dd09b985 100644 --- a/contrib/include/wx/ogl/basicp.h +++ b/contrib/include/wx/ogl/basicp.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_BASICP_H_ @@ -73,7 +73,7 @@ public: double m_yoffset; wxShape* m_shape; wxCursor* m_oldCursor; - bool m_eraseObject; // If TRUE, erases object before dragging handle. + bool m_eraseObject; // If true, erases object before dragging handle. /* * Store original top-left, bottom-right coordinates diff --git a/contrib/include/wx/ogl/bmpshape.h b/contrib/include/wx/ogl/bmpshape.h index 86251e5545..b6e3dc00a6 100644 --- a/contrib/include/wx/ogl/bmpshape.h +++ b/contrib/include/wx/ogl/bmpshape.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_BITMAP_H_ @@ -35,7 +35,7 @@ class WXDLLIMPEXP_OGL wxBitmapShape: public wxRectangleShape // Does the copying for this object void Copy(wxShape& copy); - void SetSize(double w, double h, bool recursive = TRUE); + void SetSize(double w, double h, bool recursive = true); inline wxBitmap& GetBitmap() const { return (wxBitmap&) m_bitmap; } void SetBitmap(const wxBitmap& bm); inline void SetFilename(const wxString& f) { m_filename = f; }; diff --git a/contrib/include/wx/ogl/canvas.h b/contrib/include/wx/ogl/canvas.h index d65589029a..b849048fad 100644 --- a/contrib/include/wx/ogl/canvas.h +++ b/contrib/include/wx/ogl/canvas.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_CANVAS_H_ @@ -34,7 +34,7 @@ class WXDLLIMPEXP_OGL wxShapeCanvas: public wxScrolledWindow { DECLARE_DYNAMIC_CLASS(wxShapeCanvas) public: - wxShapeCanvas(wxWindow *parent = NULL, wxWindowID id = -1, + wxShapeCanvas(wxWindow *parent = NULL, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxBORDER | wxRETAINED, diff --git a/contrib/include/wx/ogl/composit.h b/contrib/include/wx/ogl/composit.h index 19afcfffcb..d81865b8ed 100644 --- a/contrib/include/wx/ogl/composit.h +++ b/contrib/include/wx/ogl/composit.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_COMPOSIT_H_ @@ -36,16 +36,16 @@ public: void OnDraw(wxDC& dc); void OnDrawContents(wxDC& dc); void OnErase(wxDC& dc); - bool OnMovePre(wxDC& dc, double x, double y, double oldX, double oldY, bool display = TRUE); + bool OnMovePre(wxDC& dc, double x, double y, double oldX, double oldY, bool display = true); void OnDragLeft(bool draw, double x, double y, int keys, int attachment = 0); void OnBeginDragLeft(double x, double y, int keys, int attachment = 0); void OnEndDragLeft(double x, double y, int keys, int attachment = 0); void OnRightClick(double x, double y, int keys, int attachment = 0); - void SetSize(double w, double h, bool recursive = TRUE); + void SetSize(double w, double h, bool recursive = true); - // Returns TRUE if it settled down + // Returns true if it settled down bool Recompute(); // New members @@ -69,7 +69,7 @@ public: // in case it had to find it recursively. wxOGLConstraint *FindConstraint(long id, wxCompositeShape **actualComposite = NULL); - // Returns TRUE if something changed + // Returns true if something changed bool Constrain(); // Make this composite into a container by creating one wxDivisionShape @@ -93,7 +93,7 @@ public: // of the composite that is not in the divisions list. wxShape *FindContainerImage(); - // Returns TRUE if division is a descendant of this container + // Returns true if division is a descendant of this container bool ContainsDivision(wxDivisionShape *division); inline wxList& GetDivisions() const { return (wxList&) m_divisions; } @@ -133,7 +133,7 @@ class WXDLLIMPEXP_OGL wxDivisionShape: public wxCompositeShape void OnDraw(wxDC& dc); void OnDrawContents(wxDC& dc); - bool OnMovePre(wxDC& dc, double x, double y, double oldX, double oldY, bool display = TRUE); + bool OnMovePre(wxDC& dc, double x, double y, double oldX, double oldY, bool display = true); void OnDragLeft(bool draw, double x, double y, int keys, int attachment = 0); void OnBeginDragLeft(double x, double y, int keys, int attachment = 0); void OnEndDragLeft(double x, double y, int keys, int attachment = 0); @@ -142,7 +142,7 @@ class WXDLLIMPEXP_OGL wxDivisionShape: public wxCompositeShape // Don't want this kind of composite to resize its subdiagrams, so // override composite's SetSize. - void SetSize(double w, double h, bool recursive = TRUE); + void SetSize(double w, double h, bool recursive = true); // Similarly for calculating size: it's fixed at whatever SetSize // set it to, not in terms of children. @@ -163,12 +163,12 @@ class WXDLLIMPEXP_OGL wxDivisionShape: public wxCompositeShape // Divide horizontally (wxHORIZONTAL) or vertically (wxVERTICAL) bool Divide(int direction); - // Resize adjoining divisions at the given side. If test is TRUE, + // Resize adjoining divisions at the given side. If test is true, // just see whether it's possible for each adjoining region, - // returning FALSE if it's not. + // returning false if it's not. bool ResizeAdjoining(int side, double newPos, bool test); - // Adjust a side, returning FALSE if it's not physically possible. + // Adjust a side, returning false if it's not physically possible. bool AdjustLeft(double left, bool test); bool AdjustTop(double top, bool test); bool AdjustRight(double right, bool test); diff --git a/contrib/include/wx/ogl/constrnt.h b/contrib/include/wx/ogl/constrnt.h index 338e4dfed2..eaa777d067 100644 --- a/contrib/include/wx/ogl/constrnt.h +++ b/contrib/include/wx/ogl/constrnt.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_CONSTRNT_H_ @@ -69,7 +69,7 @@ class WXDLLIMPEXP_OGL wxOGLConstraint: public wxObject wxOGLConstraint(int type, wxShape *constraining, wxList& constrained); ~wxOGLConstraint(); - // Returns TRUE if anything changed + // Returns true if anything changed bool Evaluate(); inline void SetSpacing(double x, double y) { m_xSpacing = x; m_ySpacing = y; }; bool Equals(double a, double b); diff --git a/contrib/include/wx/ogl/divided.h b/contrib/include/wx/ogl/divided.h index dea08ce1c3..07a5c57614 100644 --- a/contrib/include/wx/ogl/divided.h +++ b/contrib/include/wx/ogl/divided.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_DIVIDED_H_ @@ -39,7 +39,7 @@ class WXDLLIMPEXP_OGL wxDividedShape: public wxRectangleShape void OnDraw(wxDC& dc); void OnDrawContents(wxDC& dc); - void SetSize(double w, double h, bool recursive = TRUE); + void SetSize(double w, double h, bool recursive = true); void MakeControlPoints(); void ResetControlPoints(); diff --git a/contrib/include/wx/ogl/drawn.h b/contrib/include/wx/ogl/drawn.h index ffe35762a3..26527799c9 100644 --- a/contrib/include/wx/ogl/drawn.h +++ b/contrib/include/wx/ogl/drawn.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_DRAWN_H_ @@ -100,8 +100,8 @@ public: virtual void SetClippingRect(const wxRect& rect); virtual void DestroyClippingRect(); - virtual void SetPen(wxPen* pen, bool isOutline = FALSE); // TODO: eventually, just store GDI object attributes, not actual - virtual void SetBrush(wxBrush* brush, bool isFill = FALSE); // pens/brushes etc. + virtual void SetPen(wxPen* pen, bool isOutline = false); // TODO: eventually, just store GDI object attributes, not actual + virtual void SetBrush(wxBrush* brush, bool isFill = false); // pens/brushes etc. virtual void SetFont(wxFont* font); virtual void SetTextColour(const wxColour& colour); virtual void SetBackgroundColour(const wxColour& colour); @@ -155,7 +155,7 @@ class WXDLLIMPEXP_OGL wxDrawnShape: public wxRectangleShape // Get current rotation inline double GetRotation() const { return m_rotation; } - void SetSize(double w, double h, bool recursive = TRUE); + void SetSize(double w, double h, bool recursive = true); bool LoadFromMetaFile(const wxString& filename); inline void SetSaveToFile(bool save) { m_saveToFile = save; } @@ -188,8 +188,8 @@ class WXDLLIMPEXP_OGL wxDrawnShape: public wxRectangleShape virtual void SetClippingRect(const wxRect& rect); virtual void DestroyClippingRect(); - virtual void SetDrawnPen(wxPen* pen, bool isOutline = FALSE); // TODO: eventually, just store GDI object attributes, not actual - virtual void SetDrawnBrush(wxBrush* brush, bool isFill = FALSE); // pens/brushes etc. + virtual void SetDrawnPen(wxPen* pen, bool isOutline = false); // TODO: eventually, just store GDI object attributes, not actual + virtual void SetDrawnBrush(wxBrush* brush, bool isFill = false); // pens/brushes etc. virtual void SetDrawnFont(wxFont* font); virtual void SetDrawnTextColour(const wxColour& colour); virtual void SetDrawnBackgroundColour(const wxColour& colour); diff --git a/contrib/include/wx/ogl/drawnp.h b/contrib/include/wx/ogl/drawnp.h index a2fd6eb17e..d3489d2513 100644 --- a/contrib/include/wx/ogl/drawnp.h +++ b/contrib/include/wx/ogl/drawnp.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_DRAWNP_H_ @@ -70,9 +70,9 @@ public: #endif inline int GetOp() const { return m_op; } - // Draw an outline using the current operation. By default, return FALSE (not drawn) + // Draw an outline using the current operation. By default, return false (not drawn) virtual bool OnDrawOutline(wxDC& WXUNUSED(dc), double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(w), double WXUNUSED(h), - double WXUNUSED(oldW), double WXUNUSED(oldH)) { return FALSE; } + double WXUNUSED(oldW), double WXUNUSED(oldH)) { return false; } // Get the perimeter point using this data virtual bool GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1), @@ -80,7 +80,7 @@ public: double *WXUNUSED(x3), double *WXUNUSED(y3), double WXUNUSED(xOffset), double WXUNUSED(yOffset), int WXUNUSED(attachmentMode)) - { return FALSE; } + { return false; } protected: int m_op; diff --git a/contrib/include/wx/ogl/lines.h b/contrib/include/wx/ogl/lines.h index a7f2f96ec0..e5df1f9660 100644 --- a/contrib/include/wx/ogl/lines.h +++ b/contrib/include/wx/ogl/lines.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_LINES_H_ @@ -83,7 +83,7 @@ class WXDLLIMPEXP_OGL wxArrowHead: public wxObject double m_spacing; // Spacing from the last arrowhead double m_arrowSize; // Length of arrowhead wxString m_arrowName; // Name of arrow - bool m_saveToFile; // TRUE if we want to save custom arrowheads to file. + bool m_saveToFile; // true if we want to save custom arrowheads to file. wxPseudoMetaFile* m_metaFile; // Pseudo metafile if this is a custom arrowhead long m_id; // identifier }; @@ -102,14 +102,14 @@ class WXDLLIMPEXP_OGL wxLineShape: public wxShape // correct position // moveControlPoints must be disabled when a control point is being // dragged. - void OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE); - bool OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE); + void OnMoveLink(wxDC& dc, bool moveControlPoints = true); + bool OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); void OnDraw(wxDC& dc); void OnDrawContents(wxDC& dc); void OnDrawControlPoints(wxDC& dc); void OnEraseControlPoints(wxDC& dc); void OnErase(wxDC& dc); - virtual bool OnMoveControlPoint(int WXUNUSED(which), double WXUNUSED(x), double WXUNUSED(y)) { return FALSE; } + virtual bool OnMoveControlPoint(int WXUNUSED(which), double WXUNUSED(x), double WXUNUSED(y)) { return false; } virtual bool OnMoveMiddleControlPoint(wxDC& dc, wxLineControlPoint* lpt, const wxRealPoint& pt); virtual bool OnLabelMovePre(wxDC& dc, wxLabelShape* labelShape, double x, double y, double old_x, double old_y, bool display); void OnDrawOutline(wxDC& dc, double x, double y, double w, double h); @@ -176,9 +176,9 @@ class WXDLLIMPEXP_OGL wxLineShape: public wxShape virtual void OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, int keys=0, int attachment = 0); // Override select, to create/delete temporary label-moving objects - void Select(bool select = TRUE, wxDC* dc = NULL); + void Select(bool select = true, wxDC* dc = NULL); - // Set to spline (TRUE) or line (FALSE) + // Set to spline (true) or line (false) inline void SetSpline(bool spl) { m_isSpline = spl; } inline bool IsSpline() const { return m_isSpline; } @@ -204,7 +204,7 @@ class WXDLLIMPEXP_OGL wxLineShape: public wxShape // This is really to distinguish between lines and other images. // For lines, want to pass drag to canvas, since lines tend to prevent // dragging on a canvas (they get in the way.) - virtual bool Draggable() const { return FALSE; } + virtual bool Draggable() const { return false; } // Does the copying for this object void Copy(wxShape& copy); @@ -221,7 +221,7 @@ class WXDLLIMPEXP_OGL wxLineShape: public wxShape // E.g. reference list: a b c d e // Current line list: a d // Add c, then line list is: a c d - // If no legal arrowhead position, return FALSE. + // If no legal arrowhead position, return false. // Assume reference list is for one end only, since it potentially defines // the ordering for any one of the 3 positions. So we don't check // the reference list for arrowhead position. diff --git a/contrib/include/wx/ogl/linesp.h b/contrib/include/wx/ogl/linesp.h index ebf2c1cbd8..7faca5b7c0 100644 --- a/contrib/include/wx/ogl/linesp.h +++ b/contrib/include/wx/ogl/linesp.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_LINESP_H_ @@ -68,7 +68,7 @@ class WXDLLIMPEXP_OGL wxLabelShape: public wxRectangleShape void OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0); void OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0); void OnEndDragLeft(double x, double y, int keys=0, int attachment = 0); - bool OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE); + bool OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = true); public: wxLineShape* m_lineShape; diff --git a/contrib/include/wx/ogl/mfutils.h b/contrib/include/wx/ogl/mfutils.h index 02e27e677d..7e171721c7 100644 --- a/contrib/include/wx/ogl/mfutils.h +++ b/contrib/include/wx/ogl/mfutils.h @@ -7,7 +7,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _MFUTILS_H_ @@ -21,253 +21,253 @@ #include #ifndef GetRValue -#define GetRValue(rgb) ((unsigned char)(rgb)) -#define GetGValue(rgb) ((unsigned char)(((int)(rgb)) >> 8)) -#define GetBValue(rgb) ((unsigned char)((rgb)>>16)) +#define GetRValue(rgb) ((unsigned char)(rgb)) +#define GetGValue(rgb) ((unsigned char)(((int)(rgb)) >> 8)) +#define GetBValue(rgb) ((unsigned char)((rgb)>>16)) #endif /* Metafile Functions */ // some compilers have them in their include files #ifndef META_SETBKCOLOR - #define META_SETBKCOLOR 0x0201 + #define META_SETBKCOLOR 0x0201 #endif #ifndef META_SETBKMODE - #define META_SETBKMODE 0x0102 + #define META_SETBKMODE 0x0102 #endif #ifndef META_SETMAPMODE - #define META_SETMAPMODE 0x0103 + #define META_SETMAPMODE 0x0103 #endif #ifndef META_SETROP2 - #define META_SETROP2 0x0104 + #define META_SETROP2 0x0104 #endif #ifndef META_SETRELABS - #define META_SETRELABS 0x0105 + #define META_SETRELABS 0x0105 #endif #ifndef META_SETPOLYFILLMODE - #define META_SETPOLYFILLMODE 0x0106 + #define META_SETPOLYFILLMODE 0x0106 #endif #ifndef META_SETSTRETCHBLTMODE - #define META_SETSTRETCHBLTMODE 0x0107 + #define META_SETSTRETCHBLTMODE 0x0107 #endif #ifndef META_SETTEXTCHAREXTRA - #define META_SETTEXTCHAREXTRA 0x0108 + #define META_SETTEXTCHAREXTRA 0x0108 #endif #ifndef META_SETTEXTCOLOR - #define META_SETTEXTCOLOR 0x0209 + #define META_SETTEXTCOLOR 0x0209 #endif #ifndef META_SETTEXTJUSTIFICATION - #define META_SETTEXTJUSTIFICATION 0x020A + #define META_SETTEXTJUSTIFICATION 0x020A #endif #ifndef META_SETWINDOWORG - #define META_SETWINDOWORG 0x020B + #define META_SETWINDOWORG 0x020B #endif #ifndef META_SETWINDOWEXT - #define META_SETWINDOWEXT 0x020C + #define META_SETWINDOWEXT 0x020C #endif #ifndef META_SETVIEWPORTORG - #define META_SETVIEWPORTORG 0x020D + #define META_SETVIEWPORTORG 0x020D #endif #ifndef META_SETVIEWPORTEXT - #define META_SETVIEWPORTEXT 0x020E + #define META_SETVIEWPORTEXT 0x020E #endif #ifndef META_OFFSETWINDOWORG - #define META_OFFSETWINDOWORG 0x020F + #define META_OFFSETWINDOWORG 0x020F #endif #ifndef META_SCALEWINDOWEXT - #define META_SCALEWINDOWEXT 0x0410 + #define META_SCALEWINDOWEXT 0x0410 #endif #ifndef META_OFFSETVIEWPORTORG - #define META_OFFSETVIEWPORTORG 0x0211 + #define META_OFFSETVIEWPORTORG 0x0211 #endif #ifndef META_SCALEVIEWPORTEXT - #define META_SCALEVIEWPORTEXT 0x0412 + #define META_SCALEVIEWPORTEXT 0x0412 #endif #ifndef META_LINETO - #define META_LINETO 0x0213 + #define META_LINETO 0x0213 #endif #ifndef META_MOVETO - #define META_MOVETO 0x0214 + #define META_MOVETO 0x0214 #endif #ifndef META_EXCLUDECLIPRECT - #define META_EXCLUDECLIPRECT 0x0415 + #define META_EXCLUDECLIPRECT 0x0415 #endif #ifndef META_INTERSECTCLIPRECT - #define META_INTERSECTCLIPRECT 0x0416 + #define META_INTERSECTCLIPRECT 0x0416 #endif #ifndef META_ARC - #define META_ARC 0x0817 + #define META_ARC 0x0817 #endif #ifndef META_ELLIPSE - #define META_ELLIPSE 0x0418 + #define META_ELLIPSE 0x0418 #endif #ifndef META_FLOODFILL - #define META_FLOODFILL 0x0419 + #define META_FLOODFILL 0x0419 #endif #ifndef META_PIE - #define META_PIE 0x081A + #define META_PIE 0x081A #endif #ifndef META_RECTANGLE - #define META_RECTANGLE 0x041B + #define META_RECTANGLE 0x041B #endif #ifndef META_ROUNDRECT - #define META_ROUNDRECT 0x061C + #define META_ROUNDRECT 0x061C #endif #ifndef META_PATBLT - #define META_PATBLT 0x061D + #define META_PATBLT 0x061D #endif #ifndef META_SAVEDC - #define META_SAVEDC 0x001E + #define META_SAVEDC 0x001E #endif #ifndef META_SETPIXEL - #define META_SETPIXEL 0x041F + #define META_SETPIXEL 0x041F #endif #ifndef META_OFFSETCLIPRGN - #define META_OFFSETCLIPRGN 0x0220 + #define META_OFFSETCLIPRGN 0x0220 #endif #ifndef META_TEXTOUT - #define META_TEXTOUT 0x0521 + #define META_TEXTOUT 0x0521 #endif #ifndef META_BITBLT - #define META_BITBLT 0x0922 + #define META_BITBLT 0x0922 #endif #ifndef META_STRETCHBLT - #define META_STRETCHBLT 0x0B23 + #define META_STRETCHBLT 0x0B23 #endif #ifndef META_POLYGON - #define META_POLYGON 0x0324 + #define META_POLYGON 0x0324 #endif #ifndef META_POLYLINE - #define META_POLYLINE 0x0325 + #define META_POLYLINE 0x0325 #endif #ifndef META_ESCAPE - #define META_ESCAPE 0x0626 + #define META_ESCAPE 0x0626 #endif #ifndef META_RESTOREDC - #define META_RESTOREDC 0x0127 + #define META_RESTOREDC 0x0127 #endif #ifndef META_FILLREGION - #define META_FILLREGION 0x0228 + #define META_FILLREGION 0x0228 #endif #ifndef META_FRAMEREGION - #define META_FRAMEREGION 0x0429 + #define META_FRAMEREGION 0x0429 #endif #ifndef META_INVERTREGION - #define META_INVERTREGION 0x012A + #define META_INVERTREGION 0x012A #endif #ifndef META_PAINTREGION - #define META_PAINTREGION 0x012B + #define META_PAINTREGION 0x012B #endif #ifndef META_SELECTCLIPREGION - #define META_SELECTCLIPREGION 0x012C + #define META_SELECTCLIPREGION 0x012C #endif #ifndef META_SELECTOBJECT - #define META_SELECTOBJECT 0x012D + #define META_SELECTOBJECT 0x012D #endif #ifndef META_SETTEXTALIGN - #define META_SETTEXTALIGN 0x012E + #define META_SETTEXTALIGN 0x012E #endif #ifndef META_DRAWTEXT - #define META_DRAWTEXT 0x062F + #define META_DRAWTEXT 0x062F #endif #ifndef META_CHORD - #define META_CHORD 0x0830 + #define META_CHORD 0x0830 #endif #ifndef META_SETMAPPERFLAGS - #define META_SETMAPPERFLAGS 0x0231 + #define META_SETMAPPERFLAGS 0x0231 #endif #ifndef META_EXTTEXTOUT - #define META_EXTTEXTOUT 0x0a32 + #define META_EXTTEXTOUT 0x0a32 #endif #ifndef META_SETDIBTODEV - #define META_SETDIBTODEV 0x0d33 + #define META_SETDIBTODEV 0x0d33 #endif #ifndef META_SELECTPALETTE - #define META_SELECTPALETTE 0x0234 + #define META_SELECTPALETTE 0x0234 #endif #ifndef META_REALIZEPALETTE - #define META_REALIZEPALETTE 0x0035 + #define META_REALIZEPALETTE 0x0035 #endif #ifndef META_ANIMATEPALETTE - #define META_ANIMATEPALETTE 0x0436 + #define META_ANIMATEPALETTE 0x0436 #endif #ifndef META_SETPALENTRIES - #define META_SETPALENTRIES 0x0037 + #define META_SETPALENTRIES 0x0037 #endif #ifndef META_POLYPOLYGON - #define META_POLYPOLYGON 0x0538 + #define META_POLYPOLYGON 0x0538 #endif #ifndef META_RESIZEPALETTE - #define META_RESIZEPALETTE 0x0139 + #define META_RESIZEPALETTE 0x0139 #endif #ifndef META_DIBBITBLT - #define META_DIBBITBLT 0x0940 + #define META_DIBBITBLT 0x0940 #endif #ifndef META_DIBSTRETCHBLT - #define META_DIBSTRETCHBLT 0x0b41 + #define META_DIBSTRETCHBLT 0x0b41 #endif #ifndef META_DIBCREATEPATTERNBRUSH - #define META_DIBCREATEPATTERNBRUSH 0x0142 + #define META_DIBCREATEPATTERNBRUSH 0x0142 #endif #ifndef META_STRETCHDIB - #define META_STRETCHDIB 0x0f43 + #define META_STRETCHDIB 0x0f43 #endif #ifndef META_EXTFLOODFILL - #define META_EXTFLOODFILL 0x0548 + #define META_EXTFLOODFILL 0x0548 #endif #ifndef META_RESETDC - #define META_RESETDC 0x014C + #define META_RESETDC 0x014C #endif #ifndef META_STARTDOC - #define META_STARTDOC 0x014D + #define META_STARTDOC 0x014D #endif #ifndef META_STARTPAGE - #define META_STARTPAGE 0x004F + #define META_STARTPAGE 0x004F #endif #ifndef META_ENDPAGE - #define META_ENDPAGE 0x0050 + #define META_ENDPAGE 0x0050 #endif #ifndef META_ABORTDOC - #define META_ABORTDOC 0x0052 + #define META_ABORTDOC 0x0052 #endif #ifndef META_ENDDOC - #define META_ENDDOC 0x005E + #define META_ENDDOC 0x005E #endif #ifndef META_DELETEOBJECT - #define META_DELETEOBJECT 0x01f0 + #define META_DELETEOBJECT 0x01f0 #endif #ifndef META_CREATEPALETTE - #define META_CREATEPALETTE 0x00f7 + #define META_CREATEPALETTE 0x00f7 #endif #ifndef META_CREATEBRUSH - #define META_CREATEBRUSH 0x00F8 + #define META_CREATEBRUSH 0x00F8 #endif #ifndef META_CREATEPATTERNBRUSH - #define META_CREATEPATTERNBRUSH 0x01F9 + #define META_CREATEPATTERNBRUSH 0x01F9 #endif #ifndef META_CREATEPENINDIRECT - #define META_CREATEPENINDIRECT 0x02FA + #define META_CREATEPENINDIRECT 0x02FA #endif #ifndef META_CREATEFONTINDIRECT - #define META_CREATEFONTINDIRECT 0x02FB + #define META_CREATEFONTINDIRECT 0x02FB #endif #ifndef META_CREATEBRUSHINDIRECT - #define META_CREATEBRUSHINDIRECT 0x02FC + #define META_CREATEBRUSHINDIRECT 0x02FC #endif #ifndef META_CREATEBITMAPINDIRECT - #define META_CREATEBITMAPINDIRECT 0x02FD + #define META_CREATEBITMAPINDIRECT 0x02FD #endif #ifndef META_CREATEBITMAP - #define META_CREATEBITMAP 0x06FE + #define META_CREATEBITMAP 0x06FE #endif #ifndef META_CREATEREGION - #define META_CREATEREGION 0x06FF + #define META_CREATEREGION 0x06FF #endif /* Background Modes */ @@ -280,25 +280,25 @@ /* Pen Styles */ #ifndef PS_SOLID - #define PS_SOLID 0 + #define PS_SOLID 0 #endif #ifndef PS_DASH - #define PS_DASH 1 + #define PS_DASH 1 #endif #ifndef PS_DOT - #define PS_DOT 2 + #define PS_DOT 2 #endif #ifndef PS_DASHDOT - #define PS_DASHDOT 3 + #define PS_DASHDOT 3 #endif #ifndef PS_DASHDOTDOT - #define PS_DASHDOTDOT 4 + #define PS_DASHDOTDOT 4 #endif #ifndef PS_NULL - #define PS_NULL 5 + #define PS_NULL 5 #endif #ifndef PS_INSIDEFRAME - #define PS_INSIDEFRAME 6 + #define PS_INSIDEFRAME 6 #endif /* PitchAndFamily family values (high 4 bits) */ @@ -323,25 +323,25 @@ /* Brush Styles */ #ifndef BS_SOLID - #define BS_SOLID 0 + #define BS_SOLID 0 #endif #ifndef BS_NULL - #define BS_NULL 1 + #define BS_NULL 1 #endif #ifndef BS_HOLLOW - #define BS_HOLLOW BS_NULL + #define BS_HOLLOW BS_NULL #endif #ifndef BS_HATCHED - #define BS_HATCHED 2 + #define BS_HATCHED 2 #endif #ifndef BS_PATTERN - #define BS_PATTERN 3 + #define BS_PATTERN 3 #endif #ifndef BS_INDEXED - #define BS_INDEXED 4 + #define BS_INDEXED 4 #endif #ifndef BS_DIBPATTERN - #define BS_DIBPATTERN 5 + #define BS_DIBPATTERN 5 #endif /* Hatch Styles */ diff --git a/contrib/include/wx/ogl/misc.h b/contrib/include/wx/ogl/misc.h index 70416d30e4..534c748729 100644 --- a/contrib/include/wx/ogl/misc.h +++ b/contrib/include/wx/ogl/misc.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_MISC_H_ diff --git a/contrib/include/wx/ogl/ogl.h b/contrib/include/wx/ogl/ogl.h index f10025a9be..14ef4cb9fe 100644 --- a/contrib/include/wx/ogl/ogl.h +++ b/contrib/include/wx/ogl/ogl.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_OGL_H_ diff --git a/contrib/include/wx/ogl/ogldiag.h b/contrib/include/wx/ogl/ogldiag.h index 9a947182e2..eb31799330 100644 --- a/contrib/include/wx/ogl/ogldiag.h +++ b/contrib/include/wx/ogl/ogldiag.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGL_OGLDIAG_H_ diff --git a/contrib/samples/ogl/ogledit/doc.cpp b/contrib/samples/ogl/ogledit/doc.cpp index 88a17da9ec..ad927465c7 100644 --- a/contrib/samples/ogl/ogledit/doc.cpp +++ b/contrib/samples/ogl/ogledit/doc.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -49,7 +49,7 @@ DiagramDocument::~DiagramDocument(void) bool DiagramDocument::OnCloseDocument(void) { diagram.DeleteAllShapes(); - return TRUE; + return true; } #if wxUSE_STD_IOSTREAM @@ -130,7 +130,7 @@ wxInputStream& DiagramDocument::LoadObject(wxInputStream& stream) DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocument *ddoc, wxClassInfo *info, double xx, double yy, bool sel, wxShape *theShape, wxShape *fs, wxShape *ts): - wxCommand(TRUE, name) + wxCommand(true, name) { doc = ddoc; cmd = command; @@ -143,11 +143,11 @@ DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocumen x = xx; y = yy; selected = sel; - deleteShape = FALSE; + deleteShape = false; } DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocument *ddoc, wxBrush *backgroundColour, wxShape *theShape): - wxCommand(TRUE, name) + wxCommand(true, name) { doc = ddoc; cmd = command; @@ -157,14 +157,14 @@ DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocumen shapeInfo = NULL; x = 0.0; y = 0.0; - selected = FALSE; - deleteShape = FALSE; + selected = false; + deleteShape = false; shapeBrush = backgroundColour; shapePen = NULL; } DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocument *ddoc, const wxString& lab, wxShape *theShape): - wxCommand(TRUE, name) + wxCommand(true, name) { doc = ddoc; cmd = command; @@ -174,8 +174,8 @@ DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocumen shapeInfo = NULL; x = 0.0; y = 0.0; - selected = FALSE; - deleteShape = FALSE; + selected = false; + deleteShape = false; shapeBrush = NULL; shapePen = NULL; shapeLabel = lab; @@ -198,9 +198,9 @@ bool DiagramCommand::Do(void) { if (shape) { - deleteShape = TRUE; + deleteShape = true; - shape->Select(FALSE); + shape->Select(false); // Generate commands to explicitly remove each connected line. RemoveLines(shape); @@ -214,7 +214,7 @@ bool DiagramCommand::Do(void) } shape->Unlink(); - doc->Modify(TRUE); + doc->Modify(true); doc->UpdateAllViews(); } @@ -230,14 +230,14 @@ bool DiagramCommand::Do(void) theShape = (wxShape *)shapeInfo->CreateObject(); theShape->AssignNewIds(); theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxEmptyString)); - theShape->SetCentreResize(FALSE); + theShape->SetCentreResize(false); theShape->SetPen(wxBLACK_PEN); theShape->SetBrush(wxCYAN_BRUSH); theShape->SetSize(60, 60); } doc->GetDiagram()->AddShape(theShape); - theShape->Show(TRUE); + theShape->Show(true); wxClientDC dc(theShape->GetCanvas()); theShape->GetCanvas()->PrepareDC(dc); @@ -245,9 +245,9 @@ bool DiagramCommand::Do(void) theShape->Move(dc, x, y); shape = theShape; - deleteShape = FALSE; + deleteShape = false; - doc->Modify(TRUE); + doc->Modify(true); doc->UpdateAllViews(); break; } @@ -276,7 +276,7 @@ bool DiagramCommand::Do(void) fromShape->AddLine((wxLineShape *)theShape, toShape); - theShape->Show(TRUE); + theShape->Show(true); wxClientDC dc(theShape->GetCanvas()); theShape->GetCanvas()->PrepareDC(dc); @@ -287,9 +287,9 @@ bool DiagramCommand::Do(void) toShape->Move(dc, toShape->GetX(), toShape->GetY()); shape = theShape; - deleteShape = FALSE; + deleteShape = false; - doc->Modify(TRUE); + doc->Modify(true); doc->UpdateAllViews(); break; } @@ -305,7 +305,7 @@ bool DiagramCommand::Do(void) shapeBrush = oldBrush; shape->Draw(dc); - doc->Modify(TRUE); + doc->Modify(true); doc->UpdateAllViews(); } @@ -326,14 +326,14 @@ bool DiagramCommand::Do(void) shape->FormatText(dc, /* (char*) (const char*) */ myHandler->label); shape->Draw(dc); - doc->Modify(TRUE); + doc->Modify(true); doc->UpdateAllViews(); } break; } } - return TRUE; + return true; } bool DiagramCommand::Undo(void) @@ -345,7 +345,7 @@ bool DiagramCommand::Undo(void) if (shape) { doc->GetDiagram()->AddShape(shape); - shape->Show(TRUE); + shape->Show(true); if (shape->IsKindOf(CLASSINFO(wxLineShape))) { @@ -354,11 +354,11 @@ bool DiagramCommand::Undo(void) fromShape->AddLine(lineShape, toShape); } if (selected) - shape->Select(TRUE); + shape->Select(true); - deleteShape = FALSE; + deleteShape = false; } - doc->Modify(TRUE); + doc->Modify(true); doc->UpdateAllViews(); break; } @@ -370,12 +370,12 @@ bool DiagramCommand::Undo(void) wxClientDC dc(shape->GetCanvas()); shape->GetCanvas()->PrepareDC(dc); - shape->Select(FALSE, &dc); + shape->Select(false, &dc); doc->GetDiagram()->RemoveShape(shape); shape->Unlink(); - deleteShape = TRUE; + deleteShape = true; } - doc->Modify(TRUE); + doc->Modify(true); doc->UpdateAllViews(); break; } @@ -391,7 +391,7 @@ bool DiagramCommand::Undo(void) shapeBrush = oldBrush; shape->Draw(dc); - doc->Modify(TRUE); + doc->Modify(true); doc->UpdateAllViews(); } break; @@ -411,14 +411,14 @@ bool DiagramCommand::Undo(void) shape->FormatText(dc, /* (char*) (const char*) */ myHandler->label); shape->Draw(dc); - doc->Modify(TRUE); + doc->Modify(true); doc->UpdateAllViews(); } break; } } - return TRUE; + return true; } // Remove each individual line connected to a shape by sending a command. @@ -448,13 +448,13 @@ void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, // Selection is a concept the library knows about if (GetShape()->Selected()) { - GetShape()->Select(FALSE, &dc); + GetShape()->Select(false, &dc); GetShape()->GetCanvas()->Redraw(dc); // Redraw because bits of objects will be are missing } else { // Ensure no other shape is selected, to simplify Undo/Redo code - bool redraw = FALSE; + bool redraw = false; wxNode *node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); while (node) { @@ -463,13 +463,13 @@ void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, { if (eachShape->Selected()) { - eachShape->Select(FALSE, &dc); - redraw = TRUE; + eachShape->Select(false, &dc); + redraw = true; } } node = node->GetNext(); } - GetShape()->Select(TRUE, &dc); + GetShape()->Select(true, &dc); if (redraw) GetShape()->GetCanvas()->Redraw(dc); } @@ -535,7 +535,7 @@ void MyEvtHandler::OnEndDragRight(double x, double y, int WXUNUSED(keys), int WX { canvas->view->GetDocument()->GetCommandProcessor()->Submit( new DiagramCommand(_T("wxLineShape"), OGLEDIT_ADD_LINE, (DiagramDocument *)canvas->view->GetDocument(), CLASSINFO(wxLineShape), - 0.0, 0.0, FALSE, NULL, GetShape(), otherShape)); + 0.0, 0.0, false, NULL, GetShape(), otherShape)); } } @@ -558,7 +558,7 @@ bool MyDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) wxDiagram::OnShapeSave(db, shape, expr); MyEvtHandler *handler = (MyEvtHandler *)shape.GetEventHandler(); expr.AddAttributeValueString(_T("label"), handler->label); - return TRUE; + return true; } bool MyDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr) @@ -571,7 +571,7 @@ bool MyDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr) if (label) delete[] label; - return TRUE; + return true; } #endif diff --git a/contrib/samples/ogl/ogledit/doc.h b/contrib/samples/ogl/ogledit/doc.h index 50658ffa27..0316e56671 100644 --- a/contrib/samples/ogl/ogledit/doc.h +++ b/contrib/samples/ogl/ogledit/doc.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGLSAMPLE_DOC_H_ @@ -164,7 +164,7 @@ class DiagramCommand: public wxCommand public: // Multi-purpose constructor for creating, deleting shapes DiagramCommand(const wxString& name, int cmd, DiagramDocument *ddoc, wxClassInfo *shapeInfo = NULL, - double x = 0.0, double y = 0.0, bool sel = FALSE, wxShape *theShape = NULL, wxShape *fs = NULL, wxShape *ts = NULL); + double x = 0.0, double y = 0.0, bool sel = false, wxShape *theShape = NULL, wxShape *fs = NULL, wxShape *ts = NULL); // Property-changing command constructors DiagramCommand(const wxString& name, int cmd, DiagramDocument *ddoc, wxBrush *backgroundColour, wxShape *theShape); diff --git a/contrib/samples/ogl/ogledit/ogledit.cpp b/contrib/samples/ogl/ogledit/ogledit.cpp index b69f7dece3..fb1507663c 100644 --- a/contrib/samples/ogl/ogledit/ogledit.cpp +++ b/contrib/samples/ogl/ogledit/ogledit.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -121,9 +121,9 @@ bool MyApp::OnInit(void) frame->CreateStatusBar(1); frame->Centre(wxBOTH); - frame->Show(TRUE); + frame->Show(true); - return TRUE; + return true; } int MyApp::OnExit(void) @@ -147,7 +147,7 @@ END_EVENT_TABLE() MyFrame::MyFrame(wxDocManager *manager, wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, long type): - wxDocParentFrame(manager, frame, -1, title, pos, size, type) + wxDocParentFrame(manager, frame, wxID_ANY, title, pos, size, type) { canvas = NULL; palette = NULL; @@ -197,7 +197,7 @@ MyCanvas *MyFrame::CreateCanvas(wxView *view, wxFrame *parent) parent->GetClientSize(&width, &height); // Non-retained canvas - MyCanvas *canvas = new MyCanvas(view, parent, -1, wxPoint(0, 0), wxSize(width, height), 0); + MyCanvas *canvas = new MyCanvas(view, parent, wxID_ANY, wxPoint(0, 0), wxSize(width, height), 0); canvas->SetCursor(wxCursor(wxCURSOR_HAND)); // Give it scrollbars diff --git a/contrib/samples/ogl/ogledit/ogledit.h b/contrib/samples/ogl/ogledit/ogledit.h index 0cc9ace370..54847c4701 100644 --- a/contrib/samples/ogl/ogledit/ogledit.h +++ b/contrib/samples/ogl/ogledit/ogledit.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(__APPLE__) diff --git a/contrib/samples/ogl/ogledit/palette.cpp b/contrib/samples/ogl/ogledit/palette.cpp index c57862a08e..2f6d39c4cf 100644 --- a/contrib/samples/ogl/ogledit/palette.cpp +++ b/contrib/samples/ogl/ogledit/palette.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -49,7 +49,7 @@ EditorToolPalette::EditorToolPalette(wxWindow* parent, const wxPoint& pos, const wxSize& size, long style): - TOOLPALETTECLASS(parent, -1, pos, size, style) + TOOLPALETTECLASS(parent, wxID_ANY, pos, size, style) { currentlySelected = -1; } @@ -58,7 +58,7 @@ bool EditorToolPalette::OnLeftClick(int toolIndex, bool toggled) { // BEGIN mutual exclusivity code if (toggled && (currentlySelected != -1) && (toolIndex != currentlySelected)) - ToggleTool(currentlySelected, FALSE); + ToggleTool(currentlySelected, false); if (toggled) currentlySelected = toolIndex; @@ -66,7 +66,7 @@ bool EditorToolPalette::OnLeftClick(int toolIndex, bool toggled) currentlySelected = -1; // END mutual exclusivity code - return TRUE; + return true; } void EditorToolPalette::OnMouseEnter(int WXUNUSED(toolIndex)) @@ -96,21 +96,21 @@ EditorToolPalette *MyApp::CreatePalette(wxFrame *parent) wxBitmap PaletteArrow(arrow_xpm); #endif - EditorToolPalette *palette = new EditorToolPalette(parent, wxPoint(0, 0), wxSize(-1, -1), + EditorToolPalette *palette = new EditorToolPalette(parent, wxPoint(0, 0), wxDefaultSize, wxTB_VERTICAL); palette->SetMargins(2, 2); palette->SetToolBitmapSize(wxSize(22, 22)); - palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, TRUE, 0, -1, NULL, _T("Pointer")); - palette->AddTool(PALETTE_TOOL1, PaletteTool1, wxNullBitmap, TRUE, 0, -1, NULL, _T("Tool 1")); - palette->AddTool(PALETTE_TOOL2, PaletteTool2, wxNullBitmap, TRUE, 0, -1, NULL, _T("Tool 2")); - palette->AddTool(PALETTE_TOOL3, PaletteTool3, wxNullBitmap, TRUE, 0, -1, NULL, _T("Tool 3")); - palette->AddTool(PALETTE_TOOL4, PaletteTool4, wxNullBitmap, TRUE, 0, -1, NULL, _T("Tool 4")); + palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, _T("Pointer")); + palette->AddTool(PALETTE_TOOL1, PaletteTool1, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, _T("Tool 1")); + palette->AddTool(PALETTE_TOOL2, PaletteTool2, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, _T("Tool 2")); + palette->AddTool(PALETTE_TOOL3, PaletteTool3, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, _T("Tool 3")); + palette->AddTool(PALETTE_TOOL4, PaletteTool4, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, _T("Tool 4")); palette->Realize(); - palette->ToggleTool(PALETTE_ARROW, TRUE); + palette->ToggleTool(PALETTE_ARROW, true); palette->currentlySelected = PALETTE_ARROW; return palette; } diff --git a/contrib/samples/ogl/ogledit/palette.h b/contrib/samples/ogl/ogledit/palette.h index 09b472ae9a..1ffd119d2a 100644 --- a/contrib/samples/ogl/ogledit/palette.h +++ b/contrib/samples/ogl/ogledit/palette.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGLSAMPLE_PALETTE_H_ diff --git a/contrib/samples/ogl/ogledit/view.cpp b/contrib/samples/ogl/ogledit/view.cpp index 74f8f357fe..8e26ab5f6e 100644 --- a/contrib/samples/ogl/ogledit/view.cpp +++ b/contrib/samples/ogl/ogledit/view.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -52,7 +52,7 @@ bool DiagramView::OnCreate(wxDocument *doc, long WXUNUSED(flags)) canvas->view = this; SetFrame(frame); - Activate(TRUE); + Activate(true); // Initialize the edit menu Undo and Redo items doc->GetCommandProcessor()->SetEditMenu(((MyFrame *)frame)->editMenu); @@ -63,10 +63,10 @@ bool DiagramView::OnCreate(wxDocument *doc, long WXUNUSED(flags)) shapeCanvas->SetDiagram(diagramDoc->GetDiagram()); diagramDoc->GetDiagram()->SetCanvas(shapeCanvas); - return TRUE; + return true; } -#define CENTER FALSE // Place the drawing to the center of the page +#define CENTER false // Place the drawing to the center of the page // Sneakily gets used for default print/preview @@ -152,7 +152,7 @@ void DiagramView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint)) bool DiagramView::OnClose(bool WXUNUSED(deleteWindow)) { if (!GetDocument()->Close()) - return FALSE; + return false; DiagramDocument *diagramDoc = (DiagramDocument *)GetDocument(); diagramDoc->GetDiagram()->SetCanvas(NULL); @@ -168,9 +168,9 @@ bool DiagramView::OnClose(bool WXUNUSED(deleteWindow)) SetFrame(NULL); - Activate(FALSE); + Activate(false); - return TRUE; + return true; } wxShape *DiagramView::FindSelectedShape(void) @@ -197,7 +197,7 @@ void DiagramView::OnCut(wxCommandEvent& WXUNUSED(event)) wxShape *theShape = FindSelectedShape(); if (theShape) - doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), OGLEDIT_CUT, doc, NULL, 0.0, 0.0, TRUE, theShape)); + doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), OGLEDIT_CUT, doc, NULL, 0.0, 0.0, true, theShape)); } void DiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event)) @@ -208,7 +208,7 @@ void DiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event)) if (theShape) { wxColourData data; - data.SetChooseFull(TRUE); + data.SetChooseFull(true); data.SetColour(theShape->GetBrush()->GetColour()); wxColourDialog *dialog = new wxColourDialog(frame, &data); diff --git a/contrib/samples/ogl/ogledit/view.h b/contrib/samples/ogl/ogledit/view.h index 388a22dc06..f9c27952f3 100644 --- a/contrib/samples/ogl/ogledit/view.h +++ b/contrib/samples/ogl/ogledit/view.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGLSAMPLE_VIEW_H_ @@ -26,7 +26,7 @@ class MyCanvas: public wxShapeCanvas public: wxView *view; - MyCanvas(wxView *view, wxWindow *parent = NULL, wxWindowID id = -1, + MyCanvas(wxView *view, wxWindow *parent = NULL, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxRETAINED); ~MyCanvas(void); @@ -62,7 +62,7 @@ class DiagramView: public wxView bool OnCreate(wxDocument *doc, long flags); void OnDraw(wxDC *dc); void OnUpdate(wxView *sender, wxObject *hint = NULL); - bool OnClose(bool deleteWindow = TRUE); + bool OnClose(bool deleteWindow = true); wxShape *FindSelectedShape(void); diff --git a/contrib/samples/ogl/studio/cspalette.cpp b/contrib/samples/ogl/studio/cspalette.cpp index 23a238dc2a..4c2551f9e8 100644 --- a/contrib/samples/ogl/studio/cspalette.cpp +++ b/contrib/samples/ogl/studio/cspalette.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -59,7 +59,7 @@ bool csEditorToolPalette::OnLeftClick(int toolIndex, bool toggled) { // BEGIN mutual exclusivity code if (toggled && (m_currentlySelected != -1) && (toolIndex != m_currentlySelected)) - ToggleTool(m_currentlySelected, FALSE); + ToggleTool(m_currentlySelected, false); if (toggled) m_currentlySelected = toolIndex; @@ -67,7 +67,7 @@ bool csEditorToolPalette::OnLeftClick(int toolIndex, bool toggled) m_currentlySelected = -1; // END mutual exclusivity code - return TRUE; + return true; } void csEditorToolPalette::OnMouseEnter(int toolIndex) @@ -93,10 +93,10 @@ void csEditorToolPalette::SetSelection(int sel) { if ((sel != m_currentlySelected) && (m_currentlySelected != -1)) { - ToggleTool(m_currentlySelected, FALSE); + ToggleTool(m_currentlySelected, false); } m_currentlySelected = sel; - ToggleTool(m_currentlySelected, TRUE); + ToggleTool(m_currentlySelected, true); } bool csApp::CreatePalette(wxFrame *parent) @@ -107,11 +107,11 @@ bool csApp::CreatePalette(wxFrame *parent) win->SetOrientation(wxLAYOUT_HORIZONTAL); win->SetAlignment(wxLAYOUT_TOP); win->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); - win->SetSashVisible(wxSASH_BOTTOM, TRUE); + win->SetSashVisible(wxSASH_BOTTOM, true); m_diagramPaletteSashWindow = win; - m_diagramPaletteSashWindow->Show(FALSE); + m_diagramPaletteSashWindow->Show(false); // Load palette bitmaps #ifdef __WXMSW__ @@ -124,14 +124,14 @@ bool csApp::CreatePalette(wxFrame *parent) wxSize toolBitmapSize(22, 22); #endif - csEditorToolPalette *palette = new csEditorToolPalette(m_diagramPaletteSashWindow, ID_DIAGRAM_PALETTE, wxPoint(0, 0), wxSize(-1, -1), wxTB_HORIZONTAL|wxNO_BORDER); + csEditorToolPalette *palette = new csEditorToolPalette(m_diagramPaletteSashWindow, ID_DIAGRAM_PALETTE, wxPoint(0, 0), wxDefaultSize, wxTB_HORIZONTAL|wxNO_BORDER); palette->SetMargins(2, 2); palette->SetToolBitmapSize(toolBitmapSize); - palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, TRUE, 0, -1, NULL, _T("Pointer")); - palette->AddTool(PALETTE_TEXT_TOOL, TextTool, wxNullBitmap, TRUE, 0, -1, NULL, _T("Text")); + palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, _T("Pointer")); + palette->AddTool(PALETTE_TEXT_TOOL, TextTool, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, _T("Text")); wxChar** symbols = new wxChar*[20]; int noSymbols = 0; @@ -171,7 +171,7 @@ bool csApp::CreatePalette(wxFrame *parent) if (symbol) { wxBitmap* bitmap = GetSymbolDatabase()->CreateToolBitmap(symbol, toolBitmapSize); - palette->AddTool(symbol->GetToolId(), *bitmap, wxNullBitmap, TRUE, 0, -1, NULL, symbol->GetName()); + palette->AddTool(symbol->GetToolId(), *bitmap, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, symbol->GetName()); delete bitmap; } @@ -185,7 +185,7 @@ bool csApp::CreatePalette(wxFrame *parent) csSymbol* symbol = (csSymbol*) node->Data(); wxBitmap* bitmap = GetSymbolDatabase()->CreateToolBitmap(symbol, toolBitmapSize); - palette->AddTool(symbol->GetToolId(), *bitmap, wxNullBitmap, TRUE, 0, -1, NULL, symbol->GetName()); + palette->AddTool(symbol->GetToolId(), *bitmap, wxNullBitmap, true, 0, wxDefaultPosition.y, NULL, symbol->GetName()); delete bitmap; @@ -198,6 +198,6 @@ bool csApp::CreatePalette(wxFrame *parent) palette->SetSelection(PALETTE_ARROW); m_diagramPalette = palette; - return TRUE; + return true; } diff --git a/contrib/samples/ogl/studio/cspalette.h b/contrib/samples/ogl/studio/cspalette.h index 2e36960736..8583f85d5a 100644 --- a/contrib/samples/ogl/studio/cspalette.h +++ b/contrib/samples/ogl/studio/cspalette.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _STUDIO_CSPALETTE_H_ @@ -37,7 +37,7 @@ class csEditorToolPalette: public TOOLPALETTECLASS { public: - csEditorToolPalette(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, + csEditorToolPalette(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTB_VERTICAL); diff --git a/contrib/samples/ogl/studio/csprint.cpp b/contrib/samples/ogl/studio/csprint.cpp index 680fef2ff8..ff3e0ec461 100644 --- a/contrib/samples/ogl/studio/csprint.cpp +++ b/contrib/samples/ogl/studio/csprint.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -45,14 +45,14 @@ bool wxDiagramClipboard::Copy(wxDiagram* diagram) { DeleteAllShapes(); - return DoCopy(diagram, this, FALSE, NULL); + return DoCopy(diagram, this, false, NULL); } // Copy contents to the diagram, with new ids. bool wxDiagramClipboard::Paste(wxDiagram* diagram, wxDC* dc, int offsetX, int offsetY) { - return DoCopy(this, diagram, TRUE, dc, offsetX, offsetY); + return DoCopy(this, diagram, true, dc, offsetX, offsetY); } // Universal copy function (to or from clipboard). @@ -161,7 +161,7 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo OnEndCopy(diagramTo); - return TRUE; + return true; } #ifdef __WXMSW__ @@ -194,7 +194,7 @@ bool wxDiagramClipboard::CopyToClipboard(double scale) wxChar buf[200]; wxSprintf(buf, _T("Sorry, could not allocate clipboard bitmap (%dx%d)"), (maxX+10), (maxY+10)); wxMessageBox(buf, _T("Clipboard copy problem")); - return FALSE; + return false; } wxMemoryDC memDC; @@ -248,10 +248,10 @@ bool wxDiagramClipboard::OnAddShape(wxDiagram* diagramTo, wxShape* newShape, wxD if (dc && (diagramTo != this)) { - newShape->Select(TRUE, dc); + newShape->Select(true, dc); } - return TRUE; + return true; } /* @@ -265,24 +265,24 @@ bool csDiagramClipboard::OnStartCopy(wxDiagram* diagramTo) { // Do nothing if copying to the clipboard if (diagramTo == this) - return TRUE; + return true; // Deselect all objects initially. csDiagram* diagram = (csDiagram*) diagramTo; csDiagramDocument* doc = diagram->GetDocument(); - ((csDiagramView*)doc->GetFirstView())->SelectAll(FALSE); + ((csDiagramView*)doc->GetFirstView())->SelectAll(false); m_currentCmd = new csDiagramCommand(_T("Paste"), doc); - return TRUE; + return true; } bool csDiagramClipboard::OnEndCopy(wxDiagram* diagramTo) { // Do nothing if copying to the clipboard if (diagramTo == this) - return TRUE; + return true; csDiagram* diagram = (csDiagram*) diagramTo; csDiagramDocument* doc = diagram->GetDocument(); @@ -299,7 +299,7 @@ bool csDiagramClipboard::OnEndCopy(wxDiagram* diagramTo) m_currentCmd = NULL; } } - return TRUE; + return true; } // Use the command framework to add the shapes, if we're copying to a diagram and @@ -321,7 +321,7 @@ bool csDiagramClipboard::OnAddShape(wxDiagram* diagramTo, wxShape* newShape, wxD m_currentCmd->AddState(new csCommandState(ID_CS_ADD_SHAPE_SELECT, newShape, NULL)); } - return TRUE; + return true; } diff --git a/contrib/samples/ogl/studio/dialogs.cpp b/contrib/samples/ogl/studio/dialogs.cpp index 753bdf1022..5445c1bc51 100644 --- a/contrib/samples/ogl/studio/dialogs.cpp +++ b/contrib/samples/ogl/studio/dialogs.cpp @@ -90,7 +90,7 @@ END_EVENT_TABLE() // For 400x400 settings dialog, size your panels to about 375x325 in dialog editor csSettingsDialog::csSettingsDialog(wxWindow* parent): - wxDialog(parent, -1, _T("Settings"), wxPoint(0, 0), wxSize(PROPERTY_DIALOG_WIDTH, PROPERTY_DIALOG_HEIGHT)) + wxDialog(parent, wxID_ANY, _T("Settings"), wxPoint(0, 0), wxSize(PROPERTY_DIALOG_WIDTH, PROPERTY_DIALOG_HEIGHT)) { m_generalSettings = NULL; m_diagramSettings = NULL; @@ -105,7 +105,7 @@ csSettingsDialog::csSettingsDialog(wxWindow* parent): #endif wxLoadFromResource(m_generalSettings, m_notebook, _T("general_settings_dialog")); wxASSERT_MSG( (success), _T("Could not load general settings panel.")); - m_notebook->AddPage(m_generalSettings, _T("General"), TRUE); + m_notebook->AddPage(m_generalSettings, _T("General"), true); m_diagramSettings = new wxPanel; @@ -181,7 +181,7 @@ bool csSettingsDialog::TransferDataToWindow() str.Printf(_T("%d"), wxGetApp().GetGridSpacing()); gridSpacing->SetValue(str); - return TRUE; + return true; } bool csSettingsDialog::TransferDataFromWindow() @@ -201,7 +201,7 @@ bool csSettingsDialog::TransferDataFromWindow() if (wxGetApp().GetGridStyle() == csGRID_STYLE_DOTTED) { wxMessageBox(_T("Dotted grid style not yet implemented."), _T("Studio"), wxICON_EXCLAMATION); - return FALSE; + return false; } // Apply settings to all open diagram documents @@ -219,12 +219,12 @@ bool csSettingsDialog::TransferDataFromWindow() { case csGRID_STYLE_NONE: { - diagram->SetSnapToGrid(FALSE); + diagram->SetSnapToGrid(false); break; } case csGRID_STYLE_INVISIBLE: { - diagram->SetSnapToGrid(TRUE); + diagram->SetSnapToGrid(true); break; } case csGRID_STYLE_DOTTED: @@ -237,7 +237,7 @@ bool csSettingsDialog::TransferDataFromWindow() node = node->GetNext(); } - return TRUE; + return true; } /* @@ -258,7 +258,7 @@ END_EVENT_TABLE() csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxString& title, wxPanel* attributeDialog, const wxString& attributeDialogName): - wxDialog(parent, -1, title, wxPoint(0, 0), wxSize(SHAPE_PROPERTY_DIALOG_WIDTH, SHAPE_PROPERTY_DIALOG_HEIGHT)) + wxDialog(parent, wxID_ANY, title, wxPoint(0, 0), wxSize(SHAPE_PROPERTY_DIALOG_WIDTH, SHAPE_PROPERTY_DIALOG_HEIGHT)) { m_attributeDialog = attributeDialog; m_alternativeAttributeDialog = NULL; diff --git a/contrib/samples/ogl/studio/doc.cpp b/contrib/samples/ogl/studio/doc.cpp index 865a03a1ae..0516794afd 100644 --- a/contrib/samples/ogl/studio/doc.cpp +++ b/contrib/samples/ogl/studio/doc.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -50,13 +50,13 @@ csDiagramDocument::~csDiagramDocument() bool csDiagramDocument::OnCloseDocument() { m_diagram.DeleteAllShapes(); - return TRUE; + return true; } bool csDiagramDocument::OnSaveDocument(const wxString& file) { if (file == wxEmptyString) - return FALSE; + return false; if (!m_diagram.SaveFile(file)) { @@ -68,18 +68,18 @@ bool csDiagramDocument::OnSaveDocument(const wxString& file) (void)wxMessageBox(_T("Sorry, could not open this file for saving."), msgTitle, wxOK | wxICON_EXCLAMATION, GetDocumentWindow()); - return FALSE; + return false; } - Modify(FALSE); + Modify(false); SetFilename(file); - return TRUE; + return true; } - + bool csDiagramDocument::OnOpenDocument(const wxString& file) { if (!OnSaveModified()) - return FALSE; + return false; wxString msgTitle; if (wxTheApp->GetAppName() != wxEmptyString) @@ -92,15 +92,15 @@ bool csDiagramDocument::OnOpenDocument(const wxString& file) { (void)wxMessageBox(_T("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION, GetDocumentWindow()); - return FALSE; + return false; } - SetFilename(file, TRUE); - Modify(FALSE); + SetFilename(file, true); + Modify(false); UpdateAllViews(); - return TRUE; + return true; } - + /* * Implementation of drawing command @@ -108,7 +108,7 @@ bool csDiagramDocument::OnOpenDocument(const wxString& file) csDiagramCommand::csDiagramCommand(const wxString& name, csDiagramDocument *doc, csCommandState* onlyState): - wxCommand(TRUE, name) + wxCommand(true, name) { m_doc = doc; @@ -190,10 +190,10 @@ bool csDiagramCommand::Do() { csCommandState* state = (csCommandState*) node->GetData(); if (!state->Do()) - return FALSE; + return false; node = node->GetNext(); } - return TRUE; + return true; } bool csDiagramCommand::Undo() @@ -205,10 +205,10 @@ bool csDiagramCommand::Undo() { csCommandState* state = (csCommandState*) node->GetData(); if (!state->Undo()) - return FALSE; + return false; node = node->GetPrevious(); } - return TRUE; + return true; } csCommandState::csCommandState(int cmd, wxShape* savedState, wxShape* shapeOnCanvas) @@ -264,8 +264,8 @@ bool csCommandState::Do() m_linePositionTo = lineTo->GetLinePosition(lineShape); } - m_shapeOnCanvas->Select(FALSE); - ((csDiagramView*) m_doc->GetFirstView())->SelectShape(m_shapeOnCanvas, FALSE); + m_shapeOnCanvas->Select(false); + ((csDiagramView*) m_doc->GetFirstView())->SelectShape(m_shapeOnCanvas, false); m_shapeOnCanvas->Unlink(); @@ -288,7 +288,7 @@ bool csCommandState::Do() lineTo->MoveLinks(dc); } - m_doc->Modify(TRUE); + m_doc->Modify(true); m_doc->UpdateAllViews(); break; } @@ -309,7 +309,7 @@ bool csCommandState::Do() m_savedState = NULL; m_doc->GetDiagram()->AddShape(m_shapeOnCanvas); - m_shapeOnCanvas->Show(TRUE); + m_shapeOnCanvas->Show(true); wxClientDC dc(m_shapeOnCanvas->GetCanvas()); m_shapeOnCanvas->GetCanvas()->PrepareDC(dc); @@ -321,11 +321,11 @@ bool csCommandState::Do() if (m_cmd == ID_CS_ADD_SHAPE_SELECT) { - m_shapeOnCanvas->Select(TRUE, &dc); - ((csDiagramView*) m_doc->GetFirstView())->SelectShape(m_shapeOnCanvas, TRUE); + m_shapeOnCanvas->Select(true, &dc); + ((csDiagramView*) m_doc->GetFirstView())->SelectShape(m_shapeOnCanvas, true); } - m_doc->Modify(TRUE); + m_doc->Modify(true); m_doc->UpdateAllViews(); break; } @@ -348,7 +348,7 @@ bool csCommandState::Do() lineShape->GetFrom()->AddLine(lineShape, lineShape->GetTo(), lineShape->GetAttachmentFrom(), lineShape->GetAttachmentTo()); - lineShape->Show(TRUE); + lineShape->Show(true); wxClientDC dc(lineShape->GetCanvas()); lineShape->GetCanvas()->PrepareDC(dc); @@ -360,11 +360,11 @@ bool csCommandState::Do() if (m_cmd == ID_CS_ADD_LINE_SELECT) { - lineShape->Select(TRUE, &dc); - ((csDiagramView*) m_doc->GetFirstView())->SelectShape(m_shapeOnCanvas, TRUE); + lineShape->Select(true, &dc); + ((csDiagramView*) m_doc->GetFirstView())->SelectShape(m_shapeOnCanvas, true); } - m_doc->Modify(TRUE); + m_doc->Modify(true); m_doc->UpdateAllViews(); break; } @@ -401,7 +401,7 @@ bool csCommandState::Do() bool isSelected = m_shapeOnCanvas->Selected(); if (isSelected) - m_shapeOnCanvas->Select(FALSE, & dc); + m_shapeOnCanvas->Select(false, & dc); if (m_cmd == ID_CS_SIZE || m_cmd == ID_CS_ROTATE_CLOCKWISE || m_cmd == ID_CS_ROTATE_ANTICLOCKWISE || m_cmd == ID_CS_CHANGE_LINE_ORDERING || m_cmd == ID_CS_CHANGE_LINE_ATTACHMENT) @@ -454,11 +454,11 @@ bool csCommandState::Do() m_shapeOnCanvas->SetSize(width, height); m_shapeOnCanvas->Move(dc, m_shapeOnCanvas->GetX(), m_shapeOnCanvas->GetY()); - m_shapeOnCanvas->Show(TRUE); + m_shapeOnCanvas->Show(true); // Recursively redraw links if we have a composite. if (m_shapeOnCanvas->GetChildren().GetCount() > 0) - m_shapeOnCanvas->DrawLinks(dc, -1, TRUE); + m_shapeOnCanvas->DrawLinks(dc, -1, true); m_shapeOnCanvas->GetEventHandler()->OnEndSize(width, height); } @@ -474,15 +474,15 @@ bool csCommandState::Do() } if (isSelected) - m_shapeOnCanvas->Select(TRUE, & dc); + m_shapeOnCanvas->Select(true, & dc); - m_doc->Modify(TRUE); + m_doc->Modify(true); m_doc->UpdateAllViews(); break; } } - return TRUE; + return true; } bool csCommandState::Undo() @@ -514,9 +514,9 @@ bool csCommandState::Undo() lineShape->GetTo()->MoveLinks(dc); } - m_shapeOnCanvas->Show(TRUE); + m_shapeOnCanvas->Show(true); - m_doc->Modify(TRUE); + m_doc->Modify(true); m_doc->UpdateAllViews(); break; } @@ -547,8 +547,8 @@ bool csCommandState::Undo() wxClientDC dc(m_shapeOnCanvas->GetCanvas()); m_shapeOnCanvas->GetCanvas()->PrepareDC(dc); - m_shapeOnCanvas->Select(FALSE, &dc); - ((csDiagramView*) m_doc->GetFirstView())->SelectShape(m_shapeOnCanvas, FALSE); + m_shapeOnCanvas->Select(false, &dc); + ((csDiagramView*) m_doc->GetFirstView())->SelectShape(m_shapeOnCanvas, false); m_doc->GetDiagram()->RemoveShape(m_shapeOnCanvas); m_shapeOnCanvas->Unlink(); // Unlinks the line, if it is a line @@ -564,7 +564,7 @@ bool csCommandState::Undo() m_savedState = m_shapeOnCanvas; m_shapeOnCanvas = NULL; - m_doc->Modify(TRUE); + m_doc->Modify(true); m_doc->UpdateAllViews(); break; } @@ -591,6 +591,6 @@ bool csCommandState::Undo() } } - return TRUE; + return true; } diff --git a/contrib/samples/ogl/studio/doc.h b/contrib/samples/ogl/studio/doc.h index e9aca18564..a5bf77a7e4 100644 --- a/contrib/samples/ogl/studio/doc.h +++ b/contrib/samples/ogl/studio/doc.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _STUDIO_DOC_H_ diff --git a/contrib/samples/ogl/studio/mainfrm.cpp b/contrib/samples/ogl/studio/mainfrm.cpp index 0214664a50..4a7e4ac4b3 100644 --- a/contrib/samples/ogl/studio/mainfrm.cpp +++ b/contrib/samples/ogl/studio/mainfrm.cpp @@ -52,8 +52,7 @@ BEGIN_EVENT_TABLE(csFrame, wxDocMDIParentFrame) END_EVENT_TABLE() // Define my frame constructor -csFrame::csFrame(wxDocManager* manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, - long style): +csFrame::csFrame(wxDocManager* manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxDocMDIParentFrame(manager, parent, id, title, pos, size, style, _T("frame")) { CreateToolBar(wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL); @@ -73,7 +72,10 @@ csFrame::csFrame(wxDocManager* manager, wxFrame *parent, wxWindowID id, const wx void csFrame::OnHelp(wxCommandEvent& WXUNUSED(event)) { - wxGetApp().GetHelpController().DisplayContents(); + wxHelpControllerBase* help; + help = wxGetApp().GetHelpController(); + if (help) + help->DisplayContents(); } void csFrame::OnSettings(wxCommandEvent& WXUNUSED(event)) @@ -85,7 +87,7 @@ void csFrame::OnSettings(wxCommandEvent& WXUNUSED(event)) void csFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { - Close(TRUE); + Close(true); } void csFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) @@ -155,24 +157,24 @@ void csFrame::OnIdle(wxIdleEvent& event) wxSashLayoutWindow* diagramToolBarWin = wxGetApp().GetDiagramToolBarSashWindow(); if (!paletteWin || !diagramToolBarWin) return; - bool doLayout = FALSE; + bool doLayout = false; if (GetActiveChild()) { if (!paletteWin->IsShown() || !diagramToolBarWin->IsShown()) { - paletteWin->Show(TRUE); - diagramToolBarWin->Show(TRUE); + paletteWin->Show(true); + diagramToolBarWin->Show(true); - doLayout = TRUE; + doLayout = true; } } else { if (paletteWin->IsShown() || diagramToolBarWin->IsShown()) { - paletteWin->Show(FALSE); - diagramToolBarWin->Show(FALSE); - doLayout = TRUE; + paletteWin->Show(false); + diagramToolBarWin->Show(false); + doLayout = true; } } if (doLayout) @@ -206,7 +208,7 @@ void csFrame::OnIdle(wxIdleEvent& event) // General handler for disabling items void csFrame::OnUpdateDisable(wxUpdateUIEvent& event) { - event.Enable(FALSE); + event.Enable(false); } void csFrame::OnSaveUpdate(wxUpdateUIEvent& event) diff --git a/contrib/samples/ogl/studio/project.cpp b/contrib/samples/ogl/studio/project.cpp index 982e239393..aeb0ed4f2b 100644 --- a/contrib/samples/ogl/studio/project.cpp +++ b/contrib/samples/ogl/studio/project.cpp @@ -31,8 +31,7 @@ BEGIN_EVENT_TABLE(csProjectTreeCtrl, wxTreeCtrl) END_EVENT_TABLE() // Define my frame constructor -csProjectTreeCtrl::csProjectTreeCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, - long style): +csProjectTreeCtrl::csProjectTreeCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style): wxTreeCtrl(parent, id, pos, size, style), m_imageList(16, 16) @@ -58,7 +57,7 @@ bool csApp::CreateProjectWindow(wxFrame *WXUNUSED(parent)) win->SetOrientation(wxLAYOUT_VERTICAL); win->SetAlignment(wxLAYOUT_LEFT); win->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); - win->SetSashVisible(wxSASH_RIGHT, TRUE); + win->SetSashVisible(wxSASH_RIGHT, true); win->SetExtraBorderSize(5); m_projectSashWindow = win; @@ -67,10 +66,10 @@ bool csApp::CreateProjectWindow(wxFrame *WXUNUSED(parent)) wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT|wxDOUBLE_BORDER); // For now, hide the window - m_projectSashWindow->Show(FALSE); + m_projectSashWindow->Show(false); #endif - return TRUE; + return true; } // Fill out the project tree control diff --git a/contrib/samples/ogl/studio/shapes.cpp b/contrib/samples/ogl/studio/shapes.cpp index 272b887ba2..2c2e7e7249 100644 --- a/contrib/samples/ogl/studio/shapes.cpp +++ b/contrib/samples/ogl/studio/shapes.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -130,7 +130,7 @@ void csEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, // If the shape was selected, deselect it and vice versa. bool selected = GetShape()->Selected(); - view->SelectAll(FALSE); + view->SelectAll(false); selected = !selected; @@ -143,13 +143,13 @@ void csEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, { if (GetShape()->Selected()) { - GetShape()->Select(FALSE, &dc); - view->SelectShape(GetShape(), FALSE); + GetShape()->Select(false, &dc); + view->SelectShape(GetShape(), false); } else { - GetShape()->Select(TRUE, &dc); - view->SelectShape(GetShape(), TRUE); + GetShape()->Select(true, &dc); + view->SelectShape(GetShape(), true); } GetShape()->GetCanvas()->Redraw(dc); // Redraw because bits of objects will be missing } @@ -477,7 +477,7 @@ void csEvtHandler::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, i wxClientDC dc(canvas); canvas->PrepareDC(dc); - shape->SetDisableLabel(FALSE); + shape->SetDisableLabel(false); if (lpt->m_type == CONTROL_POINT_LINE) { @@ -529,7 +529,7 @@ void csEvtHandler::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, i shape->Recompute(); shape->ResetControlPoints(); if (!pt->m_eraseObject) - shape->Show(FALSE); + shape->Show(false); */ wxShape* newShape = shape->CreateNewCopy(); @@ -612,7 +612,7 @@ bool csEvtHandler::EditProperties() // For now, no line property editing if (shape->IsKindOf(CLASSINFO(wxLineShape))) - return FALSE; + return false; csDiagramView* view = ((csCanvas*)shape->GetCanvas())->GetView(); @@ -677,7 +677,7 @@ bool csEvtHandler::EditProperties() else { wxMessageBox(_T("Unrecognised shape."), _T("Studio"), wxICON_EXCLAMATION); - return FALSE; + return false; } csShapePropertiesDialog* dialog = new csShapePropertiesDialog(shape->GetCanvas()->GetParent(), title, attributeDialog, attributeDialogName); @@ -685,7 +685,7 @@ bool csEvtHandler::EditProperties() if (dialog->ShowModal() == wxID_CANCEL) { dialog->Destroy(); - return FALSE; + return false; } wxString newLabel = dialog->GetGeneralPropertiesDialog()->GetShapeLabel(); @@ -699,7 +699,7 @@ bool csEvtHandler::EditProperties() view->GetDocument()->GetCommandProcessor()->Submit(new csDiagramCommand(_T("Edit properties"), (csDiagramDocument*) view->GetDocument(), new csCommandState(ID_CS_EDIT_PROPERTIES, newShape, shape))); - return TRUE; + return true; } /* @@ -711,7 +711,7 @@ bool csDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) wxDiagram::OnShapeSave(db, shape, expr); csEvtHandler *handler = (csEvtHandler *)shape.GetEventHandler(); expr.AddAttributeValueString(_T("label"), handler->m_label); - return TRUE; + return true; } bool csDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr) @@ -722,7 +722,7 @@ bool csDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr) csEvtHandler *handler = new csEvtHandler(&shape, &shape, label); shape.SetEventHandler(handler); - return TRUE; + return true; } IMPLEMENT_DYNAMIC_CLASS(csThinRectangleShape, wxDrawnShape) @@ -741,7 +741,7 @@ csThinRectangleShape::csThinRectangleShape() SetAttachmentMode(ATTACHMENT_MODE_BRANCHING); SetBranchStyle(BRANCHING_ATTACHMENT_NORMAL|BRANCHING_ATTACHMENT_BLOB); - SetCentreResize(FALSE); + SetCentreResize(false); } IMPLEMENT_DYNAMIC_CLASS(csWideRectangleShape, wxDrawnShape) @@ -760,7 +760,7 @@ csWideRectangleShape::csWideRectangleShape() SetAttachmentMode(ATTACHMENT_MODE_BRANCHING); SetBranchStyle(BRANCHING_ATTACHMENT_NORMAL|BRANCHING_ATTACHMENT_BLOB); - SetCentreResize(FALSE); + SetCentreResize(false); } IMPLEMENT_DYNAMIC_CLASS(csTriangleShape, wxDrawnShape) @@ -814,7 +814,7 @@ csTriangleShape::csTriangleShape() SetAttachmentMode(ATTACHMENT_MODE_BRANCHING); SetBranchStyle(BRANCHING_ATTACHMENT_NORMAL|BRANCHING_ATTACHMENT_BLOB); - SetCentreResize(FALSE); + SetCentreResize(false); } IMPLEMENT_DYNAMIC_CLASS(csSemiCircleShape, wxDrawnShape) @@ -911,7 +911,7 @@ csSemiCircleShape::csSemiCircleShape() SetAttachmentMode(ATTACHMENT_MODE_BRANCHING); SetBranchStyle(BRANCHING_ATTACHMENT_NORMAL|BRANCHING_ATTACHMENT_BLOB); - SetCentreResize(FALSE); + SetCentreResize(false); } IMPLEMENT_DYNAMIC_CLASS(csCircleShape, wxCircleShape) @@ -926,7 +926,7 @@ csCircleShape::csCircleShape() SetAttachmentMode(ATTACHMENT_MODE_BRANCHING); SetBranchStyle(BRANCHING_ATTACHMENT_NORMAL|BRANCHING_ATTACHMENT_BLOB); - SetCentreResize(FALSE); + SetCentreResize(false); } IMPLEMENT_DYNAMIC_CLASS(csCircleShadowShape, wxCircleShape) @@ -941,7 +941,7 @@ csCircleShadowShape::csCircleShadowShape() SetAttachmentMode(ATTACHMENT_MODE_BRANCHING); SetBranchStyle(BRANCHING_ATTACHMENT_NORMAL|BRANCHING_ATTACHMENT_BLOB); - SetCentreResize(FALSE); + SetCentreResize(false); SetShadowMode(SHADOW_RIGHT); } @@ -971,7 +971,7 @@ csOctagonShape::csOctagonShape() SetAttachmentMode(ATTACHMENT_MODE_BRANCHING); SetBranchStyle(BRANCHING_ATTACHMENT_NORMAL|BRANCHING_ATTACHMENT_BLOB); - SetCentreResize(FALSE); + SetCentreResize(false); } // This is a transparent shape for drawing around other shapes. @@ -983,7 +983,7 @@ csGroupShape::csGroupShape() SetBrush(wxTRANSPARENT_BRUSH); SetSize(csSTANDARD_SHAPE_WIDTH, csSTANDARD_SHAPE_WIDTH); - SetCentreResize(FALSE); + SetCentreResize(false); } void csGroupShape::OnDraw(wxDC& dc) @@ -1013,20 +1013,20 @@ bool csGroupShape::HitTest(double x, double y, int* attachment, double* distance if (x >= x1 && x <= x2) { if ((y >= y1 - edgeTolerance) && (y <= y1 + edgeTolerance)) - return TRUE; + return true; if ((y <= y2 + edgeTolerance) && (y >= y2 - edgeTolerance)) - return TRUE; + return true; } // Left/right edges if (y >= y1 && y <= y2) { if ((x >= x1 - edgeTolerance) && (x <= x1 + edgeTolerance)) - return TRUE; + return true; if ((x <= x2 + edgeTolerance) && (x >= x2 - edgeTolerance)) - return TRUE; + return true; } - return FALSE; + return false; } IMPLEMENT_DYNAMIC_CLASS(csTextBoxShape, wxRectangleShape) @@ -1040,7 +1040,7 @@ csTextBoxShape::csTextBoxShape() SetAttachmentMode(ATTACHMENT_MODE_NONE); SetBranchStyle(BRANCHING_ATTACHMENT_NORMAL|BRANCHING_ATTACHMENT_BLOB); - SetCentreResize(FALSE); + SetCentreResize(false); } IMPLEMENT_DYNAMIC_CLASS(csLineShape, wxLineShape) @@ -1066,7 +1066,7 @@ bool csLineShape::OnMoveMiddleControlPoint(wxDC& WXUNUSED(dc), wxLineControlPoin view->GetDocument()->GetCommandProcessor()->Submit(new csDiagramCommand(_T("Move line point"), (csDiagramDocument*) view->GetDocument(), new csCommandState(ID_CS_MOVE_LINE_POINT, newShape, this))); - return TRUE; + return true; } wxLabelShape* csLineShape::OnCreateLabelShape(wxLineShape *parent, wxShapeRegion *region, double w, double h) @@ -1085,7 +1085,7 @@ bool csLineShape::OnLabelMovePre(wxDC& dc, wxLabelShape* labelShape, double x, d view->GetDocument()->GetCommandProcessor()->Submit(new csDiagramCommand("Move label", (csDiagramDocument*) view->GetDocument(), new csCommandState(ID_CS_MOVE_LABEL, newShape, this))); - return TRUE; + return true; } #endif diff --git a/contrib/samples/ogl/studio/shapes.h b/contrib/samples/ogl/studio/shapes.h index 26ca01fbe7..2e959dff4d 100644 --- a/contrib/samples/ogl/studio/shapes.h +++ b/contrib/samples/ogl/studio/shapes.h @@ -73,8 +73,8 @@ public: // Overridables // Start/end copying - virtual bool OnStartCopy(wxDiagram* WXUNUSED(diagramTo)) { return TRUE; }; - virtual bool OnEndCopy(wxDiagram* WXUNUSED(diagramTo)) { return TRUE; }; + virtual bool OnStartCopy(wxDiagram* WXUNUSED(diagramTo)) { return true; }; + virtual bool OnEndCopy(wxDiagram* WXUNUSED(diagramTo)) { return true; }; // Override this to e.g. have the shape added through a Do/Undo command system. // By default, we'll just add it directly to the destination diagram, and diff --git a/contrib/samples/ogl/studio/studio.cpp b/contrib/samples/ogl/studio/studio.cpp index b1f6d8b12a..6eacff447e 100644 --- a/contrib/samples/ogl/studio/studio.cpp +++ b/contrib/samples/ogl/studio/studio.cpp @@ -95,10 +95,16 @@ bool csApp::OnInit(void) if (!wxResourceParseFile(_T("studio_resources.wxr"))) { wxMessageBox(_T("Could not find or parse resource file: studio_resources.wxr"), _T("Studio")); - return FALSE; + return false; } - m_helpController.Initialize(_T("studio.hlp")); +#if wxUSE_MS_HTML_HELP && !defined(__WXUNIVERSAL__) + m_helpController = new wxWinHelpController; +#else + m_helpController = new wxHtmlHelpController; +#endif + + m_helpController->Initialize(_T("studio.hlp")); ReadOptions(); @@ -121,7 +127,7 @@ bool csApp::OnInit(void) #define wxDEFAULT_FRAME_STYLE_NO_CLIP \ (wxDEFAULT_FRAME_STYLE & ~wxCLIP_CHILDREN) - csFrame* frame = new csFrame(m_docManager, NULL, -1, _T("OGL Studio"), m_mainFramePos, m_mainFrameSize, + csFrame* frame = new csFrame(m_docManager, NULL, wxID_ANY, _T("OGL Studio"), m_mainFramePos, m_mainFrameSize, wxDEFAULT_FRAME_STYLE_NO_CLIP | wxHSCROLL | wxVSCROLL); // Give it an icon @@ -184,11 +190,11 @@ bool csApp::OnInit(void) m_shapeEditMenu->AppendSeparator(); m_shapeEditMenu->Append(ID_CS_CUT, _T("Cut")); - frame->Show(TRUE); + frame->Show(true); SetTopWindow(frame); - return TRUE; + return true; } int csApp::OnExit(void) @@ -204,6 +210,9 @@ int csApp::OnExit(void) delete m_shapeEditMenu; m_shapeEditMenu = NULL; + delete m_helpController; + m_helpController = NULL; + wxOGLCleanUp(); return 0; @@ -217,7 +226,7 @@ int csApp::OnExit(void) wxMDIChildFrame *csApp::CreateChildFrame(wxDocument *doc, wxView *view, wxMenu** editMenuRet) { //// Make a child frame - csMDIChildFrame *subframe = new csMDIChildFrame(doc, view, ((wxDocMDIParentFrame*)GetTopWindow()), -1, _T("Child Frame"), + csMDIChildFrame *subframe = new csMDIChildFrame(doc, view, ((wxDocMDIParentFrame*)GetTopWindow()), wxID_ANY, _T("Child Frame"), wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE); #ifdef __WXMSW__ @@ -336,28 +345,28 @@ void csApp::InitToolBar(wxToolBar* toolBar) #error "Not implemented for this platform." #endif - toolBar->AddTool(wxID_NEW, *bitmaps[0], wxNullBitmap, FALSE, -1, -1, NULL, _T("New file")); - toolBar->AddTool(wxID_OPEN, *bitmaps[1], wxNullBitmap, FALSE, -1, -1, NULL, _T("Open file")); - toolBar->AddTool(wxID_SAVE, *bitmaps[2], wxNullBitmap, FALSE, -1, -1, NULL, _T("Save file")); + toolBar->AddTool(wxID_NEW, *bitmaps[0], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("New file")); + toolBar->AddTool(wxID_OPEN, *bitmaps[1], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Open file")); + toolBar->AddTool(wxID_SAVE, *bitmaps[2], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Save file")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_PRINT, *bitmaps[6], wxNullBitmap, FALSE, -1, -1, NULL, _T("Print")); + toolBar->AddTool(wxID_PRINT, *bitmaps[6], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Print")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_COPY, *bitmaps[3], wxNullBitmap, FALSE, -1, -1, NULL, _T("Copy")); - toolBar->AddTool(wxID_CUT, *bitmaps[4], wxNullBitmap, FALSE, -1, -1, NULL, _T("Cut")); - toolBar->AddTool(wxID_PASTE, *bitmaps[5], wxNullBitmap, FALSE, -1, -1, NULL, _T("Paste")); + toolBar->AddTool(wxID_COPY, *bitmaps[3], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Copy")); + toolBar->AddTool(wxID_CUT, *bitmaps[4], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Cut")); + toolBar->AddTool(wxID_PASTE, *bitmaps[5], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Paste")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_UNDO, *bitmaps[8], wxNullBitmap, FALSE, -1, -1, NULL, _T("Undo")); - toolBar->AddTool(wxID_REDO, *bitmaps[9], wxNullBitmap, FALSE, -1, -1, NULL, _T("Redo")); + toolBar->AddTool(wxID_UNDO, *bitmaps[8], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Undo")); + toolBar->AddTool(wxID_REDO, *bitmaps[9], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Redo")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_HELP, *bitmaps[7], wxNullBitmap, FALSE, -1, -1, NULL, _T("Help")); + toolBar->AddTool(wxID_HELP, *bitmaps[7], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Help")); toolBar->Realize(); - toolBar->EnableTool(wxID_COPY, FALSE); - toolBar->EnableTool(wxID_PASTE, FALSE); - toolBar->EnableTool(wxID_PRINT, FALSE); - toolBar->EnableTool(wxID_UNDO, FALSE); - toolBar->EnableTool(wxID_REDO, FALSE); + toolBar->EnableTool(wxID_COPY, false); + toolBar->EnableTool(wxID_PASTE, false); + toolBar->EnableTool(wxID_PRINT, false); + toolBar->EnableTool(wxID_UNDO, false); + toolBar->EnableTool(wxID_REDO, false); int i; for (i = 0; i < 10; i++) @@ -375,10 +384,10 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) win->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); m_diagramToolBarSashWindow = win; - m_diagramToolBarSashWindow->Show(FALSE); + m_diagramToolBarSashWindow->Show(false); // Create the actual toolbar - m_diagramToolBar = new wxToolBar(win, -1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxNO_BORDER|wxTB_FLAT); + m_diagramToolBar = new wxToolBar(win, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxNO_BORDER|wxTB_FLAT); wxBitmap* bitmaps[11]; @@ -410,18 +419,18 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) #error "Not implemented for this platform." #endif - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNL, *bitmaps[0], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align left")); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNR, *bitmaps[1], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align right")); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNT, *bitmaps[2], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align top")); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNB, *bitmaps[3], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align bottom")); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGN_HORIZ, *bitmaps[4], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align horizontally")); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGN_VERT, *bitmaps[5], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align vertically")); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_COPY_SIZE, *bitmaps[6], wxNullBitmap, FALSE, -1, -1, NULL, _T("Copy size")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNL, *bitmaps[0], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Align left")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNR, *bitmaps[1], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Align right")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNT, *bitmaps[2], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Align top")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNB, *bitmaps[3], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Align bottom")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGN_HORIZ, *bitmaps[4], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Align horizontally")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGN_VERT, *bitmaps[5], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Align vertically")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_COPY_SIZE, *bitmaps[6], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Copy size")); m_diagramToolBar->AddSeparator(); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_LINE_ARROW, *bitmaps[7], wxNullBitmap, TRUE, -1, -1, NULL, _T("Toggle arrow")); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_NEW_POINT, *bitmaps[8], wxNullBitmap, FALSE, -1, -1, NULL, _T("New line point")); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_CUT_POINT, *bitmaps[9], wxNullBitmap, FALSE, -1, -1, NULL, _T("Cut line point")); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_STRAIGHTEN, *bitmaps[10], wxNullBitmap, FALSE, -1, -1, NULL, _T("Straighten lines")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_LINE_ARROW, *bitmaps[7], wxNullBitmap, true, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Toggle arrow")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_NEW_POINT, *bitmaps[8], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("New line point")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_CUT_POINT, *bitmaps[9], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Cut line point")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_STRAIGHTEN, *bitmaps[10], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, NULL, _T("Straighten lines")); m_diagramToolBar->Realize(); @@ -500,7 +509,7 @@ bool csApp::ReadOptions() config.Read(_T("gridStyle"), & m_gridStyle); config.Read(_T("gridSpacing"), & m_gridSpacing); - return TRUE; + return true; } bool csApp::WriteOptions() @@ -516,6 +525,6 @@ bool csApp::WriteOptions() m_docManager->FileHistorySave(config); - return TRUE; + return true; } diff --git a/contrib/samples/ogl/studio/studio.h b/contrib/samples/ogl/studio/studio.h index b739730356..7d36cf0a4f 100644 --- a/contrib/samples/ogl/studio/studio.h +++ b/contrib/samples/ogl/studio/studio.h @@ -14,6 +14,13 @@ #include #include +#include +#include +#ifdef __WXMSW__ + #include +#else + #include +#endif #include #include @@ -81,7 +88,7 @@ public: wxMenu* GetShapeEditMenu() const { return m_shapeEditMenu; } wxDiagramClipboard& GetDiagramClipboard() const { return (wxDiagramClipboard&) m_diagramClipboard; } wxDocManager* GetDocManager() const { return m_docManager; } - wxHelpController& GetHelpController() const { return (wxHelpController&) m_helpController; } + wxHelpControllerBase* GetHelpController() const { return m_helpController; } int GetGridStyle() const { return m_gridStyle; } void SetGridStyle(int style) { m_gridStyle = style; } @@ -112,7 +119,7 @@ protected: csDiagramClipboard m_diagramClipboard; // Help instance - wxHelpController m_helpController; + wxHelpControllerBase* m_helpController; }; DECLARE_APP(csApp) diff --git a/contrib/samples/ogl/studio/symbols.cpp b/contrib/samples/ogl/studio/symbols.cpp index 362b0799ea..a58d34056a 100644 --- a/contrib/samples/ogl/studio/symbols.cpp +++ b/contrib/samples/ogl/studio/symbols.cpp @@ -212,7 +212,7 @@ wxBitmap* csSymbolDatabase::CreateToolBitmap(csSymbol* symbol, const wxSize& too memDC.SetBackground(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE), wxSOLID)); memDC.Clear(); - symbol->GetShape()->Show(TRUE); + symbol->GetShape()->Show(true); symbol->GetShape()->Move(memDC, centreX, centreY); memDC.SelectObject(wxNullBitmap); diff --git a/contrib/samples/ogl/studio/view.cpp b/contrib/samples/ogl/studio/view.cpp index 4b894fd48f..fff71b629b 100644 --- a/contrib/samples/ogl/studio/view.cpp +++ b/contrib/samples/ogl/studio/view.cpp @@ -95,7 +95,7 @@ bool csDiagramView::OnCreate(wxDocument *doc, long WXUNUSED(flags)) canvas->SetView(this); SetFrame(frame); - Activate(TRUE); + Activate(true); // Initialize the edit menu Undo and Redo items doc->GetCommandProcessor()->SetEditMenu(editMenu); @@ -112,12 +112,12 @@ bool csDiagramView::OnCreate(wxDocument *doc, long WXUNUSED(flags)) { case csGRID_STYLE_NONE: { - diagramDoc->GetDiagram()->SetSnapToGrid(FALSE); + diagramDoc->GetDiagram()->SetSnapToGrid(false); break; } case csGRID_STYLE_INVISIBLE: { - diagramDoc->GetDiagram()->SetSnapToGrid(TRUE); + diagramDoc->GetDiagram()->SetSnapToGrid(true); break; } case csGRID_STYLE_DOTTED: @@ -128,7 +128,7 @@ bool csDiagramView::OnCreate(wxDocument *doc, long WXUNUSED(flags)) } - return TRUE; + return true; } csDiagramView::~csDiagramView(void) @@ -155,7 +155,7 @@ void csDiagramView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint)) bool csDiagramView::OnClose(bool deleteWindow) { if (!GetDocument()->Close()) - return FALSE; + return false; csDiagramDocument *diagramDoc = (csDiagramDocument *)GetDocument(); diagramDoc->GetDiagram()->SetCanvas(NULL); @@ -170,15 +170,15 @@ bool csDiagramView::OnClose(bool deleteWindow) // Remove file menu from those managed by the command history wxGetApp().GetDocManager()->FileHistoryRemoveMenu(fileMenu); - Activate(FALSE); - frame->Show(FALSE); + Activate(false); + frame->Show(false); if (deleteWindow) { frame->Destroy(); } - return TRUE; + return true; } // Adds or removes shape from m_selections @@ -192,7 +192,7 @@ void csDiagramView::SelectShape(wxShape* shape, bool select) void csDiagramView::OnSelectAll(wxCommandEvent& WXUNUSED(event)) { - SelectAll(TRUE); + SelectAll(true); } wxShape *csDiagramView::FindFirstSelectedShape(void) @@ -389,7 +389,7 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event)) if (selections.GetCount() > 0) { wxColourData data; - data.SetChooseFull(TRUE); + data.SetChooseFull(true); if (selections.GetCount() == 1) { wxShape* firstShape = (wxShape*) selections.GetFirst()->GetData(); @@ -404,7 +404,7 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event)) wxColour col = retData.GetColour(); theBrush = wxTheBrushList->FindOrCreateBrush(col, wxSOLID); } - dialog->Close(TRUE); + dialog->Close(true); if (!theBrush) return; @@ -535,8 +535,8 @@ void csDiagramView::SelectAll(bool select) while (node) { wxShape *theShape = (wxShape*) node->GetData(); - theShape->Select(FALSE, &dc); - SelectShape(theShape, FALSE); + theShape->Select(false, &dc); + SelectShape(theShape, false); node = node->GetNext(); } @@ -552,8 +552,8 @@ void csDiagramView::SelectAll(bool select) !eachShape->IsKindOf(CLASSINFO(wxControlPoint)) && !eachShape->IsKindOf(CLASSINFO(wxLabelShape))) { - eachShape->Select(TRUE, &dc); - SelectShape(eachShape, TRUE); + eachShape->Select(true, &dc); + SelectShape(eachShape, true); } node = node->GetNext(); } @@ -633,13 +633,13 @@ void csDiagramView::ReflectPointSize(int pointSize) // Make the arrow toggle button reflect the state of the line void csDiagramView::ReflectArrowState(wxLineShape* lineShape) { - bool haveArrow = FALSE; + bool haveArrow = false; wxNode *node = lineShape->GetArrows().GetFirst(); while (node) { wxArrowHead *arrow = (wxArrowHead *)node->GetData(); if (ARROW_POSITION_MIDDLE == arrow->GetArrowEnd()) - haveArrow = TRUE; + haveArrow = true; node = node->GetNext(); } @@ -868,7 +868,7 @@ void csCanvas::OnLeftClick(double x, double y, int WXUNUSED(keys)) if (palette->GetSelection() == PALETTE_ARROW) { - GetView()->SelectAll(FALSE); + GetView()->SelectAll(false); wxClientDC dc(this); PrepareDC(dc); @@ -1010,8 +1010,8 @@ void csCanvas::OnEndDragLeft(double x, double y, int WXUNUSED(keys)) if (image_x >= min_x && image_x <= max_x && image_y >= min_y && image_y <= max_y) { - shape->Select(TRUE, &dc); - GetView()->SelectShape(shape, TRUE); + shape->Select(true, &dc); + GetView()->SelectShape(shape, true); } } node = node->GetNext(); diff --git a/contrib/samples/ogl/studio/view.h b/contrib/samples/ogl/studio/view.h index 9b15ec4345..f7fc263d71 100644 --- a/contrib/samples/ogl/studio/view.h +++ b/contrib/samples/ogl/studio/view.h @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _STUDIO_VIEW_H_ @@ -25,7 +25,7 @@ class csCanvas: public wxShapeCanvas DECLARE_CLASS(csCanvas) public: - csCanvas(csDiagramView *view, wxWindow *parent = NULL, wxWindowID id = -1, + csCanvas(csDiagramView *view, wxWindow *parent = NULL, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxRETAINED); ~csCanvas(void); @@ -65,7 +65,7 @@ class csDiagramView: public wxView bool OnCreate(wxDocument *doc, long flags); void OnDraw(wxDC *dc); void OnUpdate(wxView *sender, wxObject *hint = NULL); - bool OnClose(bool deleteWindow = TRUE); + bool OnClose(bool deleteWindow = true); void OnSelectAll(wxCommandEvent& event); wxShape *FindFirstSelectedShape(void); @@ -95,7 +95,7 @@ class csDiagramView: public wxView void DoCmd(wxList& shapes, wxList& oldShapes, int cmd, const wxString& op); // Select or deselect all - void SelectAll(bool select = TRUE); + void SelectAll(bool select = true); // Event handlers void OnCut(wxCommandEvent& event); diff --git a/contrib/src/ogl/basic.cpp b/contrib/src/ogl/basic.cpp index 9c403af840..02bf4c429b 100644 --- a/contrib/src/ogl/basic.cpp +++ b/contrib/src/ogl/basic.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -137,7 +137,7 @@ bool wxShapeEvtHandler::OnMovePre(wxDC& dc, double x, double y, double old_x, do if (m_previousHandler) return m_previousHandler->OnMovePre(dc, x, y, old_x, old_y, display); else - return TRUE; + return true; } void wxShapeEvtHandler::OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display) @@ -270,7 +270,7 @@ wxShape::wxShape(wxShapeCanvas *can) m_eventHandler = this; SetShape(this); m_id = 0; - m_formatted = FALSE; + m_formatted = false; m_canvas = can; m_xpos = 0.0; m_ypos = 0.0; m_pen = g_oglBlackPen; @@ -278,16 +278,16 @@ wxShape::wxShape(wxShapeCanvas *can) m_font = g_oglNormalFont; m_textColour = wxT("BLACK"); m_textColourName = wxT("BLACK"); - m_visible = FALSE; - m_selected = FALSE; + m_visible = false; + m_selected = false; m_attachmentMode = ATTACHMENT_MODE_NONE; - m_spaceAttachments = TRUE; - m_disableLabel = FALSE; - m_fixedWidth = FALSE; - m_fixedHeight = FALSE; - m_drawHandles = TRUE; + m_spaceAttachments = true; + m_disableLabel = false; + m_fixedWidth = false; + m_fixedHeight = false; + m_drawHandles = true; m_sensitivity = OP_ALL; - m_draggable = TRUE; + m_draggable = true; m_parent = NULL; m_formatMode = FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT; m_shadowMode = SHADOW_NONE; @@ -297,9 +297,9 @@ wxShape::wxShape(wxShapeCanvas *can) m_textMarginX = 5; m_textMarginY = 5; m_regionName = wxT("0"); - m_centreResize = TRUE; - m_maintainAspectRatio = FALSE; - m_highlighted = FALSE; + m_centreResize = true; + m_maintainAspectRatio = false; + m_highlighted = false; m_rotation = 0.0; m_branchNeckLength = 10; m_branchStemLength = 10; @@ -349,9 +349,9 @@ void wxShape::SetHighlight(bool hi, bool recurse) void wxShape::SetSensitivityFilter(int sens, bool recursive) { if (sens & OP_DRAG_LEFT) - m_draggable = TRUE; + m_draggable = true; else - m_draggable = FALSE; + m_draggable = false; m_sensitivity = sens; if (recursive) @@ -360,7 +360,7 @@ void wxShape::SetSensitivityFilter(int sens, bool recursive) while (node) { wxShape *obj = (wxShape *)node->GetData(); - obj->SetSensitivityFilter(sens, TRUE); + obj->SetSensitivityFilter(sens, true); node = node->GetNext(); } } @@ -381,7 +381,7 @@ void wxShape::SetDraggable(bool drag, bool recursive) while (node) { wxShape *obj = (wxShape *)node->GetData(); - obj->SetDraggable(drag, TRUE); + obj->SetDraggable(drag, true); node = node->GetNext(); } } @@ -463,7 +463,7 @@ void wxShape::InsertInCanvas(wxShapeCanvas *theCanvas) void wxShape::RemoveFromCanvas(wxShapeCanvas *theCanvas) { if (Selected()) - Select(FALSE); + Select(false); theCanvas->RemoveShape(this); wxNode *node = m_children.GetFirst(); while (node) @@ -491,9 +491,9 @@ void wxShape::ClearText(int regionId) { if (regionId == 0) { - m_text.DeleteContents(TRUE); + m_text.DeleteContents(true); m_text.Clear(); - m_text.DeleteContents(FALSE); + m_text.DeleteContents(false); } wxNode *node = m_regions.Item(regionId); if (!node) @@ -533,7 +533,7 @@ void wxShape::SetDefaultRegionSize() bool wxShape::HitTest(double x, double y, int *attachment, double *distance) { // if (!sensitive) -// return FALSE; +// return false; double width = 0.0, height = 0.0; GetBoundingBoxMin(&width, &height); @@ -577,15 +577,15 @@ bool wxShape::HitTest(double x, double y, int *attachment, double *distance) } *attachment = nearest_attachment; *distance = nearest; - return TRUE; + return true; } - else return FALSE; + else return false; } // Format a text string according to the region size, adding // strings with positions to region text list -static bool GraphicsInSizeToContents = FALSE; // Infinite recursion elimination +static bool GraphicsInSizeToContents = false; // Infinite recursion elimination void wxShape::FormatText(wxDC& dc, const wxString& s, int i) { double w, h; @@ -632,7 +632,7 @@ void wxShape::FormatText(wxDC& dc, const wxString& s, int i) if (topAncestor != this) { // Make sure we don't recurse infinitely - GraphicsInSizeToContents = TRUE; + GraphicsInSizeToContents = true; wxCompositeShape *composite = (wxCompositeShape *)topAncestor; composite->Erase(dc); @@ -648,7 +648,7 @@ void wxShape::FormatText(wxDC& dc, const wxString& s, int i) // Where infinite recursion might happen if we didn't stop it composite->Draw(dc); - GraphicsInSizeToContents = FALSE; + GraphicsInSizeToContents = false; } else { @@ -662,7 +662,7 @@ void wxShape::FormatText(wxDC& dc, const wxString& s, int i) } } oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, actualW-2*m_textMarginX, actualH-2*m_textMarginY, region->GetFormatMode()); - m_formatted = TRUE; + m_formatted = true; } void wxShape::Recentre(wxDC& dc) @@ -686,7 +686,7 @@ bool wxShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1), double WXUNUSED(x2), double WXUNUSED(y2), double *WXUNUSED(x3), double *WXUNUSED(y3)) { - return FALSE; + return false; } void wxShape::SetPen(wxPen *the_pen) @@ -924,7 +924,7 @@ void wxShape::OnDrawContents(wxDC& dc) if (!m_formatted) { oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, bound_x-2*m_textMarginX, bound_y-2*m_textMarginY, region->GetFormatMode()); - m_formatted = TRUE; + m_formatted = true; } if (!GetDisableLabel()) { @@ -943,7 +943,7 @@ void wxShape::OnSize(double WXUNUSED(x), double WXUNUSED(y)) bool wxShape::OnMovePre(wxDC& WXUNUSED(dc), double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(old_x), double WXUNUSED(old_y), bool WXUNUSED(display)) { - return TRUE; + return true; } void wxShape::OnMovePost(wxDC& WXUNUSED(dc), double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(old_x), double WXUNUSED(old_y), bool WXUNUSED(display)) @@ -1043,7 +1043,7 @@ void wxShape::DrawLinks(wxDC& dc, int attachment, bool recurse) } } -// Returns TRUE if pt1 <= pt2 in the sense that one point comes before another on an +// Returns true if pt1 <= pt2 in the sense that one point comes before another on an // edge of the shape. // attachmentPoint is the attachment point (= side) in question. @@ -1065,14 +1065,14 @@ bool wxShape::AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, co } } - return FALSE; + return false; } bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move, double x, double y) { if (GetAttachmentMode() == ATTACHMENT_MODE_NONE) - return FALSE; + return false; int newAttachment, oldAttachment; double distance; @@ -1081,7 +1081,7 @@ bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move, // the user has moved the point to bool hit = HitTest(x, y, &newAttachment, &distance); if (!hit) - return FALSE; + return false; EraseLinks(dc); @@ -1109,7 +1109,7 @@ bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move, double old_y = (double) -99999.9; node = newOrdering.GetFirst(); - bool found = FALSE; + bool found = false; while (!found && node) { @@ -1136,7 +1136,7 @@ bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move, if (AttachmentSortTest(newAttachment, newPoint, thisPoint) && AttachmentSortTest(newAttachment, lastPoint, newPoint)) { - found = TRUE; + found = true; newOrdering.Insert(node, to_move); } @@ -1151,7 +1151,7 @@ bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move, GetEventHandler()->OnChangeAttachment(newAttachment, to_move, newOrdering); - return TRUE; + return true; } void wxShape::OnChangeAttachment(int attachment, wxLineShape* line, wxList& ordering) @@ -1547,7 +1547,7 @@ void wxShape::Erase(wxDC& dc) { GetEventHandler()->OnErase(dc); GetEventHandler()->OnEraseControlPoints(dc); - GetEventHandler()->OnDrawBranches(dc, TRUE); + GetEventHandler()->OnDrawBranches(dc, true); } void wxShape::EraseContents(wxDC& dc) @@ -1566,7 +1566,7 @@ void wxShape::AddText(const wxString& string) new wxShapeTextLine(0.0, 0.0, string); region->GetFormattedText().Append(new_line); - m_formatted = FALSE; + m_formatted = false; } void wxShape::SetSize(double x, double y, bool WXUNUSED(recursive)) @@ -1759,10 +1759,10 @@ void wxShape::WriteAttributes(wxExpr *clause) clause->AddAttributeValue(_T("fixed_height"), (long)m_fixedHeight); if (m_shadowMode != SHADOW_NONE) clause->AddAttributeValue(_T("shadow_mode"), (long)m_shadowMode); - if (m_centreResize != TRUE) + if (m_centreResize != true) clause->AddAttributeValue(_T("centre_resize"), (long)0); clause->AddAttributeValue(_T("maintain_aspect_ratio"), (long) m_maintainAspectRatio); - if (m_highlighted != FALSE) + if (m_highlighted != false) clause->AddAttributeValue(_T("hilite"), (long)m_highlighted); if (m_parent) // For composite objects @@ -1882,7 +1882,7 @@ void wxShape::ReadAttributes(wxExpr *clause) wxExpr *strings = clause->AttributeValue(_T("text")); if (strings && strings->Type() == wxExprList) { - m_formatted = TRUE; // Assume text is formatted unless we prove otherwise + m_formatted = true; // Assume text is formatted unless we prove otherwise wxExpr *node = strings->value.first; while (node) { @@ -1896,7 +1896,7 @@ void wxShape::ReadAttributes(wxExpr *clause) if (string_expr->Type() == wxExprString) { the_string = string_expr->StringValue(); - m_formatted = FALSE; + m_formatted = false; } else if (string_expr->Type() == wxExprList) { @@ -2068,7 +2068,7 @@ void wxShape::ReadRegions(wxExpr *clause) wxSprintf(regionNameBuf, _T("region%d"), regionNo); wxSprintf(textNameBuf, _T("text%d"), regionNo); - m_formatted = TRUE; // Assume text is formatted unless we prove otherwise + m_formatted = true; // Assume text is formatted unless we prove otherwise while ((regionExpr = clause->AttributeValue(regionNameBuf)) != NULL) { @@ -2189,7 +2189,7 @@ void wxShape::ReadRegions(wxExpr *clause) if (string_expr->Type() == wxExprString) { the_string = string_expr->StringValue(); - m_formatted = FALSE; + m_formatted = false; } else if (string_expr->Type() == wxExprList) { @@ -2620,9 +2620,9 @@ bool wxShape::Selected() const bool wxShape::AncestorSelected() const { - if (m_selected) return TRUE; + if (m_selected) return true; if (!GetParent()) - return FALSE; + return false; else return GetParent()->AncestorSelected(); } @@ -2661,10 +2661,10 @@ bool wxShape::AttachmentIsValid(int attachment) const { wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); if (point->m_id == attachment) - return TRUE; + return true; node = node->GetNext(); } - return FALSE; + return false; } bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y, @@ -2673,7 +2673,7 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y, if (m_attachmentMode == ATTACHMENT_MODE_NONE) { *x = m_xpos; *y = m_ypos; - return TRUE; + return true; } else if (m_attachmentMode == ATTACHMENT_MODE_BRANCHING) { @@ -2681,7 +2681,7 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y, GetBranchingAttachmentPoint(attachment, nth, pt, stemPt); *x = pt.x; *y = pt.y; - return TRUE; + return true; } else if (m_attachmentMode == ATTACHMENT_MODE_EDGE) { @@ -2695,12 +2695,12 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y, { *x = (double)(m_xpos + point->m_x); *y = (double)(m_ypos + point->m_y); - return TRUE; + return true; } node = node->GetNext(); } *x = m_xpos; *y = m_ypos; - return FALSE; + return false; } else { @@ -2753,13 +2753,13 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y, } default: { - return FALSE; + return false; } } - return TRUE; + return true; } } - return FALSE; + return false; } void wxShape::GetBoundingBoxMax(double *w, double *h) @@ -2775,21 +2775,21 @@ void wxShape::GetBoundingBoxMax(double *w, double *h) *h = hh; } -// Returns TRUE if image is a descendant of this composite +// Returns true if image is a descendant of this composite bool wxShape::HasDescendant(wxShape *image) { if (image == this) - return TRUE; + return true; wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); bool ans = child->HasDescendant(image); if (ans) - return TRUE; + return true; node = node->GetNext(); } - return FALSE; + return false; } // Clears points from a list of wxRealPoints, and clears list @@ -2814,7 +2814,7 @@ wxRealPoint wxShape::CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPo bool isEnd = (line && line->IsEnd(this)); // Are we horizontal or vertical? - bool isHorizontal = (oglRoughlyEqual(pt1.y, pt2.y) == TRUE); + bool isHorizontal = (oglRoughlyEqual(pt1.y, pt2.y) == true); double x, y; @@ -2854,7 +2854,7 @@ wxRealPoint wxShape::CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPo } else { - wxASSERT( oglRoughlyEqual(pt1.x, pt2.x) == TRUE ); + wxASSERT( oglRoughlyEqual(pt1.x, pt2.x) == true ); wxRealPoint firstPoint, secondPoint; if (pt1.y > pt2.y) @@ -2911,7 +2911,7 @@ int wxShape::GetLinePosition(wxLineShape* line) // <- branching attachment point N-1 // This function gets information about where branching connections go. -// Returns FALSE if there are no lines at this attachment. +// Returns false if there are no lines at this attachment. bool wxShape::GetBranchingAttachmentInfo(int attachment, wxRealPoint& root, wxRealPoint& neck, wxRealPoint& shoulder1, wxRealPoint& shoulder2) { @@ -2921,7 +2921,7 @@ bool wxShape::GetBranchingAttachmentInfo(int attachment, wxRealPoint& root, wxRe int lineCount = GetAttachmentLineCount(attachment); if (lineCount == 0) - return FALSE; + return false; int totalBranchLength = m_branchSpacing * (lineCount - 1); @@ -2984,7 +2984,7 @@ bool wxShape::GetBranchingAttachmentInfo(int attachment, wxRealPoint& root, wxRe break; } } - return TRUE; + return true; } // n is the number of the adjoining line, from 0 to N-1 where N is the number of lines @@ -3044,7 +3044,7 @@ bool wxShape::GetBranchingAttachmentPoint(int attachment, int n, wxRealPoint& pt } } - return TRUE; + return true; } // Get the number of lines at this attachment position. diff --git a/contrib/src/ogl/basic2.cpp b/contrib/src/ogl/basic2.cpp index 7df35226c4..254d5cd2ee 100644 --- a/contrib/src/ogl/basic2.cpp +++ b/contrib/src/ogl/basic2.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -202,7 +202,7 @@ void wxPolygonShape::CalculatePolygonCentre() bool PolylineHitTest(double n, double xvec[], double yvec[], double x1, double y1, double x2, double y2) { - bool isAHit = FALSE; + bool isAHit = false; int i; double lastx = xvec[0]; double lasty = yvec[0]; @@ -216,7 +216,7 @@ bool PolylineHitTest(double n, double xvec[], double yvec[], oglCheckLineIntersection(x1, y1, x2, y2, lastx, lasty, xvec[i], yvec[i], &line_ratio, &other_ratio); if (line_ratio != 1.0) - isAHit = TRUE; + isAHit = true; lastx = xvec[i]; lasty = yvec[i]; @@ -230,7 +230,7 @@ bool PolylineHitTest(double n, double xvec[], double yvec[], oglCheckLineIntersection(x1, y1, x2, y2, lastx, lasty, xvec[0], yvec[0], &line_ratio, &other_ratio); if (line_ratio != 1.0) - isAHit = TRUE; + isAHit = true; } return isAHit; @@ -273,13 +273,13 @@ bool wxPolygonShape::HitTest(double x, double y, int *attachment, double *distan // We assume it's inside the polygon UNLESS one or more // lines don't hit the outline. - bool isContained = TRUE; + bool isContained = true; int noPoints = 4; for (i = 0; i < noPoints; i++) { if (!PolylineHitTest(np, xpoints, ypoints, x, y, endPointsX[i], endPointsY[i])) - isContained = FALSE; + isContained = false; } /* if (isContained) @@ -291,7 +291,7 @@ bool wxPolygonShape::HitTest(double x, double y, int *attachment, double *distan delete[] ypoints; if (!isContained) - return FALSE; + return false; int nearest_attachment = 0; @@ -315,7 +315,7 @@ bool wxPolygonShape::HitTest(double x, double y, int *attachment, double *distan } *attachment = nearest_attachment; *distance = nearest; - return TRUE; + return true; } // Really need to be able to reset the shape! Otherwise, if the @@ -447,13 +447,13 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1, { *x3 = point->x + m_xpos; *y3 = point->y + m_ypos; - return TRUE; + return true; } else if ((y2 < y1) && (point->y < 0.0)) { *x3 = point->x + m_xpos; *y3 = point->y + m_ypos; - return TRUE; + return true; } } node = node->GetNext(); @@ -480,7 +480,7 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1, delete[] xpoints; delete[] ypoints; - return TRUE; + return true; } void wxPolygonShape::OnDraw(wxDC& dc) @@ -784,7 +784,7 @@ bool wxPolygonShape::GetAttachmentPosition(int attachment, double *x, double *y, wxRealPoint *point = (wxRealPoint *)m_points->Item(attachment)->GetData(); *x = point->x + m_xpos; *y = point->y + m_ypos; - return TRUE; + return true; } else { return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs, line); } @@ -793,20 +793,20 @@ bool wxPolygonShape::GetAttachmentPosition(int attachment, double *x, double *y, bool wxPolygonShape::AttachmentIsValid(int attachment) const { if (!m_points) - return FALSE; + return false; if ((attachment >= 0) && (attachment < (int) m_points->GetCount())) - return TRUE; + return true; wxNode *node = m_attachmentPoints.GetFirst(); while (node) { wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); if (point->m_id == attachment) - return TRUE; + return true; node = node->GetNext(); } - return FALSE; + return false; } // Rotate about the given axis by the given amount in radians @@ -928,7 +928,7 @@ bool wxRectangleShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1 GetBoundingBoxMax(&bound_x, &bound_y); oglFindEndForBox(bound_x, bound_y, m_xpos, m_ypos, x2, y2, x3, y3); - return TRUE; + return true; } #if wxUSE_PROLOGIO @@ -1036,7 +1036,7 @@ bool wxEllipseShape::GetPerimeterPoint(double x1, double y1, // oglFindEndForBox(bound_x, bound_y, m_xpos, m_ypos, x2, y2, x3, y3); oglDrawArcToEllipse(m_xpos, m_ypos, bound_x, bound_y, x2, y2, x1, y1, x3, y3); - return TRUE; + return true; } void wxEllipseShape::OnDraw(wxDC& dc) @@ -1177,10 +1177,10 @@ bool wxEllipseShape::GetAttachmentPosition(int attachment, double *x, double *y, return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs, line); } } - return TRUE; + return true; } else - { *x = m_xpos; *y = m_ypos; return TRUE; } + { *x = m_xpos; *y = m_ypos; return true; } } @@ -1189,7 +1189,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxCircleShape, wxEllipseShape) wxCircleShape::wxCircleShape(double diameter):wxEllipseShape(diameter, diameter) { - SetMaintainAspectRatio(TRUE); + SetMaintainAspectRatio(true); } void wxCircleShape::Copy(wxShape& copy) @@ -1206,7 +1206,7 @@ bool wxCircleShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1), x2, y2, // Other end of line x3, y3); - return TRUE; + return true; } // Control points @@ -1232,8 +1232,8 @@ wxControlPoint::wxControlPoint(wxShapeCanvas *theCanvas, wxShape *object, double SetPen(g_oglBlackForegroundPen); SetBrush(wxBLACK_BRUSH); m_oldCursor = NULL; - m_visible = TRUE; - m_eraseObject = TRUE; + m_visible = true; + m_eraseObject = true; } wxControlPoint::~wxControlPoint() @@ -1282,7 +1282,7 @@ bool wxControlPoint::GetAttachmentPosition(int WXUNUSED(attachment), double *x, int WXUNUSED(nth), int WXUNUSED(no_arcs), wxLineShape *WXUNUSED(line)) { *x = m_xpos; *y = m_ypos; - return TRUE; + return true; } // Control points ('handles') redirect control to the actual shape, to make it easier @@ -1540,7 +1540,7 @@ void wxShape::OnSizingEndDragLeft(wxControlPoint* pt, double WXUNUSED(x), double this->Erase(dc); /* if (!pt->m_eraseObject) - this->Show(FALSE); + this->Show(false); */ this->SetSize(pt->sm_controlPointDragEndWidth, pt->sm_controlPointDragEndHeight); @@ -1559,12 +1559,12 @@ void wxShape::OnSizingEndDragLeft(wxControlPoint* pt, double WXUNUSED(x), double /* if (!eraseIt) - theObject->Show(TRUE); + theObject->Show(true); */ // Recursively redraw links if we have a composite. if (theObject->GetChildren().GetCount() > 0) - theObject->DrawLinks(dc, -1, TRUE); + theObject->DrawLinks(dc, -1, true); double width, height; theObject->GetBoundingBoxMax(&width, &height); diff --git a/contrib/src/ogl/bmpshape.cpp b/contrib/src/ogl/bmpshape.cpp index 0eae99ed7b..e2967d0436 100644 --- a/contrib/src/ogl/bmpshape.cpp +++ b/contrib/src/ogl/bmpshape.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ diff --git a/contrib/src/ogl/canvas.cpp b/contrib/src/ogl/canvas.cpp index 6c3bb4d561..239fcd000b 100644 --- a/contrib/src/ogl/canvas.cpp +++ b/contrib/src/ogl/canvas.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -75,7 +75,7 @@ wxShapeCanvas::wxShapeCanvas(wxWindow *parent, wxWindowID id, m_oldDragY = 0; m_firstDragX = 0; m_firstDragY = 0; - m_checkTolerance = TRUE; + m_checkTolerance = true; } wxShapeCanvas::~wxShapeCanvas() @@ -129,7 +129,7 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event) // If we've ignored the tolerance once, then ALWAYS ignore // tolerance in this drag, even if we come back within // the tolerance range. - m_checkTolerance = FALSE; + m_checkTolerance = false; } // Dragging - note that the effect of dragging is left entirely up @@ -153,16 +153,16 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event) else if (dragging && m_draggedShape && m_dragState == ContinueDraggingLeft) { // Continue dragging - m_draggedShape->GetEventHandler()->OnDragLeft(FALSE, m_oldDragX, m_oldDragY, keys, m_draggedAttachment); - m_draggedShape->GetEventHandler()->OnDragLeft(TRUE, (double)x, (double)y, keys, m_draggedAttachment); + m_draggedShape->GetEventHandler()->OnDragLeft(false, m_oldDragX, m_oldDragY, keys, m_draggedAttachment); + m_draggedShape->GetEventHandler()->OnDragLeft(true, (double)x, (double)y, keys, m_draggedAttachment); m_oldDragX = x; m_oldDragY = y; } else if (event.LeftUp() && m_draggedShape && m_dragState == ContinueDraggingLeft) { m_dragState = NoDragging; - m_checkTolerance = TRUE; + m_checkTolerance = true; - m_draggedShape->GetEventHandler()->OnDragLeft(FALSE, m_oldDragX, m_oldDragY, keys, m_draggedAttachment); + m_draggedShape->GetEventHandler()->OnDragLeft(false, m_oldDragX, m_oldDragY, keys, m_draggedAttachment); m_draggedShape->GetEventHandler()->OnEndDragLeft((double)x, (double)y, keys, m_draggedAttachment); m_draggedShape = NULL; @@ -183,16 +183,16 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event) else if (dragging && m_draggedShape && m_dragState == ContinueDraggingRight) { // Continue dragging - m_draggedShape->GetEventHandler()->OnDragRight(FALSE, m_oldDragX, m_oldDragY, keys, m_draggedAttachment); - m_draggedShape->GetEventHandler()->OnDragRight(TRUE, (double)x, (double)y, keys, m_draggedAttachment); + m_draggedShape->GetEventHandler()->OnDragRight(false, m_oldDragX, m_oldDragY, keys, m_draggedAttachment); + m_draggedShape->GetEventHandler()->OnDragRight(true, (double)x, (double)y, keys, m_draggedAttachment); m_oldDragX = x; m_oldDragY = y; } else if (event.RightUp() && m_draggedShape && m_dragState == ContinueDraggingRight) { m_dragState = NoDragging; - m_checkTolerance = TRUE; + m_checkTolerance = true; - m_draggedShape->GetEventHandler()->OnDragRight(FALSE, m_oldDragX, m_oldDragY, keys, m_draggedAttachment); + m_draggedShape->GetEventHandler()->OnDragRight(false, m_oldDragX, m_oldDragY, keys, m_draggedAttachment); m_draggedShape->GetEventHandler()->OnEndDragRight((double)x, (double)y, keys, m_draggedAttachment); m_draggedShape = NULL; @@ -208,16 +208,16 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event) else if (dragging && !m_draggedShape && m_dragState == ContinueDraggingLeft) { // Continue dragging - OnDragLeft(FALSE, m_oldDragX, m_oldDragY, keys); - OnDragLeft(TRUE, (double)x, (double)y, keys); + OnDragLeft(false, m_oldDragX, m_oldDragY, keys); + OnDragLeft(true, (double)x, (double)y, keys); m_oldDragX = x; m_oldDragY = y; } else if (event.LeftUp() && !m_draggedShape && m_dragState == ContinueDraggingLeft) { m_dragState = NoDragging; - m_checkTolerance = TRUE; + m_checkTolerance = true; - OnDragLeft(FALSE, m_oldDragX, m_oldDragY, keys); + OnDragLeft(false, m_oldDragX, m_oldDragY, keys); OnEndDragLeft((double)x, (double)y, keys); m_draggedShape = NULL; } @@ -230,16 +230,16 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event) else if (dragging && !m_draggedShape && m_dragState == ContinueDraggingRight) { // Continue dragging - OnDragRight(FALSE, m_oldDragX, m_oldDragY, keys); - OnDragRight(TRUE, (double)x, (double)y, keys); + OnDragRight(false, m_oldDragX, m_oldDragY, keys); + OnDragRight(true, (double)x, (double)y, keys); m_oldDragX = x; m_oldDragY = y; } else if (event.RightUp() && !m_draggedShape && m_dragState == ContinueDraggingRight) { m_dragState = NoDragging; - m_checkTolerance = TRUE; + m_checkTolerance = true; - OnDragRight(FALSE, m_oldDragX, m_oldDragY, keys); + OnDragRight(false, m_oldDragX, m_oldDragY, keys); OnEndDragRight((double)x, (double)y, keys); m_draggedShape = NULL; } @@ -247,7 +247,7 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event) // Non-dragging events else if (event.IsButton()) { - m_checkTolerance = TRUE; + m_checkTolerance = true; // Find the nearest object int attachment = 0; @@ -358,7 +358,7 @@ wxShape *wxShapeCanvas::FindFirstSensitiveShape1(wxShape *image, int op) return NULL; } -// Helper function: TRUE if 'contains' wholly contains 'contained'. +// Helper function: true if 'contains' wholly contains 'contained'. static bool WhollyContains(wxShape *contains, wxShape *contained) { double xp1, yp1, xp2, yp2; diff --git a/contrib/src/ogl/composit.cpp b/contrib/src/ogl/composit.cpp index 05eeefd2a3..da0e212d71 100644 --- a/contrib/src/ogl/composit.cpp +++ b/contrib/src/ogl/composit.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -65,7 +65,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxCompositeShape, wxRectangleShape) wxCompositeShape::wxCompositeShape(): wxRectangleShape(10.0, 10.0) { -// selectable = FALSE; +// selectable = false; m_oldX = m_xpos; m_oldY = m_ypos; } @@ -136,7 +136,7 @@ bool wxCompositeShape::OnMovePre(wxDC& dc, double x, double y, double oldx, doub node = node->GetNext(); } - return TRUE; + return true; } void wxCompositeShape::OnErase(wxDC& dc) @@ -278,9 +278,9 @@ void wxCompositeShape::SetSize(double w, double h, bool recursive) // Scale the position first double newX = (double)(((object->GetX() - GetX())*xScale) + GetX()); double newY = (double)(((object->GetY() - GetY())*yScale) + GetY()); - object->Show(FALSE); + object->Show(false); object->Move(dc, newX, newY); - object->Show(TRUE); + object->Show(true); // Now set the scaled size object->GetBoundingBoxMin(&xBound, &yBound); @@ -371,7 +371,7 @@ void wxCompositeShape::Copy(wxShape& copy) while (node) { wxShape *object = (wxShape *)node->GetData(); - wxShape *newObject = object->CreateNewCopy(FALSE, FALSE); + wxShape *newObject = object->CreateNewCopy(false, false); if (newObject->GetId() == 0) newObject->SetId(wxNewId()); @@ -558,7 +558,7 @@ void wxCompositeShape::CalculateSize() bool wxCompositeShape::Recompute() { int noIterations = 0; - bool changed = TRUE; + bool changed = true; while (changed && (noIterations < 500)) { changed = Constrain(); @@ -577,13 +577,13 @@ bool wxCompositeShape::Constrain() { CalculateSize(); - bool changed = FALSE; + bool changed = false; wxNode *node = m_children.GetFirst(); while (node) { wxShape *object = (wxShape *)node->GetData(); if (object->Constrain()) - changed = TRUE; + changed = true; node = node->GetNext(); } @@ -591,7 +591,7 @@ bool wxCompositeShape::Constrain() while (node) { wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData(); - if (constraint->Evaluate()) changed = TRUE; + if (constraint->Evaluate()) changed = true; node = node->GetNext(); } return changed; @@ -681,7 +681,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database) // Constraints are output as constraint1 = (...), constraint2 = (...), etc. int constraintNo = 1; wxChar m_constraintNameBuf[20]; - bool haveConstraints = TRUE; + bool haveConstraints = true; while (haveConstraints) { @@ -690,7 +690,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database) clause->GetAttributeValue(m_constraintNameBuf, &constraintExpr); if (!constraintExpr) { - haveConstraints = FALSE; + haveConstraints = false; break; } wxString cName = wxEmptyString; @@ -761,7 +761,7 @@ void wxCompositeShape::MakeContainer() division->Move(dc, GetX(), GetY()); Recompute(); - division->Show(TRUE); + division->Show(true); } wxDivisionShape *wxCompositeShape::OnCreateDivision() @@ -782,11 +782,11 @@ wxShape *wxCompositeShape::FindContainerImage() return NULL; } -// Returns TRUE if division is a descendant of this container +// Returns true if division is a descendant of this container bool wxCompositeShape::ContainsDivision(wxDivisionShape *division) { if (m_divisions.Member(division)) - return TRUE; + return true; wxNode *node = m_children.GetFirst(); while (node) { @@ -795,11 +795,11 @@ bool wxCompositeShape::ContainsDivision(wxDivisionShape *division) { bool ans = ((wxCompositeShape *)child)->ContainsDivision(division); if (ans) - return TRUE; + return true; } node = node->GetNext(); } - return FALSE; + return false; } /* @@ -812,8 +812,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxDivisionShape, wxCompositeShape) wxDivisionShape::wxDivisionShape() { SetSensitivityFilter(OP_CLICK_LEFT | OP_CLICK_RIGHT | OP_DRAG_RIGHT); - SetCentreResize(FALSE); - SetAttachmentMode(TRUE); + SetCentreResize(false); + SetAttachmentMode(true); m_leftSide = NULL; m_rightSide = NULL; m_topSide = NULL; @@ -881,7 +881,7 @@ bool wxDivisionShape::OnMovePre(wxDC& dc, double x, double y, double oldx, doubl object->Move(dc, object->GetX() + diffX, object->GetY() + diffY, display); node = node->GetNext(); } - return TRUE; + return true; } void wxDivisionShape::OnDragLeft(bool draw, double x, double y, int keys, int attachment) @@ -1026,11 +1026,11 @@ void wxDivisionShape::OnRightClick(double x, double y, int keys, int attachment) { if (Selected()) { - Select(FALSE); + Select(false); GetParent()->Draw(dc); } else - Select(TRUE); + Select(true); } } */ @@ -1058,7 +1058,7 @@ bool wxDivisionShape::Divide(int direction) double oldWidth = GetWidth(); double oldHeight = GetHeight(); if (Selected()) - Select(FALSE); + Select(false); wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); @@ -1072,7 +1072,7 @@ bool wxDivisionShape::Divide(int direction) double newXPos2 = GetX(); double newYPos2 = (double)(y1 + (3.0*GetHeight()/4.0)); wxDivisionShape *newDivision = compositeParent->OnCreateDivision(); - newDivision->Show(TRUE); + newDivision->Show(true); Erase(dc); @@ -1123,7 +1123,7 @@ bool wxDivisionShape::Divide(int direction) double newXPos2 = (double)(x1 + (3.0*GetWidth()/4.0)); double newYPos2 = GetY(); wxDivisionShape *newDivision = compositeParent->OnCreateDivision(); - newDivision->Show(TRUE); + newDivision->Show(true); Erase(dc); @@ -1162,7 +1162,7 @@ bool wxDivisionShape::Divide(int direction) compositeParent->MakeMandatoryControlPoints(); } compositeParent->Draw(dc); - return TRUE; + return true; } // Make one control point for every visible line @@ -1295,15 +1295,15 @@ void wxDivisionShape::ResetMandatoryControlPoints() } } -// Adjust a side, returning FALSE if it's not physically possible. +// Adjust a side, returning false if it's not physically possible. bool wxDivisionShape::AdjustLeft(double left, bool test) { double x2 = (double)(GetX() + (GetWidth()/2.0)); if (left >= x2) - return FALSE; + return false; if (test) - return TRUE; + return true; double newW = x2 - left; double newX = (double)(left + newW/2.0); @@ -1314,7 +1314,7 @@ bool wxDivisionShape::AdjustLeft(double left, bool test) Move(dc, newX, GetY()); - return TRUE; + return true; } bool wxDivisionShape::AdjustTop(double top, bool test) @@ -1322,9 +1322,9 @@ bool wxDivisionShape::AdjustTop(double top, bool test) double y2 = (double)(GetY() + (GetHeight()/2.0)); if (top >= y2) - return FALSE; + return false; if (test) - return TRUE; + return true; double newH = y2 - top; double newY = (double)(top + newH/2.0); @@ -1335,7 +1335,7 @@ bool wxDivisionShape::AdjustTop(double top, bool test) Move(dc, GetX(), newY); - return TRUE; + return true; } bool wxDivisionShape::AdjustRight(double right, bool test) @@ -1343,9 +1343,9 @@ bool wxDivisionShape::AdjustRight(double right, bool test) double x1 = (double)(GetX() - (GetWidth()/2.0)); if (right <= x1) - return FALSE; + return false; if (test) - return TRUE; + return true; double newW = right - x1; double newX = (double)(x1 + newW/2.0); @@ -1356,7 +1356,7 @@ bool wxDivisionShape::AdjustRight(double right, bool test) Move(dc, newX, GetY()); - return TRUE; + return true; } bool wxDivisionShape::AdjustBottom(double bottom, bool test) @@ -1364,9 +1364,9 @@ bool wxDivisionShape::AdjustBottom(double bottom, bool test) double y1 = (double)(GetY() - (GetHeight()/2.0)); if (bottom <= y1) - return FALSE; + return false; if (test) - return TRUE; + return true; double newH = bottom - y1; double newY = (double)(y1 + newH/2.0); @@ -1377,13 +1377,13 @@ bool wxDivisionShape::AdjustBottom(double bottom, bool test) Move(dc, GetX(), newY); - return TRUE; + return true; } wxDivisionControlPoint::wxDivisionControlPoint(wxShapeCanvas *the_canvas, wxShape *object, double size, double the_xoffset, double the_yoffset, int the_type): wxControlPoint(the_canvas, object, size, the_xoffset, the_yoffset, the_type) { - SetEraseObject(FALSE); + SetEraseObject(false); } wxDivisionControlPoint::~wxDivisionControlPoint() @@ -1434,51 +1434,51 @@ void wxDivisionControlPoint::OnEndDragLeft(double x, double y, int keys, int att double dx2 = (double)(division->GetX() + (division->GetWidth()/2.0)); double dy2 = (double)(division->GetY() + (division->GetHeight()/2.0)); - bool success = TRUE; + bool success = true; switch (division->GetHandleSide()) { case DIVISION_SIDE_LEFT: { if ((x <= x1) || (x >= x2) || (x >= dx2)) - success = FALSE; + success = false; // Try it out first... - else if (!division->ResizeAdjoining(DIVISION_SIDE_LEFT, x, TRUE)) - success = FALSE; + else if (!division->ResizeAdjoining(DIVISION_SIDE_LEFT, x, true)) + success = false; else - division->ResizeAdjoining(DIVISION_SIDE_LEFT, x, FALSE); + division->ResizeAdjoining(DIVISION_SIDE_LEFT, x, false); break; } case DIVISION_SIDE_TOP: { if ((y <= y1) || (y >= y2) || (y >= dy2)) - success = FALSE; - else if (!division->ResizeAdjoining(DIVISION_SIDE_TOP, y, TRUE)) - success = FALSE; + success = false; + else if (!division->ResizeAdjoining(DIVISION_SIDE_TOP, y, true)) + success = false; else - division->ResizeAdjoining(DIVISION_SIDE_TOP, y, FALSE); + division->ResizeAdjoining(DIVISION_SIDE_TOP, y, false); break; } case DIVISION_SIDE_RIGHT: { if ((x <= x1) || (x >= x2) || (x <= dx1)) - success = FALSE; - else if (!division->ResizeAdjoining(DIVISION_SIDE_RIGHT, x, TRUE)) - success = FALSE; + success = false; + else if (!division->ResizeAdjoining(DIVISION_SIDE_RIGHT, x, true)) + success = false; else - division->ResizeAdjoining(DIVISION_SIDE_RIGHT, x, FALSE); + division->ResizeAdjoining(DIVISION_SIDE_RIGHT, x, false); break; } case DIVISION_SIDE_BOTTOM: { if ((y <= y1) || (y >= y2) || (y <= dy1)) - success = FALSE; - else if (!division->ResizeAdjoining(DIVISION_SIDE_BOTTOM, y, TRUE)) - success = FALSE; + success = false; + else if (!division->ResizeAdjoining(DIVISION_SIDE_BOTTOM, y, true)) + success = false; else - division->ResizeAdjoining(DIVISION_SIDE_BOTTOM, y, FALSE); + division->ResizeAdjoining(DIVISION_SIDE_BOTTOM, y, false); break; } @@ -1518,7 +1518,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test) { bool success = division->AdjustRight(newPos, test); if (!success && test) - return FALSE; + return false; } break; } @@ -1528,7 +1528,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test) { bool success = division->AdjustBottom(newPos, test); if (!success && test) - return FALSE; + return false; } break; } @@ -1538,7 +1538,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test) { bool success = division->AdjustLeft(newPos, test); if (!success && test) - return FALSE; + return false; } break; } @@ -1548,7 +1548,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test) { bool success = division->AdjustTop(newPos, test); if (!success && test) - return FALSE; + return false; } break; } @@ -1558,7 +1558,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test) node = node->GetNext(); } - return TRUE; + return true; } /* @@ -1694,7 +1694,7 @@ void wxDivisionShape::EditEdge(int WXUNUSED(side)) dialog->Centre(wxBOTH); wxEndBusyCursor(); - dialog->Show(TRUE); + dialog->Show(true); int lineStyle = wxSOLID; if (*pStyle) @@ -1732,13 +1732,13 @@ void wxDivisionShape::PopupMenu(double x, double y) oglPopupDivisionMenu->SetClientData((void *)this); if (m_leftSide) - oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_LEFT_EDGE, TRUE); + oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_LEFT_EDGE, true); else - oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_LEFT_EDGE, FALSE); + oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_LEFT_EDGE, false); if (m_topSide) - oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, TRUE); + oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, true); else - oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, FALSE); + oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, false); int x1, y1; m_canvas->GetViewStart(&x1, &y1); diff --git a/contrib/src/ogl/constrnt.cpp b/contrib/src/ogl/constrnt.cpp index ddd736d643..6d5268bec4 100644 --- a/contrib/src/ogl/constrnt.cpp +++ b/contrib/src/ogl/constrnt.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -160,7 +160,7 @@ bool wxOGLConstraint::Equals(double a, double b) return eq; } -// Return TRUE if anything changed +// Return true if anything changed bool wxOGLConstraint::Evaluate() { double maxWidth, maxHeight, minWidth, minHeight, x, y; @@ -204,7 +204,7 @@ bool wxOGLConstraint::Evaluate() } // Now position the objects - bool changed = FALSE; + bool changed = false; node = m_constrainedObjects.GetFirst(); while (node) { @@ -214,8 +214,8 @@ bool wxOGLConstraint::Evaluate() startY += (double)(spacingY + (height2/2.0)); if (!Equals(startY, constrainedObject->GetY())) { - constrainedObject->Move(dc, constrainedObject->GetX(), startY, FALSE); - changed = TRUE; + constrainedObject->Move(dc, constrainedObject->GetX(), startY, false); + changed = true; } startY += (double)(height2/2.0); node = node->GetNext(); @@ -252,7 +252,7 @@ bool wxOGLConstraint::Evaluate() } // Now position the objects - bool changed = FALSE; + bool changed = false; node = m_constrainedObjects.GetFirst(); while (node) { @@ -262,8 +262,8 @@ bool wxOGLConstraint::Evaluate() startX += (double)(spacingX + (width2/2.0)); if (!Equals(startX, constrainedObject->GetX())) { - constrainedObject->Move(dc, startX, constrainedObject->GetY(), FALSE); - changed = TRUE; + constrainedObject->Move(dc, startX, constrainedObject->GetY(), false); + changed = true; } startX += (double)(width2/2.0); node = node->GetNext(); @@ -318,7 +318,7 @@ bool wxOGLConstraint::Evaluate() } // Now position the objects - bool changed = FALSE; + bool changed = false; node = m_constrainedObjects.GetFirst(); while (node) { @@ -329,10 +329,10 @@ bool wxOGLConstraint::Evaluate() startY += (double)(spacingY + (height2/2.0)); if ((!Equals(startX, constrainedObject->GetX())) || (!Equals(startY, constrainedObject->GetY()))) - { - constrainedObject->Move(dc, startX, startY, FALSE); - changed = TRUE; - } + { + constrainedObject->Move(dc, startX, startY, false); + changed = true; + } startX += (double)(width2/2.0); startY += (double)(height2/2.0); @@ -343,7 +343,7 @@ bool wxOGLConstraint::Evaluate() } case gyCONSTRAINT_LEFT_OF: { - bool changed = FALSE; + bool changed = false; wxNode *node = m_constrainedObjects.GetFirst(); while (node) @@ -355,10 +355,10 @@ bool wxOGLConstraint::Evaluate() double x3 = (double)(x - (minWidth/2.0) - (width2/2.0) - m_xSpacing); if (!Equals(x3, constrainedObject->GetX())) - { - changed = TRUE; - constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); - } + { + changed = true; + constrainedObject->Move(dc, x3, constrainedObject->GetY(), false); + } node = node->GetNext(); } @@ -366,7 +366,7 @@ bool wxOGLConstraint::Evaluate() } case gyCONSTRAINT_RIGHT_OF: { - bool changed = FALSE; + bool changed = false; wxNode *node = m_constrainedObjects.GetFirst(); while (node) @@ -378,10 +378,10 @@ bool wxOGLConstraint::Evaluate() double x3 = (double)(x + (minWidth/2.0) + (width2/2.0) + m_xSpacing); if (!Equals(x3, constrainedObject->GetX())) - { - changed = TRUE; - constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); - } + { + changed = true; + constrainedObject->Move(dc, x3, constrainedObject->GetY(), false); + } node = node->GetNext(); } @@ -389,7 +389,7 @@ bool wxOGLConstraint::Evaluate() } case gyCONSTRAINT_ABOVE: { - bool changed = FALSE; + bool changed = false; wxNode *node = m_constrainedObjects.GetFirst(); while (node) @@ -401,10 +401,10 @@ bool wxOGLConstraint::Evaluate() double y3 = (double)(y - (minHeight/2.0) - (height2/2.0) - m_ySpacing); if (!Equals(y3, constrainedObject->GetY())) - { - changed = TRUE; - constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); - } + { + changed = true; + constrainedObject->Move(dc, constrainedObject->GetX(), y3, false); + } node = node->GetNext(); } @@ -412,7 +412,7 @@ bool wxOGLConstraint::Evaluate() } case gyCONSTRAINT_BELOW: { - bool changed = FALSE; + bool changed = false; wxNode *node = m_constrainedObjects.GetFirst(); while (node) @@ -424,10 +424,10 @@ bool wxOGLConstraint::Evaluate() double y3 = (double)(y + (minHeight/2.0) + (height2/2.0) + m_ySpacing); if (!Equals(y3, constrainedObject->GetY())) - { - changed = TRUE; - constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); - } + { + changed = true; + constrainedObject->Move(dc, constrainedObject->GetX(), y3, false); + } node = node->GetNext(); } @@ -435,7 +435,7 @@ bool wxOGLConstraint::Evaluate() } case gyCONSTRAINT_ALIGNED_LEFT: { - bool changed = FALSE; + bool changed = false; wxNode *node = m_constrainedObjects.GetFirst(); while (node) @@ -447,10 +447,10 @@ bool wxOGLConstraint::Evaluate() double x3 = (double)(x - (minWidth/2.0) + (width2/2.0) + m_xSpacing); if (!Equals(x3, constrainedObject->GetX())) - { - changed = TRUE; - constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); - } + { + changed = true; + constrainedObject->Move(dc, x3, constrainedObject->GetY(), false); + } node = node->GetNext(); } @@ -458,7 +458,7 @@ bool wxOGLConstraint::Evaluate() } case gyCONSTRAINT_ALIGNED_RIGHT: { - bool changed = FALSE; + bool changed = false; wxNode *node = m_constrainedObjects.GetFirst(); while (node) @@ -470,22 +470,22 @@ bool wxOGLConstraint::Evaluate() double x3 = (double)(x + (minWidth/2.0) - (width2/2.0) - m_xSpacing); if (!Equals(x3, constrainedObject->GetX())) - { - changed = TRUE; - constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); - } + { + changed = true; + constrainedObject->Move(dc, x3, constrainedObject->GetY(), false); + } node = node->GetNext(); } return changed; #if 0 // two returned values ? - return FALSE; + return false; #endif } case gyCONSTRAINT_ALIGNED_TOP: { - bool changed = FALSE; + bool changed = false; wxNode *node = m_constrainedObjects.GetFirst(); while (node) @@ -497,10 +497,10 @@ bool wxOGLConstraint::Evaluate() double y3 = (double)(y - (minHeight/2.0) + (height2/2.0) + m_ySpacing); if (!Equals(y3, constrainedObject->GetY())) - { - changed = TRUE; - constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); - } + { + changed = true; + constrainedObject->Move(dc, constrainedObject->GetX(), y3, false); + } node = node->GetNext(); } @@ -508,7 +508,7 @@ bool wxOGLConstraint::Evaluate() } case gyCONSTRAINT_ALIGNED_BOTTOM: { - bool changed = FALSE; + bool changed = false; wxNode *node = m_constrainedObjects.GetFirst(); while (node) @@ -520,10 +520,10 @@ bool wxOGLConstraint::Evaluate() double y3 = (double)(y + (minHeight/2.0) - (height2/2.0) - m_ySpacing); if (!Equals(y3, constrainedObject->GetY())) - { - changed = TRUE; - constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); - } + { + changed = true; + constrainedObject->Move(dc, constrainedObject->GetX(), y3, false); + } node = node->GetNext(); } @@ -531,7 +531,7 @@ bool wxOGLConstraint::Evaluate() } case gyCONSTRAINT_MIDALIGNED_LEFT: { - bool changed = FALSE; + bool changed = false; wxNode *node = m_constrainedObjects.GetFirst(); while (node) @@ -540,10 +540,10 @@ bool wxOGLConstraint::Evaluate() double x3 = (double)(x - (minWidth/2.0)); if (!Equals(x3, constrainedObject->GetX())) - { - changed = TRUE; - constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); - } + { + changed = true; + constrainedObject->Move(dc, x3, constrainedObject->GetY(), false); + } node = node->GetNext(); } @@ -551,7 +551,7 @@ bool wxOGLConstraint::Evaluate() } case gyCONSTRAINT_MIDALIGNED_RIGHT: { - bool changed = FALSE; + bool changed = false; wxNode *node = m_constrainedObjects.GetFirst(); while (node) @@ -560,22 +560,22 @@ bool wxOGLConstraint::Evaluate() double x3 = (double)(x + (minWidth/2.0)); if (!Equals(x3, constrainedObject->GetX())) - { - changed = TRUE; - constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); - } + { + changed = true; + constrainedObject->Move(dc, x3, constrainedObject->GetY(), false); + } node = node->GetNext(); } return changed; #if 0 // two returned values ? - return FALSE; + return false; #endif } case gyCONSTRAINT_MIDALIGNED_TOP: { - bool changed = FALSE; + bool changed = false; wxNode *node = m_constrainedObjects.GetFirst(); while (node) @@ -584,10 +584,10 @@ bool wxOGLConstraint::Evaluate() double y3 = (double)(y - (minHeight/2.0)); if (!Equals(y3, constrainedObject->GetY())) - { - changed = TRUE; - constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); - } + { + changed = true; + constrainedObject->Move(dc, constrainedObject->GetX(), y3, false); + } node = node->GetNext(); } @@ -595,7 +595,7 @@ bool wxOGLConstraint::Evaluate() } case gyCONSTRAINT_MIDALIGNED_BOTTOM: { - bool changed = FALSE; + bool changed = false; wxNode *node = m_constrainedObjects.GetFirst(); while (node) @@ -604,10 +604,10 @@ bool wxOGLConstraint::Evaluate() double y3 = (double)(y + (minHeight/2.0)); if (!Equals(y3, constrainedObject->GetY())) - { - changed = TRUE; - constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); - } + { + changed = true; + constrainedObject->Move(dc, constrainedObject->GetX(), y3, false); + } node = node->GetNext(); } @@ -616,9 +616,9 @@ bool wxOGLConstraint::Evaluate() #if 0 // default value handled in main function body default: - return FALSE; + return false; #endif } - return FALSE; + return false; } diff --git a/contrib/src/ogl/divided.cpp b/contrib/src/ogl/divided.cpp index 9d682b8120..d8ced84d43 100644 --- a/contrib/src/ogl/divided.cpp +++ b/contrib/src/ogl/divided.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -93,7 +93,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc) if (!formatted) { FormatRegionText(); - formatted = TRUE; + formatted = true; } */ if (GetDisableLabel()) return; @@ -285,10 +285,10 @@ bool wxDividedShape::GetAttachmentPosition(int attachment, double *x, double *y, { *x = m_xpos; *y = m_ypos; - return FALSE; + return false; } } - return TRUE; + return true; } int wxDividedShape::GetNumberOfAttachments() const @@ -317,9 +317,9 @@ bool wxDividedShape::AttachmentIsValid(int attachment) const return wxShape::AttachmentIsValid(attachment); } else if (attachment >= 0) - return TRUE; + return true; else - return FALSE; + return false; } void wxDividedShape::Copy(wxShape& copy) @@ -524,7 +524,7 @@ void wxDividedShape::EditRegions() wxEndBusyCursor(); - dialog->Show(TRUE); + dialog->Show(true); node = GetRegions().GetFirst(); i = 0; diff --git a/contrib/src/ogl/drawn.cpp b/contrib/src/ogl/drawn.cpp index 3733cdacd0..010a45792f 100644 --- a/contrib/src/ogl/drawn.cpp +++ b/contrib/src/ogl/drawn.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -51,7 +51,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxDrawnShape, wxRectangleShape) wxDrawnShape::wxDrawnShape():wxRectangleShape(100.0, 50.0) { - m_saveToFile = TRUE; + m_saveToFile = true; m_currentAngle = oglDRAWN_ANGLE_0; } @@ -225,7 +225,7 @@ bool wxDrawnShape::GetPerimeterPoint(double x1, double y1, wxDrawOp* op = (wxDrawOp*) node->GetData(); if (op->GetPerimeterPoint(x1, y1, x2, y2, x3, y3, GetX(), GetY(), GetAttachmentMode())) - return TRUE; + return true; } // Default... just use a rectangle @@ -815,10 +815,10 @@ void wxOpDraw::Rotate(double x, double y, double theta, double sinTheta, double double newX2 = m_x2*cosTheta - m_y2*sinTheta + x*(1.0 - cosTheta) + y*sinTheta; double newY2 = m_x2*sinTheta + m_y2*cosTheta + y*(1.0 - cosTheta) + x*sinTheta; - m_x1 = newX1; - m_y1 = newY1; - m_x2 = newX2; - m_y2 = newY2; + m_x1 = newX1; + m_y1 = newY1; + m_x2 = newX2; + m_y2 = newY2; break; } case DRAWOP_DRAW_RECT: @@ -861,12 +861,12 @@ void wxOpDraw::Rotate(double x, double y, double theta, double sinTheta, double double newX3 = m_x3*cosTheta - m_y3*sinTheta + x*(1.0 - cosTheta) + y*sinTheta; double newY3 = m_x3*sinTheta + m_y3*cosTheta + y*(1.0 - cosTheta) + x*sinTheta; - m_x1 = newX1; - m_y1 = newY1; - m_x2 = newX2; - m_y2 = newY2; - m_x3 = newX3; - m_y3 = newY3; + m_x1 = newX1; + m_y1 = newY1; + m_x2 = newX2; + m_y2 = newY2; + m_x3 = newX3; + m_y3 = newY3; break; } @@ -1209,7 +1209,7 @@ bool wxOpPolyDraw::OnDrawOutline(wxDC& dc, double x, double y, double w, double } dc.DrawPolygon(n, intPoints, (long) x, (long) y); delete[] intPoints; - return TRUE; + return true; } // Assume (x1, y1) is centre of box (most generally, line end at box) @@ -1239,13 +1239,13 @@ bool wxOpPolyDraw::GetPerimeterPoint(double x1, double y1, { *x3 = point->x + xOffset; *y3 = point->y + yOffset; - return TRUE; + return true; } else if ((y2 < y1) && (point->y < 0.0)) { *x3 = point->x + xOffset; *y3 = point->y + yOffset; - return TRUE; + return true; } } } @@ -1267,7 +1267,7 @@ bool wxOpPolyDraw::GetPerimeterPoint(double x1, double y1, delete[] xpoints; delete[] ypoints; - return TRUE; + return true; } @@ -1363,7 +1363,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPseudoMetaFile, wxObject) wxPseudoMetaFile::wxPseudoMetaFile() { m_currentRotation = 0; - m_rotateable = TRUE; + m_rotateable = true; m_width = 0.0; m_height = 0.0; m_outlinePen = NULL; @@ -1602,7 +1602,7 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle) // Read GDI objects wxChar buf[50]; int i = 1; - bool keepGoing = TRUE; + bool keepGoing = true; while (keepGoing) { wxSprintf(buf, _T("gdi%d_%d"), whichAngle, i); @@ -1610,7 +1610,7 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle) clause->GetAttributeValue(buf, &expr); if (!expr) { - keepGoing = FALSE; + keepGoing = false; } else { @@ -1667,7 +1667,7 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle) } // Now read in the operations - keepGoing = TRUE; + keepGoing = true; i = 1; while (keepGoing) { @@ -1676,7 +1676,7 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle) clause->GetAttributeValue(buf, &expr); if (!expr) { - keepGoing = FALSE; + keepGoing = false; } else { @@ -1821,14 +1821,14 @@ void wxPseudoMetaFile::Copy(wxPseudoMetaFile& copy) bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth, double *rheight) { if (!wxFileExists(filename)) - return FALSE; + return false; wxXMetaFile *metaFile = new wxXMetaFile; if (!metaFile->ReadFile(filename)) { delete metaFile; - return FALSE; + return false; } double lastX = 0.0; @@ -2165,7 +2165,7 @@ bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth m_height = *rheight; delete metaFile; - return TRUE; + return true; } // Scale to fit size diff --git a/contrib/src/ogl/lines.cpp b/contrib/src/ogl/lines.cpp index 8c027c108e..c9f63ba16d 100644 --- a/contrib/src/ogl/lines.cpp +++ b/contrib/src/ogl/lines.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -45,7 +45,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxLineShape, wxShape) wxLineShape::wxLineShape() { m_sensitivity = OP_CLICK_LEFT | OP_CLICK_RIGHT; - m_draggable = FALSE; + m_draggable = false; m_attachmentTo = 0; m_attachmentFrom = 0; /* @@ -54,11 +54,11 @@ wxLineShape::wxLineShape() */ m_from = NULL; m_to = NULL; - m_erasing = FALSE; + m_erasing = false; m_arrowSpacing = 5.0; // For the moment, don't bother saving this to file. - m_ignoreArrowOffsets = FALSE; - m_isSpline = FALSE; - m_maintainStraightLines = FALSE; + m_ignoreArrowOffsets = false; + m_isSpline = false; + m_maintainStraightLines = false; m_alignmentStart = 0; m_alignmentEnd = 0; @@ -97,7 +97,7 @@ wxLineShape::~wxLineShape() { if (m_labelObjects[i]) { - m_labelObjects[i]->Select(FALSE); + m_labelObjects[i]->Select(false); m_labelObjects[i]->RemoveFromCanvas(m_canvas); delete m_labelObjects[i]; m_labelObjects[i] = NULL; @@ -144,7 +144,7 @@ wxNode *wxLineShape::InsertLineControlPoint(wxDC* dc) bool wxLineShape::DeleteLineControlPoint() { if (m_lineControlPoints->GetCount() < 3) - return FALSE; + return false; wxNode *last = m_lineControlPoints->GetLast(); wxNode *second_last = last->GetPrevious(); @@ -153,7 +153,7 @@ bool wxLineShape::DeleteLineControlPoint() delete second_last_point; delete second_last; - return TRUE; + return true; } void wxLineShape::Initialise() @@ -242,7 +242,7 @@ void wxLineShape::FormatText(wxDC& dc, const wxString& s, int i) EraseRegion(dc, region, xx, yy); if (m_labelObjects[i]) { - m_labelObjects[i]->Select(FALSE, &dc); + m_labelObjects[i]->Select(false, &dc); m_labelObjects[i]->Erase(dc); m_labelObjects[i]->SetSize(actualW, actualH); } @@ -251,13 +251,13 @@ void wxLineShape::FormatText(wxDC& dc, const wxString& s, int i) if (m_labelObjects[i]) { - m_labelObjects[i]->Select(TRUE, & dc); + m_labelObjects[i]->Select(true, & dc); m_labelObjects[i]->Draw(dc); } } } oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, actualW, actualH, region->GetFormatMode()); - m_formatted = TRUE; + m_formatted = true; } void wxLineShape::DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y) @@ -464,10 +464,10 @@ void wxLineShape::SetAttachments(int from_attach, int to_attach) bool wxLineShape::HitTest(double x, double y, int *attachment, double *distance) { if (!m_lineControlPoints) - return FALSE; + return false; // Look at label regions in case mouse is over a label - bool inLabelRegion = FALSE; + bool inLabelRegion = false; for (int i = 0; i < 3; i ++) { wxNode *regionNode = m_regions.Item(i); @@ -489,7 +489,7 @@ bool wxLineShape::HitTest(double x, double y, int *attachment, double *distance) double rBottom = (double)(cy + (ch/2.0)); if (x > rLeft && x < rRight && y > rTop && y < rBottom) { - inLabelRegion = TRUE; + inLabelRegion = true; i = 3; } } @@ -520,12 +520,12 @@ bool wxLineShape::HitTest(double x, double y, int *attachment, double *distance) { *attachment = 0; *distance = distance_from_seg; - return TRUE; + return true; } node = node->GetNext(); } - return FALSE; + return false; } void wxLineShape::DrawArrows(wxDC& dc) @@ -545,10 +545,10 @@ void wxLineShape::DrawArrows(wxDC& dc) { if ((arrow->GetXOffset() != 0.0) && !m_ignoreArrowOffsets) // If specified, x offset is proportional to line length - DrawArrow(dc, arrow, arrow->GetXOffset(), TRUE); + DrawArrow(dc, arrow, arrow->GetXOffset(), true); else { - DrawArrow(dc, arrow, startArrowPos, FALSE); // Absolute distance + DrawArrow(dc, arrow, startArrowPos, false); // Absolute distance startArrowPos += arrow->GetSize() + arrow->GetSpacing(); } break; @@ -556,10 +556,10 @@ void wxLineShape::DrawArrows(wxDC& dc) case ARROW_POSITION_END: { if ((arrow->GetXOffset() != 0.0) && !m_ignoreArrowOffsets) - DrawArrow(dc, arrow, arrow->GetXOffset(), TRUE); + DrawArrow(dc, arrow, arrow->GetXOffset(), true); else { - DrawArrow(dc, arrow, endArrowPos, FALSE); + DrawArrow(dc, arrow, endArrowPos, false); endArrowPos += arrow->GetSize() + arrow->GetSpacing(); } break; @@ -568,10 +568,10 @@ void wxLineShape::DrawArrows(wxDC& dc) { arrow->SetXOffset(middleArrowPos); if ((arrow->GetXOffset() != 0.0) && !m_ignoreArrowOffsets) - DrawArrow(dc, arrow, arrow->GetXOffset(), TRUE); + DrawArrow(dc, arrow, arrow->GetXOffset(), true); else { - DrawArrow(dc, arrow, middleArrowPos, FALSE); + DrawArrow(dc, arrow, middleArrowPos, false); middleArrowPos += arrow->GetSize() + arrow->GetSpacing(); } break; @@ -879,10 +879,10 @@ void wxLineShape::OnErase(wxDC& dc) } else { - m_erasing = TRUE; + m_erasing = true; GetEventHandler()->OnDraw(dc); GetEventHandler()->OnEraseControlPoints(dc); - m_erasing = FALSE; + m_erasing = false; } if (old_pen) SetPen(old_pen); @@ -1018,7 +1018,7 @@ bool wxLineShape::OnMovePre(wxDC& dc, double x, double y, double old_x, double o m_labelObjects[i]->Move(dc, xp+xr, yp+yr); } } - return TRUE; + return true; } void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints) @@ -1109,7 +1109,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d if (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { int nth, no_arcs; - FindNth(m_from, &nth, &no_arcs, FALSE); // Not incoming + FindNth(m_from, &nth, &no_arcs, false); // Not incoming m_from->GetAttachmentPosition(m_attachmentFrom, &end_x, &end_y, nth, no_arcs, this); } else @@ -1120,7 +1120,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d if (m_to->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { int nth, no_arcs; - FindNth(m_to, &nth, &no_arcs, TRUE); // Incoming + FindNth(m_to, &nth, &no_arcs, true); // Incoming m_to->GetAttachmentPosition(m_attachmentTo, &other_end_x, &other_end_y, nth, no_arcs, this); } else @@ -1138,7 +1138,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d if (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { int nth, no_arcs; - FindNth(m_from, &nth, &no_arcs, FALSE); + FindNth(m_from, &nth, &no_arcs, false); m_from->GetAttachmentPosition(m_attachmentFrom, &end_x, &end_y, nth, no_arcs, this); fromX = end_x; fromY = end_y; @@ -1147,7 +1147,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d if (m_to->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { int nth, no_arcs; - FindNth(m_to, &nth, &no_arcs, TRUE); + FindNth(m_to, &nth, &no_arcs, true); m_to->GetAttachmentPosition(m_attachmentTo, &other_end_x, &other_end_y, nth, no_arcs, this); toX = other_end_x; toY = other_end_y; @@ -1652,16 +1652,16 @@ void wxLineShape::Select(bool select, wxDC* dc) GetLabelPosition(i, &xx, &yy); if (m_labelObjects[i]) { - m_labelObjects[i]->Select(FALSE); + m_labelObjects[i]->Select(false); m_labelObjects[i]->RemoveFromCanvas(m_canvas); delete m_labelObjects[i]; } m_labelObjects[i] = OnCreateLabelShape(this, region, w, h); m_labelObjects[i]->AddToCanvas(m_canvas); - m_labelObjects[i]->Show(TRUE); + m_labelObjects[i]->Show(true); if (dc) m_labelObjects[i]->Move(*dc, (double)(x + xx), (double)(y + yy)); - m_labelObjects[i]->Select(TRUE, dc); + m_labelObjects[i]->Select(true, dc); } } } @@ -1672,7 +1672,7 @@ void wxLineShape::Select(bool select, wxDC* dc) { if (m_labelObjects[i]) { - m_labelObjects[i]->Select(FALSE, dc); + m_labelObjects[i]->Select(false, dc); m_labelObjects[i]->Erase(*dc); m_labelObjects[i]->RemoveFromCanvas(m_canvas); delete m_labelObjects[i]; @@ -1754,7 +1754,7 @@ void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), doub lineShape->SetPen(& dottedPen); lineShape->SetBrush(wxTRANSPARENT_BRUSH); - lineShape->GetEventHandler()->OnMoveLink(dc, FALSE); + lineShape->GetEventHandler()->OnMoveLink(dc, false); lineShape->SetPen(old_pen); lineShape->SetBrush(old_brush); @@ -1789,7 +1789,7 @@ void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, lineShape->GetTo()->OnDraw(dc); lineShape->GetTo()->OnDrawContents(dc); - this->SetDisableLabel(TRUE); + this->SetDisableLabel(true); dc.SetLogicalFunction(OGLRBLF); lpt->m_xpos = x; lpt->m_ypos = y; @@ -1802,7 +1802,7 @@ void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, lineShape->SetPen(& dottedPen); lineShape->SetBrush(wxTRANSPARENT_BRUSH); - lineShape->GetEventHandler()->OnMoveLink(dc, FALSE); + lineShape->GetEventHandler()->OnMoveLink(dc, false); lineShape->SetPen(old_pen); lineShape->SetBrush(old_brush); @@ -1822,7 +1822,7 @@ void wxLineShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, in wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); - this->SetDisableLabel(FALSE); + this->SetDisableLabel(false); wxLineShape *lineShape = (wxLineShape *)this; if (lpt->m_type == CONTROL_POINT_LINE) @@ -1891,7 +1891,7 @@ bool wxLineShape::OnMoveMiddleControlPoint(wxDC& dc, wxLineControlPoint* lpt, co GetEventHandler()->OnMoveLink(dc); - return TRUE; + return true; } // Implement movement of endpoint to a new attachment @@ -2023,7 +2023,7 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int wxNode *refNode = referenceList.GetFirst(); wxNode *currNode = m_arcArrows.GetFirst(); wxString targetName(arrow->GetName()); - if (!refNode) return FALSE; + if (!refNode) return false; // First check whether we need to insert in front of list, // because this arrowhead is the first in the reference @@ -2032,7 +2032,7 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int if (refArrow->GetName() == targetName) { m_arcArrows.Insert(arrow); - return TRUE; + return true; } wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData(); @@ -2057,12 +2057,12 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int m_arcArrows.Insert(currNode, arrow); else m_arcArrows.Append(arrow); - return TRUE; + return true; } refNode = refNode->GetNext(); } m_arcArrows.Append(arrow); - return TRUE; + return true; } void wxLineShape::ClearArrowsAtPosition(int end) @@ -2122,11 +2122,11 @@ bool wxLineShape::ClearArrow(const wxString& name) { delete arrow; delete node; - return TRUE; + return true; } node = node->GetNext(); } - return FALSE; + return false; } /* @@ -2177,11 +2177,11 @@ bool wxLineShape::DeleteArrowHead(int position, const wxString& name) { delete arrow; delete node; - return TRUE; + return true; } node = node->GetNext(); } - return FALSE; + return false; } // Overloaded DeleteArrowHead: pass arrowhead id. @@ -2195,11 +2195,11 @@ bool wxLineShape::DeleteArrowHead(long id) { delete arrow; delete node; - return TRUE; + return true; } node = node->GetNext(); } - return FALSE; + return false; } /* @@ -2331,7 +2331,7 @@ wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject) return (wxRealPoint *)node->GetData(); } else - return FALSE; + return NULL; } /* @@ -2496,7 +2496,7 @@ bool wxLineShape::OnLabelMovePre(wxDC& dc, wxLabelShape* labelShape, double x, d labelShape->FormatText(dc, s, i); DrawRegion(dc, labelShape->m_shapeRegion, xx, yy); } - return TRUE; + return true; } // Divert left and right clicks to line object diff --git a/contrib/src/ogl/mfutils.cpp b/contrib/src/ogl/mfutils.cpp index 8681b25c1d..6c268e8425 100644 --- a/contrib/src/ogl/mfutils.cpp +++ b/contrib/src/ogl/mfutils.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -67,20 +67,20 @@ static long getint(FILE *fp) c = getc(fp); c1 = getc(fp); c2 = getc(fp); c3 = getc(fp); long res = (long)((long) c) + (((long) c1) << 8) + - (((long) c2) << 16) + - (((long) c3) << 24); + (((long) c2) << 16) + + (((long) c3) << 24); return res; } /* Placeable metafile header struct mfPLACEABLEHEADER { - DWORD key; // 32-bit - HANDLE hmf; // 16-bit - RECT bbox; // 4x16 bit - WORD inch; // 16-bit - DWORD reserved; // 32-bit - WORD checksum; // 16-bit + DWORD key; // 32-bit + HANDLE hmf; // 16-bit + RECT bbox; // 4x16 bit + WORD inch; // 16-bit + DWORD reserved; // 32-bit + WORD checksum; // 16-bit }; */ @@ -92,7 +92,7 @@ wxMetaRecord::~wxMetaRecord(void) wxXMetaFile::wxXMetaFile(const wxChar *file) { - ok = FALSE; + ok = false; top = 0.0; bottom = 0.0; left = 0.0; @@ -159,7 +159,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) HandleTableSize = 0; FILE *handle = wxFopen(file, wxT("rb")); - if (!handle) return FALSE; + if (!handle) return false; // Read placeable metafile header, if any long key = getint(handle); @@ -196,7 +196,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) if (mtType != 1 && mtType != 2) { fclose(handle); - return FALSE; + return false; } /* int mtHeaderSize = */ getshort(handle); @@ -205,7 +205,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) if (mtVersion != 0x0300 && mtVersion != 0x0100) { fclose(handle); - return FALSE; + return false; } /* long mtSize = */ getint(handle); @@ -723,7 +723,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) } } fclose(handle); - return TRUE; + return true; } wxXMetaFile::~wxXMetaFile(void) @@ -741,7 +741,7 @@ wxXMetaFile::~wxXMetaFile(void) bool wxXMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height)) { - return FALSE; + return false; } bool wxXMetaFile::Play(wxDC *dc) @@ -1082,6 +1082,6 @@ bool wxXMetaFile::Play(wxDC *dc) } node = node->GetNext(); } - return TRUE; + return true; } diff --git a/contrib/src/ogl/ogldiag.cpp b/contrib/src/ogl/ogldiag.cpp index b4edc56ff3..d883db535b 100644 --- a/contrib/src/ogl/ogldiag.cpp +++ b/contrib/src/ogl/ogldiag.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -45,8 +45,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxDiagram, wxObject) wxDiagram::wxDiagram() { m_diagramCanvas = NULL; - m_quickEditMode = FALSE; - m_snapToGrid = TRUE; + m_quickEditMode = false; + m_snapToGrid = true; m_gridSpacing = 5.0; m_shapeList = new wxList; m_mouseTolerance = DEFAULT_MOUSE_TOLERANCE; @@ -250,7 +250,7 @@ bool wxDiagram::SaveFile(const wxString& filename) { wxEndBusyCursor(); delete database; - return FALSE; + return false; } database->Write(file); @@ -285,7 +285,7 @@ bool wxDiagram::SaveFile(const wxString& filename) } wxEndBusyCursor(); - return TRUE; + return true; } bool wxDiagram::LoadFile(const wxString& filename) @@ -296,7 +296,7 @@ bool wxDiagram::LoadFile(const wxString& filename) if (!database.Read(filename)) { wxEndBusyCursor(); - return FALSE; + return false; } DeleteAllShapes(); @@ -326,7 +326,7 @@ bool wxDiagram::LoadFile(const wxString& filename) wxEndBusyCursor(); - return TRUE; + return true; } void wxDiagram::ReadNodes(wxExprDatabase& database) @@ -348,7 +348,7 @@ void wxDiagram::ReadNodes(wxExprDatabase& database) OnShapeLoad(database, *shape, *clause); shape->SetCanvas(GetCanvas()); - shape->Show(TRUE); + shape->Show(true); m_shapeList->Append(shape); @@ -389,7 +389,7 @@ void wxDiagram::ReadLines(wxExprDatabase& database) if (classInfo) { wxLineShape *shape = (wxLineShape *)classInfo->CreateObject(); - shape->Show(TRUE); + shape->Show(true); OnShapeLoad(database, *shape, *clause); shape->SetCanvas(GetCanvas()); @@ -519,12 +519,12 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database) // Allow for modifying file bool wxDiagram::OnDatabaseLoad(wxExprDatabase& WXUNUSED(db)) { - return TRUE; + return true; } bool wxDiagram::OnDatabaseSave(wxExprDatabase& WXUNUSED(db)) { - return TRUE; + return true; } bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) @@ -544,23 +544,23 @@ bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) } } - return TRUE; + return true; } bool wxDiagram::OnShapeLoad(wxExprDatabase& WXUNUSED(db), wxShape& shape, wxExpr& expr) { shape.ReadAttributes(&expr); - return TRUE; + return true; } bool wxDiagram::OnHeaderSave(wxExprDatabase& WXUNUSED(db), wxExpr& WXUNUSED(expr)) { - return TRUE; + return true; } bool wxDiagram::OnHeaderLoad(wxExprDatabase& WXUNUSED(db), wxExpr& WXUNUSED(expr)) { - return TRUE; + return true; } #endif diff --git a/contrib/src/ogl/oglmisc.cpp b/contrib/src/ogl/oglmisc.cpp index d22eb0441c..9b575499d5 100644 --- a/contrib/src/ogl/oglmisc.cpp +++ b/contrib/src/ogl/oglmisc.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -384,7 +384,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double // Make new lines into NULL strings at this point int i = 0; int j = 0; int len = text.Length(); wxChar word[200]; word[0] = 0; - bool end_word = FALSE; bool new_line = FALSE; + bool end_word = false; bool new_line = false; while (i < len) { switch (text[i]) @@ -397,7 +397,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double else { if (text[i] == wxT('n')) - { new_line = TRUE; end_word = TRUE; i++; } + { new_line = true; end_word = true; i++; } else { word[j] = wxT('%'); j ++; word[j] = text[i]; j ++; i ++; } } @@ -405,17 +405,17 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double } case 10: { - new_line = TRUE; end_word = TRUE; i++; + new_line = true; end_word = true; i++; break; } case 13: { - new_line = TRUE; end_word = TRUE; i++; + new_line = true; end_word = true; i++; break; } case wxT(' '): { - end_word = TRUE; + end_word = true; i ++; break; } @@ -426,18 +426,18 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double break; } } - if (i == len) end_word = TRUE; + if (i == len) end_word = true; if (end_word) { word[j] = 0; j = 0; word_list.Add(word); - end_word = FALSE; + end_word = false; } if (new_line) { word_list.Append(NULL); - new_line = FALSE; + new_line = false; } } // Now, make a list of strings which can fit in the box -- 2.45.2