From b9ac87bc5cbe46227195e32c44e25831f8206e3c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 25 Mar 2003 06:58:05 +0000 Subject: [PATCH] Removed deprecation warnings in OGL and Gizmos git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/ogl/basic.h | 2 +- contrib/include/wx/ogl/drawn.h | 2 +- contrib/include/wx/ogl/ogldiag.h | 2 +- contrib/src/gizmos/splittree.cpp | 10 +- contrib/src/ogl/basic.cpp | 498 +++++++++++++++---------------- contrib/src/ogl/basic2.cpp | 210 ++++++------- contrib/src/ogl/canvas.cpp | 12 +- contrib/src/ogl/composit.cpp | 220 +++++++------- contrib/src/ogl/constrnt.cpp | 126 ++++---- contrib/src/ogl/divided.cpp | 100 +++---- contrib/src/ogl/drawn.cpp | 228 +++++++------- contrib/src/ogl/lines.cpp | 382 ++++++++++++------------ contrib/src/ogl/mfutils.cpp | 32 +- contrib/src/ogl/misc.cpp | 64 ++-- contrib/src/ogl/ogldiag.cpp | 84 +++--- contrib/src/ogl/oglmisc.cpp | 44 +-- 16 files changed, 1008 insertions(+), 1008 deletions(-) diff --git a/contrib/include/wx/ogl/basic.h b/contrib/include/wx/ogl/basic.h index eeaead4b10..f14ce67de6 100644 --- a/contrib/include/wx/ogl/basic.h +++ b/contrib/include/wx/ogl/basic.h @@ -339,7 +339,7 @@ class wxShape: public wxShapeEvtHandler virtual wxFont *GetFont(int regionId = 0) const; virtual void SetTextColour(const wxString& colour, int regionId = 0); virtual wxString GetTextColour(int regionId = 0) const; - virtual inline int GetNumberOfTextRegions() const { return m_regions.Number(); } + virtual inline int GetNumberOfTextRegions() const { return m_regions.GetCount(); } virtual void SetRegionName(const wxString& name, int regionId = 0); // Get the name representing the region for this image alone. diff --git a/contrib/include/wx/ogl/drawn.h b/contrib/include/wx/ogl/drawn.h index dd7ba01ffd..75f3d00a9a 100644 --- a/contrib/include/wx/ogl/drawn.h +++ b/contrib/include/wx/ogl/drawn.h @@ -74,7 +74,7 @@ class wxPseudoMetaFile: public wxObject inline wxList& GetOps() const { return (wxList&) m_ops; } // Is this a valid (non-empty) metafile? - inline bool IsValid() const { return (m_ops.Number() > 0); } + inline bool IsValid() const { return (m_ops.GetCount() > 0); } public: /// Set of functions for drawing into a pseudo metafile. diff --git a/contrib/include/wx/ogl/ogldiag.h b/contrib/include/wx/ogl/ogldiag.h index 7a593f2466..540c2244ac 100644 --- a/contrib/include/wx/ogl/ogldiag.h +++ b/contrib/include/wx/ogl/ogldiag.h @@ -62,7 +62,7 @@ public: inline void SetMouseTolerance(int tol) { m_mouseTolerance = tol; } inline int GetMouseTolerance() const { return m_mouseTolerance; } inline wxList *GetShapeList() const { return m_shapeList; } - inline int GetCount() const { return m_shapeList->Number(); } + inline int GetCount() const { return m_shapeList->GetCount(); } // Make sure all text that should be centred, is centred. void RecentreAll(wxDC& dc); diff --git a/contrib/src/gizmos/splittree.cpp b/contrib/src/gizmos/splittree.cpp index 346659cf30..5aaa32a48b 100644 --- a/contrib/src/gizmos/splittree.cpp +++ b/contrib/src/gizmos/splittree.cpp @@ -629,9 +629,9 @@ wxSplitterScrolledWindow::wxSplitterScrolledWindow(wxWindow* parent, wxWindowID void wxSplitterScrolledWindow::OnSize(wxSizeEvent& event) { wxSize sz = GetClientSize(); - if (GetChildren().First()) + if (GetChildren().GetFirst()) { - ((wxWindow*) GetChildren().First()->Data())->SetSize(0, 0, sz.x, sz.y); + ((wxWindow*) GetChildren().GetFirst()->GetData())->SetSize(0, 0, sz.x, sz.y); } } @@ -682,10 +682,10 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event) } // Find targets in splitter window and send the event to them - wxNode* node = GetChildren().First(); + wxWindowListNode* node = GetChildren().GetFirst(); while (node) { - wxWindow* child = (wxWindow*) node->Data(); + wxWindow* child = (wxWindow*) node->GetData(); if (child->IsKindOf(CLASSINFO(wxSplitterWindow))) { wxSplitterWindow* splitter = (wxSplitterWindow*) child; @@ -695,7 +695,7 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event) splitter->GetWindow2()->ProcessEvent(event); break; } - node = node->Next(); + node = node->GetNext(); } #ifdef __WXMAC__ diff --git a/contrib/src/ogl/basic.cpp b/contrib/src/ogl/basic.cpp index 63bbc4dfee..2b673af38a 100644 --- a/contrib/src/ogl/basic.cpp +++ b/contrib/src/ogl/basic.cpp @@ -339,12 +339,12 @@ void wxShape::SetHighlight(bool hi, bool recurse) m_highlighted = hi; if (recurse) { - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->SetHighlight(hi, recurse); - node = node->Next(); + node = node->GetNext(); } } } @@ -359,12 +359,12 @@ void wxShape::SetSensitivityFilter(int sens, bool recursive) m_sensitivity = sens; if (recursive) { - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *obj = (wxShape *)node->Data(); + wxShape *obj = (wxShape *)node->GetData(); obj->SetSensitivityFilter(sens, TRUE); - node = node->Next(); + node = node->GetNext(); } } } @@ -380,12 +380,12 @@ void wxShape::SetDraggable(bool drag, bool recursive) if (recursive) { - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *obj = (wxShape *)node->Data(); + wxShape *obj = (wxShape *)node->GetData(); obj->SetDraggable(drag, TRUE); - node = node->Next(); + node = node->GetNext(); } } } @@ -393,12 +393,12 @@ void wxShape::SetDraggable(bool drag, bool recursive) void wxShape::SetDrawHandles(bool drawH) { m_drawHandles = drawH; - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *obj = (wxShape *)node->Data(); + wxShape *obj = (wxShape *)node->GetData(); obj->SetDrawHandles(drawH); - node = node->Next(); + node = node->GetNext(); } } @@ -423,27 +423,27 @@ void wxShape::SetShadowMode(int mode, bool redraw) void wxShape::SetCanvas(wxShapeCanvas *theCanvas) { m_canvas = theCanvas; - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->SetCanvas(theCanvas); - node = node->Next(); + node = node->GetNext(); } } void wxShape::AddToCanvas(wxShapeCanvas *theCanvas, wxShape *addAfter) { theCanvas->AddShape(this, addAfter); - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); wxShape *lastImage = this; while (node) { - wxShape *object = (wxShape *)node->Data(); + wxShape *object = (wxShape *)node->GetData(); object->AddToCanvas(theCanvas, lastImage); lastImage = object; - node = node->Next(); + node = node->GetNext(); } } @@ -451,15 +451,15 @@ void wxShape::AddToCanvas(wxShapeCanvas *theCanvas, wxShape *addAfter) void wxShape::InsertInCanvas(wxShapeCanvas *theCanvas) { theCanvas->InsertShape(this); - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); wxShape *lastImage = this; while (node) { - wxShape *object = (wxShape *)node->Data(); + wxShape *object = (wxShape *)node->GetData(); object->AddToCanvas(theCanvas, lastImage); lastImage = object; - node = node->Next(); + node = node->GetNext(); } } @@ -468,24 +468,24 @@ void wxShape::RemoveFromCanvas(wxShapeCanvas *theCanvas) if (Selected()) Select(FALSE); theCanvas->RemoveShape(this); - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *object = (wxShape *)node->Data(); + wxShape *object = (wxShape *)node->GetData(); object->RemoveFromCanvas(theCanvas); - node = node->Next(); + node = node->GetNext(); } } void wxShape::ClearAttachments() { - wxNode *node = m_attachmentPoints.First(); + wxNode *node = m_attachmentPoints.GetFirst(); while (node) { - wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); + wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); delete point; - node = node->Next(); + node = node->GetNext(); } m_attachmentPoints.Clear(); } @@ -498,20 +498,20 @@ void wxShape::ClearText(int regionId) m_text.Clear(); m_text.DeleteContents(FALSE); } - wxNode *node = m_regions.Nth(regionId); + wxNode *node = m_regions.Item(regionId); if (!node) return; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->ClearText(); } void wxShape::ClearRegions() { - wxNode *node = m_regions.First(); + wxNode *node = m_regions.GetFirst(); while (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); - wxNode *next = node->Next(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); + wxNode *next = node->GetNext(); delete region; delete node; node = next; @@ -525,9 +525,9 @@ void wxShape::AddRegion(wxShapeRegion *region) void wxShape::SetDefaultRegionSize() { - wxNode *node = m_regions.First(); + wxNode *node = m_regions.GetFirst(); if (!node) return; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); double w, h; GetBoundingBoxMin(&w, &h); region->SetSize(w, h); @@ -594,13 +594,13 @@ void wxShape::FormatText(wxDC& dc, const wxString& s, int i) double w, h; ClearText(i); - if (m_regions.Number() < 1) + if (m_regions.GetCount() < 1) return; - wxNode *node = m_regions.Nth(i); + wxNode *node = m_regions.Item(i); if (!node) return; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); // region->SetText(s); // don't set the formatted text yet, it will be done below region->m_regionText = s; dc.SetFont(* region->GetFont()); @@ -608,13 +608,13 @@ void wxShape::FormatText(wxDC& dc, const wxString& s, int i) region->GetSize(&w, &h); wxStringList *stringList = oglFormatText(dc, s, (w-5), (h-5), region->GetFormatMode()); - node = stringList->First(); + node = (wxNode*)stringList->GetFirst(); while (node) { - wxChar *s = (wxChar *)node->Data(); + wxChar *s = (wxChar *)node->GetData(); wxShapeTextLine *line = new wxShapeTextLine(0.0, 0.0, s); region->GetFormattedText().Append((wxObject *)line); - node = node->Next(); + node = node->GetNext(); } delete stringList; double actualW = w; @@ -622,8 +622,8 @@ void wxShape::FormatText(wxDC& dc, const wxString& s, int i) // Don't try to resize an object with more than one image (this case should be dealt // with by overriden handlers) if ((region->GetFormatMode() & FORMAT_SIZE_TO_CONTENTS) && - (region->GetFormattedText().Number() > 0) && - (m_regions.Number() == 1) && !GraphicsInSizeToContents) + (region->GetFormattedText().GetCount() > 0) && + (m_regions.GetCount() == 1) && !GraphicsInSizeToContents) { oglGetCentredTextExtent(dc, &(region->GetFormattedText()), m_xpos, m_ypos, w, h, &actualW, &actualH); if ((actualW+m_textMarginX != w ) || (actualH+m_textMarginY != h)) @@ -673,13 +673,13 @@ void wxShape::Recentre(wxDC& dc) double w, h; GetBoundingBoxMin(&w, &h); - int noRegions = m_regions.Number(); + int noRegions = m_regions.GetCount(); for (int i = 0; i < noRegions; i++) { - wxNode *node = m_regions.Nth(i); + wxNode *node = m_regions.Item(i); if (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, w, h, region->GetFormatMode()); } } @@ -720,37 +720,37 @@ wxShape *wxShape::GetTopAncestor() void wxShape::SetFont(wxFont *the_font, int regionId) { m_font = the_font; - wxNode *node = m_regions.Nth(regionId); + wxNode *node = m_regions.Item(regionId); if (!node) return; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->SetFont(the_font); } wxFont *wxShape::GetFont(int n) const { - wxNode *node = m_regions.Nth(n); + wxNode *node = m_regions.Item(n); if (!node) return NULL; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); return region->GetFont(); } void wxShape::SetFormatMode(int mode, int regionId) { - wxNode *node = m_regions.Nth(regionId); + wxNode *node = m_regions.Item(regionId); if (!node) return; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->SetFormatMode(mode); } int wxShape::GetFormatMode(int regionId) const { - wxNode *node = m_regions.Nth(regionId); + wxNode *node = m_regions.Item(regionId); if (!node) return 0; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); return region->GetFormatMode(); } @@ -760,50 +760,50 @@ void wxShape::SetTextColour(const wxString& the_colour, int regionId) m_textColour = wxcolour; m_textColourName = the_colour; - wxNode *node = m_regions.Nth(regionId); + wxNode *node = m_regions.Item(regionId); if (!node) return; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->SetColour(the_colour); } wxString wxShape::GetTextColour(int regionId) const { - wxNode *node = m_regions.Nth(regionId); + wxNode *node = m_regions.Item(regionId); if (!node) return wxEmptyString; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); return region->GetColour(); } void wxShape::SetRegionName(const wxString& name, int regionId) { - wxNode *node = m_regions.Nth(regionId); + wxNode *node = m_regions.Item(regionId); if (!node) return; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->SetName(name); } wxString wxShape::GetRegionName(int regionId) { - wxNode *node = m_regions.Nth(regionId); + wxNode *node = m_regions.Item(regionId); if (!node) return wxEmptyString; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); return region->GetName(); } int wxShape::GetRegionId(const wxString& name) { - wxNode *node = m_regions.First(); + wxNode *node = m_regions.GetFirst(); int i = 0; while (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); if (region->GetName() == name) return i; - node = node->Next(); + node = node->GetNext(); i ++; } return -1; @@ -822,18 +822,18 @@ void wxShape::NameRegions(const wxString& parentName) buff << i; SetRegionName(buff, i); } - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); int j = 0; while (node) { buff.Empty(); - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); if (parentName.Length() > 0) buff << parentName << wxT(".") << j; else buff << j; child->NameRegions(buff); - node = node->Next(); + node = node->GetNext(); j ++; } } @@ -848,14 +848,14 @@ wxShape *wxShape::FindRegion(const wxString& name, int *regionId) return this; } - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); wxShape *actualImage = child->FindRegion(name, regionId); if (actualImage) return actualImage; - node = node->Next(); + node = node->GetNext(); } return NULL; } @@ -871,12 +871,12 @@ void wxShape::FindRegionNames(wxStringList& list) list.Add(name); } - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->FindRegionNames(list); - node = node->Next(); + node = node->GetNext(); } } @@ -884,12 +884,12 @@ void wxShape::AssignNewIds() { // if (m_id == 0) m_id = wxNewId(); - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->AssignNewIds(); - node = node->Next(); + node = node->GetNext(); } } @@ -902,12 +902,12 @@ void wxShape::OnMoveLinks(wxDC& dc) // Want to set the ends of all attached links // to point to/from this object - wxNode *current = m_lines.First(); + wxNode *current = m_lines.GetFirst(); while (current) { - wxLineShape *line = (wxLineShape *)current->Data(); + wxLineShape *line = (wxLineShape *)current->GetData(); line->GetEventHandler()->OnMoveLink(dc); - current = current->Next(); + current = current->GetNext(); } } @@ -916,11 +916,11 @@ void wxShape::OnDrawContents(wxDC& dc) { double bound_x, bound_y; GetBoundingBoxMin(&bound_x, &bound_y); - if (m_regions.Number() < 1) return; + if (m_regions.GetCount() < 1) return; if (m_pen) dc.SetPen(* m_pen); - wxShapeRegion *region = (wxShapeRegion *)m_regions.First()->Data(); + wxShapeRegion *region = (wxShapeRegion *)m_regions.GetFirst()->GetData(); if (region->GetFont()) dc.SetFont(* region->GetFont()); dc.SetTextForeground(* (region->GetActualColourObject())); @@ -960,12 +960,12 @@ void wxShape::OnErase(wxDC& dc) return; // Erase links - wxNode *current = m_lines.First(); + wxNode *current = m_lines.GetFirst(); while (current) { - wxLineShape *line = (wxLineShape *)current->Data(); + wxLineShape *line = (wxLineShape *)current->GetData(); line->GetEventHandler()->OnErase(dc); - current = current->Next(); + current = current->GetNext(); } GetEventHandler()->OnEraseContents(dc); } @@ -999,23 +999,23 @@ void wxShape::EraseLinks(wxDC& dc, int attachment, bool recurse) if (!m_visible) return; - wxNode *current = m_lines.First(); + wxNode *current = m_lines.GetFirst(); while (current) { - wxLineShape *line = (wxLineShape *)current->Data(); + wxLineShape *line = (wxLineShape *)current->GetData(); if (attachment == -1 || ((line->GetTo() == this && line->GetAttachmentTo() == attachment) || (line->GetFrom() == this && line->GetAttachmentFrom() == attachment))) line->GetEventHandler()->OnErase(dc); - current = current->Next(); + current = current->GetNext(); } if (recurse) { - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->EraseLinks(dc, attachment, recurse); - node = node->Next(); + node = node->GetNext(); } } } @@ -1025,24 +1025,24 @@ void wxShape::DrawLinks(wxDC& dc, int attachment, bool recurse) if (!m_visible) return; - wxNode *current = m_lines.First(); + wxNode *current = m_lines.GetFirst(); while (current) { - wxLineShape *line = (wxLineShape *)current->Data(); + wxLineShape *line = (wxLineShape *)current->GetData(); if (attachment == -1 || (line->GetTo() == this && line->GetAttachmentTo() == attachment) || (line->GetFrom() == this && line->GetAttachmentFrom() == attachment)) line->Draw(dc); - current = current->Next(); + current = current->GetNext(); } if (recurse) { - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->DrawLinks(dc, attachment, recurse); - node = node->Next(); + node = node->GetNext(); } } } @@ -1100,11 +1100,11 @@ bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move, wxList newOrdering; // First, add all links to the new list. - wxNode *node = m_lines.First(); + wxNode *node = m_lines.GetFirst(); while (node) { - newOrdering.Append(node->Data()); - node = node->Next(); + newOrdering.Append(node->GetData()); + node = node->GetNext(); } // Delete the line object from the list of links; we're going to move @@ -1114,12 +1114,12 @@ bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move, double old_x = (double) -99999.9; double old_y = (double) -99999.9; - node = newOrdering.First(); + node = newOrdering.GetFirst(); bool found = FALSE; while (!found && node) { - wxLineShape *line = (wxLineShape *)node->Data(); + wxLineShape *line = (wxLineShape *)node->GetData(); if ((line->GetTo() == this && oldAttachment == line->GetAttachmentTo()) || (line->GetFrom() == this && oldAttachment == line->GetAttachmentFrom())) { @@ -1149,7 +1149,7 @@ bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move, old_x = xp; old_y = yp; } - node = node->Next(); + node = node->GetNext(); } if (!found) @@ -1183,36 +1183,36 @@ void wxShape::ApplyAttachmentOrdering(wxList& linesToSort) // This is a temporary store of all the lines. wxList linesStore; - wxNode *node = m_lines.First(); + wxNode *node = m_lines.GetFirst(); while (node) { - wxLineShape *line = (wxLineShape *)node->Data(); + wxLineShape *line = (wxLineShape *)node->GetData(); linesStore.Append(line); - node = node->Next();; + node = node->GetNext();; } m_lines.Clear(); - node = linesToSort.First(); + node = linesToSort.GetFirst(); while (node) { - wxLineShape *line = (wxLineShape *)node->Data(); + wxLineShape *line = (wxLineShape *)node->GetData(); if (linesStore.Member(line)) { // Done this one linesStore.DeleteObject(line); m_lines.Append(line); } - node = node->Next(); + node = node->GetNext(); } // Now add any lines that haven't been listed in linesToSort. - node = linesStore.First(); + node = linesStore.GetFirst(); while (node) { - wxLineShape *line = (wxLineShape *)node->Data(); + wxLineShape *line = (wxLineShape *)node->GetData(); m_lines.Append(line); - node = node->Next(); + node = node->GetNext(); } } @@ -1225,11 +1225,11 @@ void wxShape::SortLines(int attachment, wxList& linesToSort) // point. We'll tick them off as we've processed them. wxList linesAtThisAttachment; - wxNode *node = m_lines.First(); + wxNode *node = m_lines.GetFirst(); while (node) { - wxLineShape *line = (wxLineShape *)node->Data(); - wxNode *next = node->Next(); + wxLineShape *line = (wxLineShape *)node->GetData(); + wxNode *next = node->GetNext(); if ((line->GetTo() == this && line->GetAttachmentTo() == attachment) || (line->GetFrom() == this && line->GetAttachmentFrom() == attachment)) { @@ -1237,29 +1237,29 @@ void wxShape::SortLines(int attachment, wxList& linesToSort) delete node; node = next; } - else node = node->Next(); + else node = node->GetNext(); } - node = linesToSort.First(); + node = linesToSort.GetFirst(); while (node) { - wxLineShape *line = (wxLineShape *)node->Data(); + wxLineShape *line = (wxLineShape *)node->GetData(); if (linesAtThisAttachment.Member(line)) { // Done this one linesAtThisAttachment.DeleteObject(line); m_lines.Append(line); } - node = node->Next(); + node = node->GetNext(); } // Now add any lines that haven't been listed in linesToSort. - node = linesAtThisAttachment.First(); + node = linesAtThisAttachment.GetFirst(); while (node) { - wxLineShape *line = (wxLineShape *)node->Data(); + wxLineShape *line = (wxLineShape *)node->GetData(); m_lines.Append(line); - node = node->Next(); + node = node->GetNext(); } } @@ -1540,12 +1540,12 @@ void wxShape::Flash() void wxShape::Show(bool show) { m_visible = show; - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *image = (wxShape *)node->Data(); + wxShape *image = (wxShape *)node->GetData(); image->Show(show); - node = node->Next(); + node = node->GetNext(); } } @@ -1563,10 +1563,10 @@ void wxShape::EraseContents(wxDC& dc) void wxShape::AddText(const wxString& string) { - wxNode *node = m_regions.First(); + wxNode *node = m_regions.GetFirst(); if (!node) return; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->ClearText(); wxShapeTextLine *new_line = new wxShapeTextLine(0.0, 0.0, string); @@ -1594,13 +1594,13 @@ void wxShape::SetAttachmentSize(double w, double h) scaleY = 1.0; else scaleY = h/height; - wxNode *node = m_attachmentPoints.First(); + wxNode *node = m_attachmentPoints.GetFirst(); while (node) { - wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); + wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); point->m_x = (double)(point->m_x * scaleX); point->m_y = (double)(point->m_y * scaleY); - node = node->Next(); + node = node->GetNext(); } } @@ -1619,9 +1619,9 @@ void wxShape::AddLine(wxLineShape *line, wxShape *other, { // Don't preserve old ordering if we have new ordering instructions m_lines.DeleteObject(line); - if (positionFrom < m_lines.Number()) + if (positionFrom < m_lines.GetCount()) { - wxNode* node = m_lines.Nth(positionFrom); + wxNode* node = m_lines.Item(positionFrom); m_lines.Insert(node, line); } else @@ -1637,9 +1637,9 @@ void wxShape::AddLine(wxLineShape *line, wxShape *other, { // Don't preserve old ordering if we have new ordering instructions other->m_lines.DeleteObject(line); - if (positionTo < other->m_lines.Number()) + if (positionTo < other->m_lines.GetCount()) { - wxNode* node = other->m_lines.Nth(positionTo); + wxNode* node = other->m_lines.Item(positionTo); other->m_lines.Insert(node, line); } else @@ -1654,9 +1654,9 @@ void wxShape::AddLine(wxLineShape *line, wxShape *other, m_lines.Append(line); else { - if (positionFrom < m_lines.Number()) + if (positionFrom < m_lines.GetCount()) { - wxNode* node = m_lines.Nth(positionFrom); + wxNode* node = m_lines.Item(positionFrom); m_lines.Insert(node, line); } else @@ -1667,9 +1667,9 @@ void wxShape::AddLine(wxLineShape *line, wxShape *other, other->m_lines.Append(line); else { - if (positionTo < other->m_lines.Number()) + if (positionTo < other->m_lines.GetCount()) { - wxNode* node = other->m_lines.Nth(positionTo); + wxNode* node = other->m_lines.Item(positionTo); other->m_lines.Insert(node, line); } else @@ -1737,17 +1737,17 @@ void wxShape::WriteAttributes(wxExpr *clause) // Output line ids - int n_lines = m_lines.Number(); + int n_lines = m_lines.GetCount(); if (n_lines > 0) { wxExpr *list = new wxExpr(wxExprList); - wxNode *node = m_lines.First(); + wxNode *node = m_lines.GetFirst(); while (node) { - wxShape *line = (wxShape *)node->Data(); + wxShape *line = (wxShape *)node->GetData(); wxExpr *id_expr = new wxExpr(line->GetId()); list->Append(id_expr); - node = node->Next(); + node = node->GetNext(); } clause->AddAttributeValue("arcs", list); } @@ -1786,19 +1786,19 @@ void wxShape::WriteAttributes(wxExpr *clause) } // Write user-defined attachment points, if any - if (m_attachmentPoints.Number() > 0) + if (m_attachmentPoints.GetCount() > 0) { wxExpr *attachmentList = new wxExpr(wxExprList); - wxNode *node = m_attachmentPoints.First(); + wxNode *node = m_attachmentPoints.GetFirst(); while (node) { - wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); + wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); wxExpr *pointExpr = new wxExpr(wxExprList); pointExpr->Append(new wxExpr((long)point->m_id)); pointExpr->Append(new wxExpr(point->m_x)); pointExpr->Append(new wxExpr(point->m_y)); attachmentList->Append(pointExpr); - node = node->Next(); + node = node->GetNext(); } clause->AddAttributeValue("user_attachments", attachmentList); } @@ -1814,10 +1814,10 @@ void wxShape::WriteRegions(wxExpr *clause) int regionNo = 1; char regionNameBuf[20]; char textNameBuf[20]; - wxNode *node = m_regions.First(); + wxNode *node = m_regions.GetFirst(); while (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); sprintf(regionNameBuf, "region%d", regionNo); sprintf(textNameBuf, "text%d", regionNo); @@ -1854,23 +1854,23 @@ void wxShape::WriteRegions(wxExpr *clause) // text1 = ((x y string) (x y string) ...) wxExpr *textExpr = new wxExpr(wxExprList); - wxNode *textNode = region->m_formattedText.First(); + wxNode *textNode = region->m_formattedText.GetFirst(); while (textNode) { - wxShapeTextLine *line = (wxShapeTextLine *)textNode->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)textNode->GetData(); wxExpr *list2 = new wxExpr(wxExprList); list2->Append(new wxExpr(line->GetX())); list2->Append(new wxExpr(line->GetY())); list2->Append(new wxExpr(wxExprString, line->GetText())); textExpr->Append(list2); - textNode = textNode->Next(); + textNode = textNode->GetNext(); } // Now add both attributes to the clause clause->AddAttributeValue(regionNameBuf, regionExpr); clause->AddAttributeValue(textNameBuf, textExpr); - node = node->Next(); + node = node->GetNext(); regionNo ++; } } @@ -2040,9 +2040,9 @@ void wxShape::ReadAttributes(wxExpr *clause) wxExpr *pointExpr = attachmentList->GetFirst(); while (pointExpr) { - wxExpr *idExpr = pointExpr->Nth(0); - wxExpr *xExpr = pointExpr->Nth(1); - wxExpr *yExpr = pointExpr->Nth(2); + wxExpr *idExpr = pointExpr->Item(0); + wxExpr *xExpr = pointExpr->Item(1); + wxExpr *yExpr = pointExpr->Item(2); if (idExpr && xExpr && yExpr) { wxAttachmentPoint *point = new wxAttachmentPoint; @@ -2104,24 +2104,24 @@ void wxShape::ReadRegions(wxExpr *clause) if (regionExpr->Type() == wxExprList) { - wxExpr *nameExpr = regionExpr->Nth(0); - wxExpr *textExpr = regionExpr->Nth(1); - wxExpr *xExpr = regionExpr->Nth(2); - wxExpr *yExpr = regionExpr->Nth(3); - wxExpr *widthExpr = regionExpr->Nth(4); - wxExpr *heightExpr = regionExpr->Nth(5); - wxExpr *minWidthExpr = regionExpr->Nth(6); - wxExpr *minHeightExpr = regionExpr->Nth(7); - wxExpr *propXExpr = regionExpr->Nth(8); - wxExpr *propYExpr = regionExpr->Nth(9); - wxExpr *formatExpr = regionExpr->Nth(10); - wxExpr *sizeExpr = regionExpr->Nth(11); - wxExpr *familyExpr = regionExpr->Nth(12); - wxExpr *styleExpr = regionExpr->Nth(13); - wxExpr *weightExpr = regionExpr->Nth(14); - wxExpr *colourExpr = regionExpr->Nth(15); - wxExpr *penColourExpr = regionExpr->Nth(16); - wxExpr *penStyleExpr = regionExpr->Nth(17); + wxExpr *nameExpr = regionExpr->Item(0); + wxExpr *textExpr = regionExpr->Item(1); + wxExpr *xExpr = regionExpr->Item(2); + wxExpr *yExpr = regionExpr->Item(3); + wxExpr *widthExpr = regionExpr->Item(4); + wxExpr *heightExpr = regionExpr->Item(5); + wxExpr *minWidthExpr = regionExpr->Item(6); + wxExpr *minHeightExpr = regionExpr->Item(7); + wxExpr *propXExpr = regionExpr->Item(8); + wxExpr *propYExpr = regionExpr->Item(9); + wxExpr *formatExpr = regionExpr->Item(10); + wxExpr *sizeExpr = regionExpr->Item(11); + wxExpr *familyExpr = regionExpr->Item(12); + wxExpr *styleExpr = regionExpr->Item(13); + wxExpr *weightExpr = regionExpr->Item(14); + wxExpr *colourExpr = regionExpr->Item(15); + wxExpr *penColourExpr = regionExpr->Item(16); + wxExpr *penStyleExpr = regionExpr->Item(17); regionName = nameExpr->StringValue(); regionText = textExpr->StringValue(); @@ -2237,21 +2237,21 @@ void wxShape::ReadRegions(wxExpr *clause) // Compatibility: check for no regions (old file). // Lines and divided rectangles must deal with this compatibility // theirselves. Composites _may_ not have any regions anyway. - if ((m_regions.Number() == 0) && + if ((m_regions.GetCount() == 0) && !this->IsKindOf(CLASSINFO(wxLineShape)) && !this->IsKindOf(CLASSINFO(wxDividedShape)) && !this->IsKindOf(CLASSINFO(wxCompositeShape))) { wxShapeRegion *newRegion = new wxShapeRegion; newRegion->SetName("0"); m_regions.Append((wxObject *)newRegion); - if (m_text.Number() > 0) + if (m_text.GetCount() > 0) { newRegion->ClearText(); - wxNode *node = m_text.First(); + wxNode *node = m_text.GetFirst(); while (node) { - wxShapeTextLine *textLine = (wxShapeTextLine *)node->Data(); - wxNode *next = node->Next(); + wxShapeTextLine *textLine = (wxShapeTextLine *)node->GetData(); + wxNode *next = node->GetNext(); newRegion->GetFormattedText().Append((wxObject *)textLine); delete node; node = next; @@ -2298,37 +2298,37 @@ void wxShape::Copy(wxShape& copy) // Copy text regions copy.ClearRegions(); - wxNode *node = m_regions.First(); + wxNode *node = m_regions.GetFirst(); while (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); wxShapeRegion *newRegion = new wxShapeRegion(*region); copy.m_regions.Append(newRegion); - node = node->Next(); + node = node->GetNext(); } // Copy attachments copy.ClearAttachments(); - node = m_attachmentPoints.First(); + node = m_attachmentPoints.GetFirst(); while (node) { - wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); + wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); wxAttachmentPoint *newPoint = new wxAttachmentPoint; newPoint->m_id = point->m_id; newPoint->m_x = point->m_x; newPoint->m_y = point->m_y; copy.m_attachmentPoints.Append((wxObject *)newPoint); - node = node->Next(); + node = node->GetNext(); } // Copy lines copy.m_lines.Clear(); - node = m_lines.First(); + node = m_lines.GetFirst(); while (node) { - wxLineShape* line = (wxLineShape*) node->Data(); + wxLineShape* line = (wxLineShape*) node->GetData(); copy.m_lines.Append(line); - node = node->Next(); + node = node->GetNext(); } } @@ -2436,23 +2436,23 @@ void wxShape::MakeControlPoints() void wxShape::MakeMandatoryControlPoints() { - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->MakeMandatoryControlPoints(); - node = node->Next(); + node = node->GetNext(); } } void wxShape::ResetMandatoryControlPoints() { - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->ResetMandatoryControlPoints(); - node = node->Next(); + node = node->GetNext(); } } @@ -2460,7 +2460,7 @@ void wxShape::ResetControlPoints() { ResetMandatoryControlPoints(); - if (m_controlPoints.Number() < 1) + if (m_controlPoints.GetCount() < 1) return; double maxX, maxY, minX, minY; @@ -2477,55 +2477,55 @@ void wxShape::ResetControlPoints() double left = (double)(- (widthMin / 2.0)); double right = (double)(widthMin / 2.0 + (maxX - minX)); - wxNode *node = m_controlPoints.First(); - wxControlPoint *control = (wxControlPoint *)node->Data(); + wxNode *node = m_controlPoints.GetFirst(); + wxControlPoint *control = (wxControlPoint *)node->GetData(); control->m_xoffset = left; control->m_yoffset = top; - node = node->Next(); control = (wxControlPoint *)node->Data(); + node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = 0; control->m_yoffset = top; - node = node->Next(); control = (wxControlPoint *)node->Data(); + node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = right; control->m_yoffset = top; - node = node->Next(); control = (wxControlPoint *)node->Data(); + node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = right; control->m_yoffset = 0; - node = node->Next(); control = (wxControlPoint *)node->Data(); + node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = right; control->m_yoffset = bottom; - node = node->Next(); control = (wxControlPoint *)node->Data(); + node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = 0; control->m_yoffset = bottom; - node = node->Next(); control = (wxControlPoint *)node->Data(); + node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = left; control->m_yoffset = bottom; - node = node->Next(); control = (wxControlPoint *)node->Data(); + node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = left; control->m_yoffset = 0; } void wxShape::DeleteControlPoints(wxDC *dc) { - wxNode *node = m_controlPoints.First(); + wxNode *node = m_controlPoints.GetFirst(); while (node) { - wxControlPoint *control = (wxControlPoint *)node->Data(); + wxControlPoint *control = (wxControlPoint *)node->GetData(); if (dc) control->GetEventHandler()->OnErase(*dc); m_canvas->RemoveShape(control); delete control; delete node; - node = m_controlPoints.First(); + node = m_controlPoints.GetFirst(); } // Children of divisions are contained objects, // so stop here if (!IsKindOf(CLASSINFO(wxDivisionShape))) { - node = m_children.First(); + node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->DeleteControlPoints(dc); - node = node->Next(); + node = node->GetNext(); } } } @@ -2538,12 +2538,12 @@ void wxShape::OnDrawControlPoints(wxDC& dc) dc.SetBrush(* wxBLACK_BRUSH); dc.SetPen(* wxBLACK_PEN); - wxNode *node = m_controlPoints.First(); + wxNode *node = m_controlPoints.GetFirst(); while (node) { - wxControlPoint *control = (wxControlPoint *)node->Data(); + wxControlPoint *control = (wxControlPoint *)node->GetData(); control->Draw(dc); - node = node->Next(); + node = node->GetNext(); } // Children of divisions are contained objects, // so stop here. @@ -2551,33 +2551,33 @@ void wxShape::OnDrawControlPoints(wxDC& dc) // (critical when drawing) if (!IsKindOf(CLASSINFO(wxDivisionShape))) { - node = m_children.First(); + node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->GetEventHandler()->OnDrawControlPoints(dc); - node = node->Next(); + node = node->GetNext(); } } } void wxShape::OnEraseControlPoints(wxDC& dc) { - wxNode *node = m_controlPoints.First(); + wxNode *node = m_controlPoints.GetFirst(); while (node) { - wxControlPoint *control = (wxControlPoint *)node->Data(); + wxControlPoint *control = (wxControlPoint *)node->GetData(); control->Erase(dc); - node = node->Next(); + node = node->GetNext(); } if (!IsKindOf(CLASSINFO(wxDivisionShape))) { - node = m_children.First(); + node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->GetEventHandler()->OnEraseControlPoints(dc); - node = node->Next(); + node = node->GetNext(); } } } @@ -2592,12 +2592,12 @@ void wxShape::Select(bool select, wxDC* dc) // so stop here if (!IsKindOf(CLASSINFO(wxDivisionShape))) { - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->MakeMandatoryControlPoints(); - node = node->Next(); + node = node->GetNext(); } } if (dc) @@ -2608,12 +2608,12 @@ void wxShape::Select(bool select, wxDC* dc) DeleteControlPoints(dc); if (!IsKindOf(CLASSINFO(wxDivisionShape))) { - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); child->DeleteControlPoints(dc); - node = node->Next(); + node = node->GetNext(); } } } @@ -2638,18 +2638,18 @@ int wxShape::GetNumberOfAttachments() const // Should return the MAXIMUM attachment point id here, // so higher-level functions can iterate through all attachments, // even if they're not contiguous. - if (m_attachmentPoints.Number() == 0) + if (m_attachmentPoints.GetCount() == 0) return 4; else { int maxN = 3; - wxNode *node = m_attachmentPoints.First(); + wxNode *node = m_attachmentPoints.GetFirst(); while (node) { - wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); + wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); if (point->m_id > maxN) maxN = point->m_id; - node = node->Next(); + node = node->GetNext(); } return maxN+1;; } @@ -2657,18 +2657,18 @@ int wxShape::GetNumberOfAttachments() const bool wxShape::AttachmentIsValid(int attachment) const { - if (m_attachmentPoints.Number() == 0) + if (m_attachmentPoints.GetCount() == 0) { return ((attachment >= 0) && (attachment < 4)) ; } - wxNode *node = m_attachmentPoints.First(); + wxNode *node = m_attachmentPoints.GetFirst(); while (node) { - wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); + wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); if (point->m_id == attachment) return TRUE; - node = node->Next(); + node = node->GetNext(); } return FALSE; } @@ -2691,19 +2691,19 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y, } else if (m_attachmentMode == ATTACHMENT_MODE_EDGE) { - if (m_attachmentPoints.Number() > 0) + if (m_attachmentPoints.GetCount() > 0) { - wxNode *node = m_attachmentPoints.First(); + wxNode *node = m_attachmentPoints.GetFirst(); while (node) { - wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); + wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); if (point->m_id == attachment) { *x = (double)(m_xpos + point->m_x); *y = (double)(m_ypos + point->m_y); return TRUE; } - node = node->Next(); + node = node->GetNext(); } *x = m_xpos; *y = m_ypos; return FALSE; @@ -2787,14 +2787,14 @@ bool wxShape::HasDescendant(wxShape *image) { if (image == this) return TRUE; - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); bool ans = child->HasDescendant(image); if (ans) return TRUE; - node = node->Next(); + node = node->GetNext(); } return FALSE; } @@ -2802,13 +2802,13 @@ bool wxShape::HasDescendant(wxShape *image) // Clears points from a list of wxRealPoints, and clears list void wxShape::ClearPointList(wxList& list) { - wxNode* node = list.First(); + wxNode* node = list.GetFirst(); while (node) { - wxRealPoint* pt = (wxRealPoint*) node->Data(); + wxRealPoint* pt = (wxRealPoint*) node->GetData(); delete pt; - node = node->Next(); + node = node->GetNext(); } list.Clear(); } @@ -2903,8 +2903,8 @@ wxRealPoint wxShape::CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPo int wxShape::GetLinePosition(wxLineShape* line) { int i = 0; - for (i = 0; i < m_lines.Number(); i++) - if ((wxLineShape*) (m_lines.Nth(i)->Data()) == line) + for (i = 0; i < m_lines.GetCount(); i++) + if ((wxLineShape*) (m_lines.Item(i)->GetData()) == line) return i; return 0; @@ -3059,16 +3059,16 @@ bool wxShape::GetBranchingAttachmentPoint(int attachment, int n, wxRealPoint& pt int wxShape::GetAttachmentLineCount(int attachment) const { int count = 0; - wxNode* node = m_lines.First(); + wxNode* node = m_lines.GetFirst(); while (node) { - wxLineShape* lineShape = (wxLineShape*) node->Data(); + wxLineShape* lineShape = (wxLineShape*) node->GetData(); if ((lineShape->GetFrom() == this) && (lineShape->GetAttachmentFrom() == attachment)) count ++; else if ((lineShape->GetTo() == this) && (lineShape->GetAttachmentTo() == attachment)) count ++; - node = node->Next(); + node = node->GetNext(); } return count; } diff --git a/contrib/src/ogl/basic2.cpp b/contrib/src/ogl/basic2.cpp index d8a59bc725..78f571e790 100644 --- a/contrib/src/ogl/basic2.cpp +++ b/contrib/src/ogl/basic2.cpp @@ -71,13 +71,13 @@ void wxPolygonShape::Create(wxList *the_points) // Duplicate the list of points m_points = new wxList; - wxNode *node = the_points->First(); + wxNode *node = the_points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *new_point = new wxRealPoint(point->x, point->y); m_points->Append((wxObject*) new_point); - node = node->Next(); + node = node->GetNext(); } CalculateBoundingBox(); m_originalWidth = m_boundWidth; @@ -94,26 +94,26 @@ void wxPolygonShape::ClearPoints() { if (m_points) { - wxNode *node = m_points->First(); + wxNode *node = m_points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); delete point; delete node; - node = m_points->First(); + node = m_points->GetFirst(); } delete m_points; m_points = NULL; } if (m_originalPoints) { - wxNode *node = m_originalPoints->First(); + wxNode *node = m_originalPoints->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); delete point; delete node; - node = m_originalPoints->First(); + node = m_originalPoints->GetFirst(); } delete m_originalPoints; m_originalPoints = NULL; @@ -136,17 +136,17 @@ void wxPolygonShape::CalculateBoundingBox() double top = 10000; double bottom = -10000; - wxNode *node = m_points->First(); + wxNode *node = m_points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); if (point->x < left) left = point->x; if (point->x > right) right = point->x; if (point->y < top) top = point->y; if (point->y > bottom) bottom = point->y; - node = node->Next(); + node = node->GetNext(); } m_boundWidth = right - left; m_boundHeight = bottom - top; @@ -164,17 +164,17 @@ void wxPolygonShape::CalculatePolygonCentre() double top = 10000; double bottom = -10000; - wxNode *node = m_points->First(); + wxNode *node = m_points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); if (point->x < left) left = point->x; if (point->x > right) right = point->x; if (point->y < top) top = point->y; if (point->y > bottom) bottom = point->y; - node = node->Next(); + node = node->GetNext(); } double bwidth = right - left; double bheight = bottom - top; @@ -182,13 +182,13 @@ void wxPolygonShape::CalculatePolygonCentre() double newCentreX = (double)(left + (bwidth/2.0)); double newCentreY = (double)(top + (bheight/2.0)); - node = m_points->First(); + node = m_points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); point->x -= newCentreX; point->y -= newCentreY; - node = node->Next(); + node = node->GetNext(); } m_xpos += newCentreX; m_ypos += newCentreY; @@ -260,17 +260,17 @@ bool wxPolygonShape::HitTest(double x, double y, int *attachment, double *distan endPointsY[3] = y; // Store polygon points in an array - int np = m_points->Number(); + int np = m_points->GetCount(); double *xpoints = new double[np]; double *ypoints = new double[np]; - wxNode *node = m_points->First(); + wxNode *node = m_points->GetFirst(); int i = 0; while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); xpoints[i] = point->x + m_xpos; ypoints[i] = point->y + m_ypos; - node = node->Next(); + node = node->GetNext(); i ++; } @@ -331,18 +331,18 @@ void wxPolygonShape::SetSize(double new_width, double new_height, bool recursive double x_proportion = (double)(fabs(new_width/m_originalWidth)); double y_proportion = (double)(fabs(new_height/m_originalHeight)); - wxNode *node = m_points->First(); - wxNode *original_node = m_originalPoints->First(); + wxNode *node = m_points->GetFirst(); + wxNode *original_node = m_originalPoints->GetFirst(); while (node && original_node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); - wxRealPoint *original_point = (wxRealPoint *)original_node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); + wxRealPoint *original_point = (wxRealPoint *)original_node->GetData(); point->x = (original_point->x * x_proportion); point->y = (original_point->y * y_proportion); - node = node->Next(); - original_node = original_node->Next(); + node = node->GetNext(); + original_node = original_node->GetNext(); } // CalculateBoundingBox(); @@ -355,25 +355,25 @@ void wxPolygonShape::SetSize(double new_width, double new_height, bool recursive void wxPolygonShape::UpdateOriginalPoints() { if (!m_originalPoints) m_originalPoints = new wxList; - wxNode *original_node = m_originalPoints->First(); + wxNode *original_node = m_originalPoints->GetFirst(); while (original_node) { - wxNode *next_node = original_node->Next(); - wxRealPoint *original_point = (wxRealPoint *)original_node->Data(); + wxNode *next_node = original_node->GetNext(); + wxRealPoint *original_point = (wxRealPoint *)original_node->GetData(); delete original_point; delete original_node; original_node = next_node; } - wxNode *node = m_points->First(); + wxNode *node = m_points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *original_point = new wxRealPoint(point->x, point->y); m_originalPoints->Append((wxObject*) original_point); - node = node->Next(); + node = node->GetNext(); } CalculateBoundingBox(); m_originalWidth = m_boundWidth; @@ -382,19 +382,19 @@ void wxPolygonShape::UpdateOriginalPoints() void wxPolygonShape::AddPolygonPoint(int pos) { - wxNode *node = m_points->Nth(pos); - if (!node) node = m_points->First(); - wxRealPoint *firstPoint = (wxRealPoint *)node->Data(); + wxNode *node = m_points->Item(pos); + if (!node) node = m_points->GetFirst(); + wxRealPoint *firstPoint = (wxRealPoint *)node->GetData(); - wxNode *node2 = m_points->Nth(pos + 1); - if (!node2) node2 = m_points->First(); - wxRealPoint *secondPoint = (wxRealPoint *)node2->Data(); + wxNode *node2 = m_points->Item(pos + 1); + if (!node2) node2 = m_points->GetFirst(); + wxRealPoint *secondPoint = (wxRealPoint *)node2->GetData(); double x = (double)((secondPoint->x - firstPoint->x)/2.0 + firstPoint->x); double y = (double)((secondPoint->y - firstPoint->y)/2.0 + firstPoint->y); wxRealPoint *point = new wxRealPoint(x, y); - if (pos >= (m_points->Number() - 1)) + if (pos >= (m_points->GetCount() - 1)) m_points->Append((wxObject*) point); else m_points->Insert(node2, (wxObject*) point); @@ -410,10 +410,10 @@ void wxPolygonShape::AddPolygonPoint(int pos) void wxPolygonShape::DeletePolygonPoint(int pos) { - wxNode *node = m_points->Nth(pos); + wxNode *node = m_points->Item(pos); if (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); delete point; delete node; UpdateOriginalPoints(); @@ -430,7 +430,7 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1, double x2, double y2, double *x3, double *y3) { - int n = m_points->Number(); + int n = m_points->GetCount(); // First check for situation where the line is vertical, // and we would want to connect to a point on that vertical -- @@ -440,10 +440,10 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1, { // Look for the point we'd be connecting to. This is // a heuristic... - wxNode *node = m_points->First(); + wxNode *node = m_points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); if (point->x == 0.0) { if ((y2 > y1) && (point->y > 0.0)) @@ -459,21 +459,21 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1, return TRUE; } } - node = node->Next(); + node = node->GetNext(); } } double *xpoints = new double[n]; double *ypoints = new double[n]; - wxNode *node = m_points->First(); + wxNode *node = m_points->GetFirst(); int i = 0; while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); xpoints[i] = point->x + m_xpos; ypoints[i] = point->y + m_ypos; - node = node->Next(); + node = node->GetNext(); i ++; } @@ -488,12 +488,12 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1, void wxPolygonShape::OnDraw(wxDC& dc) { - int n = m_points->Number(); + int n = m_points->GetCount(); wxPoint *intPoints = new wxPoint[n]; int i; for (i = 0; i < n; i++) { - wxRealPoint* point = (wxRealPoint*) m_points->Nth(i)->Data(); + wxRealPoint* point = (wxRealPoint*) m_points->Item(i)->GetData(); intPoints[i].x = WXROUND(point->x); intPoints[i].y = WXROUND(point->y); } @@ -528,12 +528,12 @@ void wxPolygonShape::OnDrawOutline(wxDC& dc, double x, double y, double w, doubl double x_proportion = (double)(fabs(w/m_originalWidth)); double y_proportion = (double)(fabs(h/m_originalHeight)); - int n = m_originalPoints->Number(); + int n = m_originalPoints->GetCount(); wxPoint *intPoints = new wxPoint[n]; int i; for (i = 0; i < n; i++) { - wxRealPoint* point = (wxRealPoint*) m_originalPoints->Nth(i)->Data(); + wxRealPoint* point = (wxRealPoint*) m_originalPoints->Item(i)->GetData(); intPoints[i].x = WXROUND(x_proportion * point->x); intPoints[i].y = WXROUND(y_proportion * point->y); } @@ -544,33 +544,33 @@ void wxPolygonShape::OnDrawOutline(wxDC& dc, double x, double y, double w, doubl // Make as many control points as there are vertices. void wxPolygonShape::MakeControlPoints() { - wxNode *node = m_points->First(); + wxNode *node = m_points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); wxPolygonControlPoint *control = new wxPolygonControlPoint(m_canvas, this, CONTROL_POINT_SIZE, point, point->x, point->y); m_canvas->AddShape(control); m_controlPoints.Append(control); - node = node->Next(); + node = node->GetNext(); } } void wxPolygonShape::ResetControlPoints() { - wxNode *node = m_points->First(); - wxNode *controlPointNode = m_controlPoints.First(); + wxNode *node = m_points->GetFirst(); + wxNode *controlPointNode = m_controlPoints.GetFirst(); while (node && controlPointNode) { - wxRealPoint *point = (wxRealPoint *)node->Data(); - wxPolygonControlPoint *controlPoint = (wxPolygonControlPoint *)controlPointNode->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); + wxPolygonControlPoint *controlPoint = (wxPolygonControlPoint *)controlPointNode->GetData(); controlPoint->m_xoffset = point->x; controlPoint->m_yoffset = point->y; controlPoint->m_polygonVertex = point; - node = node->Next(); - controlPointNode = controlPointNode->Next(); + node = node->GetNext(); + controlPointNode = controlPointNode->GetNext(); } } @@ -585,10 +585,10 @@ void wxPolygonShape::WriteAttributes(wxExpr *clause) // Make a list of lists for the coordinates wxExpr *list = new wxExpr(wxExprList); - wxNode *node = m_points->First(); + wxNode *node = m_points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); wxExpr *point_list = new wxExpr(wxExprList); wxExpr *x_expr = new wxExpr((double)point->x); wxExpr *y_expr = new wxExpr((double)point->y); @@ -597,16 +597,16 @@ void wxPolygonShape::WriteAttributes(wxExpr *clause) point_list->Append(y_expr); list->Append(point_list); - node = node->Next(); + node = node->GetNext(); } clause->AddAttributeValue(wxT("points"), list); // Save the original (unscaled) points list = new wxExpr(wxExprList); - node = m_originalPoints->First(); + node = m_originalPoints->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); wxExpr *point_list = new wxExpr(wxExprList); wxExpr *x_expr = new wxExpr((double) point->x); wxExpr *y_expr = new wxExpr((double) point->y); @@ -614,7 +614,7 @@ void wxPolygonShape::WriteAttributes(wxExpr *clause) point_list->Append(y_expr); list->Append(point_list); - node = node->Next(); + node = node->GetNext(); } clause->AddAttributeValue(wxT("m_originalPoints"), list); } @@ -743,21 +743,21 @@ void wxPolygonShape::Copy(wxShape& copy) polyCopy.m_points = new wxList; polyCopy.m_originalPoints = new wxList; - wxNode *node = m_points->First(); + wxNode *node = m_points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *new_point = new wxRealPoint(point->x, point->y); polyCopy.m_points->Append((wxObject*) new_point); - node = node->Next(); + node = node->GetNext(); } - node = m_originalPoints->First(); + node = m_originalPoints->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *new_point = new wxRealPoint(point->x, point->y); polyCopy.m_originalPoints->Append((wxObject*) new_point); - node = node->Next(); + node = node->GetNext(); } polyCopy.m_boundWidth = m_boundWidth; polyCopy.m_boundHeight = m_boundHeight; @@ -767,14 +767,14 @@ void wxPolygonShape::Copy(wxShape& copy) int wxPolygonShape::GetNumberOfAttachments() const { - int maxN = (m_points ? (m_points->Number() - 1) : 0); - wxNode *node = m_attachmentPoints.First(); + int maxN = (m_points ? (m_points->GetCount() - 1) : 0); + wxNode *node = m_attachmentPoints.GetFirst(); while (node) { - wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); + wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); if (point->m_id > maxN) maxN = point->m_id; - node = node->Next(); + node = node->GetNext(); } return maxN+1;; } @@ -782,9 +782,9 @@ int wxPolygonShape::GetNumberOfAttachments() const bool wxPolygonShape::GetAttachmentPosition(int attachment, double *x, double *y, int nth, int no_arcs, wxLineShape *line) { - if ((m_attachmentMode == ATTACHMENT_MODE_EDGE) && m_points && attachment < m_points->Number()) + if ((m_attachmentMode == ATTACHMENT_MODE_EDGE) && m_points && attachment < m_points->GetCount()) { - wxRealPoint *point = (wxRealPoint *)m_points->Nth(attachment)->Data(); + wxRealPoint *point = (wxRealPoint *)m_points->Item(attachment)->GetData(); *x = point->x + m_xpos; *y = point->y + m_ypos; return TRUE; @@ -798,16 +798,16 @@ bool wxPolygonShape::AttachmentIsValid(int attachment) if (!m_points) return FALSE; - if ((attachment >= 0) && (attachment < m_points->Number())) + if ((attachment >= 0) && (attachment < m_points->GetCount())) return TRUE; - wxNode *node = m_attachmentPoints.First(); + wxNode *node = m_attachmentPoints.GetFirst(); while (node) { - wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); + wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); if (point->m_id == attachment) return TRUE; - node = node->Next(); + node = node->GetNext(); } return FALSE; } @@ -820,36 +820,36 @@ void wxPolygonShape::Rotate(double x, double y, double theta) // Rotate attachment points double sinTheta = (double)sin(actualTheta); double cosTheta = (double)cos(actualTheta); - wxNode *node = m_attachmentPoints.First(); + wxNode *node = m_attachmentPoints.GetFirst(); while (node) { - wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); + wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); double x1 = point->m_x; double y1 = point->m_y; point->m_x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta; point->m_y = x1*sinTheta + y1*cosTheta + y*(1.0 - cosTheta) + x*sinTheta; - node = node->Next(); + node = node->GetNext(); } - node = m_points->First(); + node = m_points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); double x1 = point->x; double y1 = point->y; point->x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta; point->y = x1*sinTheta + y1*cosTheta + y*(1.0 - cosTheta) + x*sinTheta; - node = node->Next(); + node = node->GetNext(); } - node = m_originalPoints->First(); + node = m_originalPoints->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); double x1 = point->x; double y1 = point->y; point->x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta; point->y = x1*sinTheta + y1*cosTheta + y*(1.0 - cosTheta) + x*sinTheta; - node = node->Next(); + node = node->GetNext(); } m_rotation = theta; @@ -955,9 +955,9 @@ void wxRectangleShape::ReadAttributes(wxExpr *clause) clause->AssignAttributeValue(wxT("corner"), &m_cornerRadius); // In case we're reading an old file, set the region's size - if (m_regions.Number() == 1) + if (m_regions.GetCount() == 1) { - wxShapeRegion *region = (wxShapeRegion *)m_regions.First()->Data(); + wxShapeRegion *region = (wxShapeRegion *)m_regions.GetFirst()->GetData(); region->SetSize(m_width, m_height); } } @@ -1092,9 +1092,9 @@ void wxEllipseShape::ReadAttributes(wxExpr *clause) clause->AssignAttributeValue(wxT("height"), &m_height); // In case we're reading an old file, set the region's size - if (m_regions.Number() == 1) + if (m_regions.GetCount() == 1) { - wxShapeRegion *region = (wxShapeRegion *)m_regions.First()->Data(); + wxShapeRegion *region = (wxShapeRegion *)m_regions.GetFirst()->GetData(); region->SetSize(m_width, m_height); } } @@ -1566,7 +1566,7 @@ void wxShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, int ke */ // Recursively redraw links if we have a composite. - if (theObject->GetChildren().Number() > 0) + if (theObject->GetChildren().GetCount() > 0) theObject->DrawLinks(dc, -1, TRUE); double width, height; @@ -1798,14 +1798,14 @@ wxShapeRegion::wxShapeRegion(wxShapeRegion& region) m_penColour = region.m_penColour; ClearText(); - wxNode *node = region.m_formattedText.First(); + wxNode *node = region.m_formattedText.GetFirst(); while (node) { - wxShapeTextLine *line = (wxShapeTextLine *)node->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)node->GetData(); wxShapeTextLine *new_line = new wxShapeTextLine(line->GetX(), line->GetY(), line->GetText()); m_formattedText.Append(new_line); - node = node->Next(); + node = node->GetNext(); } } @@ -1816,11 +1816,11 @@ wxShapeRegion::~wxShapeRegion() void wxShapeRegion::ClearText() { - wxNode *node = m_formattedText.First(); + wxNode *node = m_formattedText.GetFirst(); while (node) { - wxShapeTextLine *line = (wxShapeTextLine *)node->Data(); - wxNode *next = node->Next(); + wxShapeTextLine *line = (wxShapeTextLine *)node->GetData(); + wxNode *next = node->GetNext(); delete line; delete node; node = next; diff --git a/contrib/src/ogl/canvas.cpp b/contrib/src/ogl/canvas.cpp index 55e87da514..0620c416b0 100644 --- a/contrib/src/ogl/canvas.cpp +++ b/contrib/src/ogl/canvas.cpp @@ -397,10 +397,10 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn // the other objects // (b) to find the control points FIRST if they exist - wxNode *current = GetDiagram()->GetShapeList()->Last(); + wxNode *current = GetDiagram()->GetShapeList()->GetLast(); while (current) { - wxShape *object = (wxShape *)current->Data(); + wxShape *object = (wxShape *)current->GetData(); double dist; int temp_attachment; @@ -430,13 +430,13 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn } } if (current) - current = current->Previous(); + current = current->GetPrevious(); } - current = GetDiagram()->GetShapeList()->Last(); + current = GetDiagram()->GetShapeList()->GetLast(); while (current) { - wxShape *object = (wxShape *)current->Data(); + wxShape *object = (wxShape *)current->GetData(); double dist; int temp_attachment; @@ -461,7 +461,7 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn } } if (current) - current = current->Previous(); + current = current->GetPrevious(); } *attachment = nearest_attachment; diff --git a/contrib/src/ogl/composit.cpp b/contrib/src/ogl/composit.cpp index 7834012aaf..479452f4cc 100644 --- a/contrib/src/ogl/composit.cpp +++ b/contrib/src/ogl/composit.cpp @@ -74,18 +74,18 @@ wxCompositeShape::wxCompositeShape(): wxRectangleShape(10.0, 10.0) wxCompositeShape::~wxCompositeShape() { - wxNode *node = m_constraints.First(); + wxNode *node = m_constraints.GetFirst(); while (node) { - wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); + wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData(); delete constraint; - node = node->Next(); + node = node->GetNext(); } - node = m_children.First(); + node = m_children.GetFirst(); while (node) { - wxShape *object = (wxShape *)node->Data(); - wxNode *next = node->Next(); + wxShape *object = (wxShape *)node->GetData(); + wxNode *next = node->GetNext(); object->Unlink(); delete object; node = next; @@ -113,13 +113,13 @@ void wxCompositeShape::OnDraw(wxDC& dc) void wxCompositeShape::OnDrawContents(wxDC& dc) { - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *object = (wxShape *)node->Data(); + wxShape *object = (wxShape *)node->GetData(); object->Draw(dc); object->DrawLinks(dc); - node = node->Next(); + node = node->GetNext(); } wxShape::OnDrawContents(dc); } @@ -128,15 +128,15 @@ bool wxCompositeShape::OnMovePre(wxDC& dc, double x, double y, double oldx, doub { double diffX = x - oldx; double diffY = y - oldy; - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *object = (wxShape *)node->Data(); + wxShape *object = (wxShape *)node->GetData(); object->Erase(dc); object->Move(dc, object->GetX() + diffX, object->GetY() + diffY, display); - node = node->Next(); + node = node->GetNext(); } return TRUE; } @@ -144,12 +144,12 @@ bool wxCompositeShape::OnMovePre(wxDC& dc, double x, double y, double oldx, doub void wxCompositeShape::OnErase(wxDC& dc) { wxRectangleShape::OnErase(dc); - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *object = (wxShape *)node->Data(); + wxShape *object = (wxShape *)node->GetData(); object->Erase(dc); - node = node->Next(); + node = node->GetNext(); } } @@ -237,11 +237,11 @@ void wxCompositeShape::OnRightClick(double x, double y, int keys, int attachment // the division, so we can invoke a user interface for dealing with regions. if (keys & KEY_CTRL) { - wxNode *node = m_divisions.First(); + wxNode *node = m_divisions.GetFirst(); while (node) { - wxDivisionShape *division = (wxDivisionShape *)node->Data(); - wxNode *next = node->Next(); + wxDivisionShape *division = (wxDivisionShape *)node->GetData(); + wxNode *next = node->GetNext(); int attach = 0; double dist = 0.0; if (division->HitTest(x, y, &attach, &dist)) @@ -267,7 +267,7 @@ void wxCompositeShape::SetSize(double w, double h, bool recursive) if (!recursive) return; - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); @@ -275,7 +275,7 @@ void wxCompositeShape::SetSize(double w, double h, bool recursive) double xBound, yBound; while (node) { - wxShape *object = (wxShape *)node->Data(); + wxShape *object = (wxShape *)node->GetData(); // Scale the position first double newX = (double)(((object->GetX() - GetX())*xScale) + GetX()); @@ -289,7 +289,7 @@ void wxCompositeShape::SetSize(double w, double h, bool recursive) object->SetSize(object->GetFixedWidth() ? xBound : xScale*xBound, object->GetFixedHeight() ? yBound : yScale*yBound); - node = node->Next(); + node = node->GetNext(); } SetDefaultRegionSize(); } @@ -317,11 +317,11 @@ void wxCompositeShape::RemoveChild(wxShape *child) void wxCompositeShape::DeleteConstraintsInvolvingChild(wxShape *child) { - wxNode *node = m_constraints.First(); + wxNode *node = m_constraints.GetFirst(); while (node) { - wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); - wxNode *nextNode = node->Next(); + wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData(); + wxNode *nextNode = node->GetNext(); if ((constraint->m_constrainingObject == child) || constraint->m_constrainedObjects.Member(child)) @@ -335,11 +335,11 @@ void wxCompositeShape::DeleteConstraintsInvolvingChild(wxShape *child) void wxCompositeShape::RemoveChildFromConstraints(wxShape *child) { - wxNode *node = m_constraints.First(); + wxNode *node = m_constraints.GetFirst(); while (node) { - wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); - wxNode *nextNode = node->Next(); + wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData(); + wxNode *nextNode = node->GetNext(); if (constraint->m_constrainedObjects.Member(child)) constraint->m_constrainedObjects.DeleteObject(child); @@ -369,10 +369,10 @@ void wxCompositeShape::Copy(wxShape& copy) oglObjectCopyMapping.Append((long)this, &compositeCopy); // Copy the children - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *object = (wxShape *)node->Data(); + wxShape *object = (wxShape *)node->GetData(); wxShape *newObject = object->CreateNewCopy(FALSE, FALSE); if (newObject->GetId() == 0) newObject->SetId(wxNewId()); @@ -386,25 +386,25 @@ void wxCompositeShape::Copy(wxShape& copy) oglObjectCopyMapping.Append((long)object, newObject); - node = node->Next(); + node = node->GetNext(); } // Copy the constraints - node = m_constraints.First(); + node = m_constraints.GetFirst(); while (node) { - wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); + wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData(); - wxShape *newConstraining = (wxShape *)(oglObjectCopyMapping.Find((long)constraint->m_constrainingObject)->Data()); + wxShape *newConstraining = (wxShape *)(oglObjectCopyMapping.Find((long)constraint->m_constrainingObject)->GetData()); wxList newConstrainedList; - wxNode *node2 = constraint->m_constrainedObjects.First(); + wxNode *node2 = constraint->m_constrainedObjects.GetFirst(); while (node2) { - wxShape *constrainedObject = (wxShape *)node2->Data(); - wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->Data()); + wxShape *constrainedObject = (wxShape *)node2->GetData(); + wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->GetData()); newConstrainedList.Append(newConstrained); - node2 = node2->Next(); + node2 = node2->GetNext(); } wxOGLConstraint *newConstraint = new wxOGLConstraint(constraint->m_constraintType, newConstraining, @@ -417,14 +417,14 @@ void wxCompositeShape::Copy(wxShape& copy) newConstraint->SetSpacing(constraint->m_xSpacing, constraint->m_ySpacing); compositeCopy.m_constraints.Append(newConstraint); - node = node->Next(); + node = node->GetNext(); } // Now compositeCopy the division geometry - node = m_divisions.First(); + node = m_divisions.GetFirst(); while (node) { - wxDivisionShape *division = (wxDivisionShape *)node->Data(); + wxDivisionShape *division = (wxDivisionShape *)node->GetData(); wxNode *node1 = oglObjectCopyMapping.Find((long)division); wxNode *leftNode = NULL; wxNode *topNode = NULL; @@ -440,17 +440,17 @@ void wxCompositeShape::Copy(wxShape& copy) bottomNode = oglObjectCopyMapping.Find((long)division->GetBottomSide()); if (node1) { - wxDivisionShape *newDivision = (wxDivisionShape *)node1->Data(); + wxDivisionShape *newDivision = (wxDivisionShape *)node1->GetData(); if (leftNode) - newDivision->SetLeftSide((wxDivisionShape *)leftNode->Data()); + newDivision->SetLeftSide((wxDivisionShape *)leftNode->GetData()); if (topNode) - newDivision->SetTopSide((wxDivisionShape *)topNode->Data()); + newDivision->SetTopSide((wxDivisionShape *)topNode->GetData()); if (rightNode) - newDivision->SetRightSide((wxDivisionShape *)rightNode->Data()); + newDivision->SetRightSide((wxDivisionShape *)rightNode->GetData()); if (bottomNode) - newDivision->SetBottomSide((wxDivisionShape *)bottomNode->Data()); + newDivision->SetBottomSide((wxDivisionShape *)bottomNode->GetData()); } - node = node->Next(); + node = node->GetNext(); } } @@ -484,23 +484,23 @@ wxOGLConstraint *wxCompositeShape::AddConstraint(int type, wxShape *constraining wxOGLConstraint *wxCompositeShape::FindConstraint(long cId, wxCompositeShape **actualComposite) { - wxNode *node = m_constraints.First(); + wxNode *node = m_constraints.GetFirst(); while (node) { - wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); + wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData(); if (constraint->m_constraintId == cId) { if (actualComposite) *actualComposite = this; return constraint; } - node = node->Next(); + node = node->GetNext(); } // If not found, try children. - node = m_children.First(); + node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); if (child->IsKindOf(CLASSINFO(wxCompositeShape))) { wxOGLConstraint *constraint = ((wxCompositeShape *)child)->FindConstraint(cId, actualComposite); @@ -511,7 +511,7 @@ wxOGLConstraint *wxCompositeShape::FindConstraint(long cId, wxCompositeShape **a return constraint; } } - node = node->Next(); + node = node->GetNext(); } return NULL; } @@ -530,10 +530,10 @@ void wxCompositeShape::CalculateSize() double minY = (double) 999999.9; double w, h; - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *object = (wxShape *)node->Data(); + wxShape *object = (wxShape *)node->GetData(); // Recalculate size of composite objects because may not conform // to size it was set to - depends on the children. @@ -549,7 +549,7 @@ void wxCompositeShape::CalculateSize() if ((object->GetY() - (h/2.0)) < minY) minY = (double)(object->GetY() - (h/2.0)); - node = node->Next(); + node = node->GetNext(); } m_width = maxX - minX; m_height = maxY - minY; @@ -580,21 +580,21 @@ bool wxCompositeShape::Constrain() CalculateSize(); bool changed = FALSE; - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *object = (wxShape *)node->Data(); + wxShape *object = (wxShape *)node->GetData(); if (object->Constrain()) changed = TRUE; - node = node->Next(); + node = node->GetNext(); } - node = m_constraints.First(); + node = m_constraints.GetFirst(); while (node) { - wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); + wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData(); if (constraint->Evaluate()) changed = TRUE; - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -609,10 +609,10 @@ void wxCompositeShape::WriteAttributes(wxExpr *clause) // Output constraints as constraint1 = (...), constraint2 = (...), etc. int constraintNo = 1; char m_constraintNameBuf[20]; - wxNode *node = m_constraints.First(); + wxNode *node = m_constraints.GetFirst(); while (node) { - wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); + wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData(); sprintf(m_constraintNameBuf, "constraint%d", constraintNo); // Each constraint is stored in the form @@ -626,42 +626,42 @@ void wxCompositeShape::WriteAttributes(wxExpr *clause) constraintExpr->Append(new wxExpr(constraint->m_constrainingObject->GetId())); wxExpr *objectList = new wxExpr(wxExprList); - wxNode *node1 = constraint->m_constrainedObjects.First(); + wxNode *node1 = constraint->m_constrainedObjects.GetFirst(); while (node1) { - wxShape *obj = (wxShape *)node1->Data(); + wxShape *obj = (wxShape *)node1->GetData(); objectList->Append(new wxExpr(obj->GetId())); - node1 = node1->Next(); + node1 = node1->GetNext(); } constraintExpr->Append(objectList); clause->AddAttributeValue(m_constraintNameBuf, constraintExpr); - node = node->Next(); + node = node->GetNext(); constraintNo ++; } // Write the ids of all the child images wxExpr *childrenExpr = new wxExpr(wxExprList); - node = m_children.First(); + node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); childrenExpr->Append(new wxExpr(child->GetId())); - node = node->Next(); + node = node->GetNext(); } clause->AddAttributeValue("children", childrenExpr); // Write the ids of all the division images - if (m_divisions.Number() > 0) + if (m_divisions.GetCount() > 0) { wxExpr *divisionsExpr = new wxExpr(wxExprList); - node = m_divisions.First(); + node = m_divisions.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); divisionsExpr->Append(new wxExpr(child->GetId())); - node = node->Next(); + node = node->GetNext(); } clause->AddAttributeValue("divisions", divisionsExpr); } @@ -706,13 +706,13 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database) // Each constraint is stored in the form // (type name id xspacing yspacing m_constrainingObjectId constrainedObjectIdList) - wxExpr *typeExpr = constraintExpr->Nth(0); - wxExpr *nameExpr = constraintExpr->Nth(1); - wxExpr *idExpr = constraintExpr->Nth(2); - wxExpr *xExpr = constraintExpr->Nth(3); - wxExpr *yExpr = constraintExpr->Nth(4); - wxExpr *constrainingExpr = constraintExpr->Nth(5); - wxExpr *constrainedExpr = constraintExpr->Nth(6); + wxExpr *typeExpr = constraintExpr->Item(0); + wxExpr *nameExpr = constraintExpr->Item(1); + wxExpr *idExpr = constraintExpr->Item(2); + wxExpr *xExpr = constraintExpr->Item(3); + wxExpr *yExpr = constraintExpr->Item(4); + wxExpr *constrainingExpr = constraintExpr->Item(5); + wxExpr *constrainedExpr = constraintExpr->Item(6); cType = (int)typeExpr->IntegerValue(); cXSpacing = xExpr->RealValue(); @@ -727,7 +727,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database) wxLogFatalError(wxT("Object graphics error: Couldn't find constraining image of composite.")); int i = 0; - wxExpr *currentIdExpr = constrainedExpr->Nth(i); + wxExpr *currentIdExpr = constrainedExpr->Item(i); while (currentIdExpr) { long currentId = currentIdExpr->IntegerValue(); @@ -742,7 +742,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database) } i ++; - currentIdExpr = constrainedExpr->Nth(i); + currentIdExpr = constrainedExpr->Item(i); } wxOGLConstraint *newConstraint = AddConstraint(cType, m_constrainingObject, m_constrainedObjects); newConstraint->SetSpacing(cXSpacing, cYSpacing); @@ -777,13 +777,13 @@ wxDivisionShape *wxCompositeShape::OnCreateDivision() wxShape *wxCompositeShape::FindContainerImage() { - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); if (!m_divisions.Member(child)) return child; - node = node->Next(); + node = node->GetNext(); } return NULL; } @@ -793,17 +793,17 @@ bool wxCompositeShape::ContainsDivision(wxDivisionShape *division) { if (m_divisions.Member(division)) return TRUE; - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *child = (wxShape *)node->Data(); + wxShape *child = (wxShape *)node->GetData(); if (child->IsKindOf(CLASSINFO(wxCompositeShape))) { bool ans = ((wxCompositeShape *)child)->ContainsDivision(division); if (ans) return TRUE; } - node = node->Next(); + node = node->GetNext(); } return FALSE; } @@ -879,13 +879,13 @@ bool wxDivisionShape::OnMovePre(wxDC& dc, double x, double y, double oldx, doubl { double diffX = x - oldx; double diffY = y - oldy; - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxShape *object = (wxShape *)node->Data(); + wxShape *object = (wxShape *)node->GetData(); object->Erase(dc); object->Move(dc, object->GetX() + diffX, object->GetY() + diffY, display); - node = node->Next(); + node = node->GetNext(); } return TRUE; } @@ -1084,13 +1084,13 @@ bool wxDivisionShape::Divide(int direction) // Anything adjoining the bottom of this division now adjoins the // bottom of the new division. - wxNode *node = compositeParent->GetDivisions().First(); + wxNode *node = compositeParent->GetDivisions().GetFirst(); while (node) { - wxDivisionShape *obj = (wxDivisionShape *)node->Data(); + wxDivisionShape *obj = (wxDivisionShape *)node->GetData(); if (obj->GetTopSide() == this) obj->SetTopSide(newDivision); - node = node->Next(); + node = node->GetNext(); } newDivision->SetTopSide(this); newDivision->SetBottomSide(m_bottomSide); @@ -1135,13 +1135,13 @@ bool wxDivisionShape::Divide(int direction) // Anything adjoining the left of this division now adjoins the // left of the new division. - wxNode *node = compositeParent->GetDivisions().First(); + wxNode *node = compositeParent->GetDivisions().GetFirst(); while (node) { - wxDivisionShape *obj = (wxDivisionShape *)node->Data(); + wxDivisionShape *obj = (wxDivisionShape *)node->GetData(); if (obj->GetLeftSide() == this) obj->SetLeftSide(newDivision); - node = node->Next(); + node = node->GetNext(); } newDivision->SetTopSide(m_topSide); newDivision->SetBottomSide(m_bottomSide); @@ -1253,17 +1253,17 @@ void wxDivisionShape::ResetControlPoints() void wxDivisionShape::ResetMandatoryControlPoints() { - if (m_controlPoints.Number() < 1) + if (m_controlPoints.GetCount() < 1) return; double maxX, maxY; GetBoundingBoxMax(&maxX, &maxY); /* - wxNode *node = m_controlPoints.First(); + wxNode *node = m_controlPoints.GetFirst(); while (node) { - wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->Data(); + wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->GetData(); if (control->type == CONTROL_POINT_HORIZONTAL) { control->xoffset = (double)(-maxX/2.0); control->m_yoffset = 0.0; @@ -1272,31 +1272,31 @@ void wxDivisionShape::ResetMandatoryControlPoints() { control->xoffset = 0.0; control->m_yoffset = (double)(-maxY/2.0); } - node = node->Next(); + node = node->GetNext(); } */ - wxNode *node = m_controlPoints.First(); + wxNode *node = m_controlPoints.GetFirst(); if ((m_handleSide == DIVISION_SIDE_LEFT) && node) { - wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->Data(); + wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->GetData(); control->m_xoffset = (double)(-maxX/2.0); control->m_yoffset = 0.0; } if ((m_handleSide == DIVISION_SIDE_TOP) && node) { - wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->Data(); + wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->GetData(); control->m_xoffset = 0.0; control->m_yoffset = (double)(-maxY/2.0); } if ((m_handleSide == DIVISION_SIDE_RIGHT) && node) { - wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->Data(); + wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->GetData(); control->m_xoffset = (double)(maxX/2.0); control->m_yoffset = 0.0; } if ((m_handleSide == DIVISION_SIDE_BOTTOM) && node) { - wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->Data(); + wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->GetData(); control->m_xoffset = 0.0; control->m_yoffset = (double)(maxY/2.0); } } @@ -1512,10 +1512,10 @@ void wxDivisionControlPoint::OnEndDragLeft(double x, double y, int keys, int att bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test) { wxCompositeShape *divisionParent = (wxCompositeShape *)GetParent(); - wxNode *node = divisionParent->GetDivisions().First(); + wxNode *node = divisionParent->GetDivisions().GetFirst(); while (node) { - wxDivisionShape *division = (wxDivisionShape *)node->Data(); + wxDivisionShape *division = (wxDivisionShape *)node->GetData(); switch (side) { case DIVISION_SIDE_LEFT: @@ -1561,7 +1561,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test) default: break; } - node = node->Next(); + node = node->GetNext(); } return TRUE; diff --git a/contrib/src/ogl/constrnt.cpp b/contrib/src/ogl/constrnt.cpp index e79d3ed4d0..354cac46d8 100644 --- a/contrib/src/ogl/constrnt.cpp +++ b/contrib/src/ogl/constrnt.cpp @@ -110,12 +110,12 @@ void OGLCleanUpConstraintTypes() if (!wxOGLConstraintTypes) return; - wxNode* node = wxOGLConstraintTypes->First(); + wxNode* node = wxOGLConstraintTypes->GetFirst(); while (node) { - wxOGLConstraintType* ct = (wxOGLConstraintType*) node->Data(); + wxOGLConstraintType* ct = (wxOGLConstraintType*) node->GetData(); delete ct; - node = node->Next(); + node = node->GetNext(); } delete wxOGLConstraintTypes; wxOGLConstraintTypes = NULL; @@ -139,11 +139,11 @@ wxOGLConstraint::wxOGLConstraint(int type, wxShape *constraining, wxList& constr m_constraintId = 0; m_constraintName = wxT("noname"); - wxNode *node = constrained.First(); + wxNode *node = constrained.GetFirst(); while (node) { - m_constrainedObjects.Append(node->Data()); - node = node->Next(); + m_constrainedObjects.Append(node->GetData()); + node = node->GetNext(); } } @@ -175,17 +175,17 @@ bool wxOGLConstraint::Evaluate() { case gyCONSTRAINT_CENTRED_VERTICALLY: { - int n = m_constrainedObjects.Number(); + int n = m_constrainedObjects.GetCount(); double totalObjectHeight = 0.0; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); totalObjectHeight += height2; - node = node->Next(); + node = node->GetNext(); } double startY; double spacingY; @@ -204,10 +204,10 @@ bool wxOGLConstraint::Evaluate() // Now position the objects bool changed = FALSE; - node = m_constrainedObjects.First(); + node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); startY += (double)(spacingY + (height2/2.0)); @@ -217,23 +217,23 @@ bool wxOGLConstraint::Evaluate() changed = TRUE; } startY += (double)(height2/2.0); - node = node->Next(); + node = node->GetNext(); } return changed; } case gyCONSTRAINT_CENTRED_HORIZONTALLY: { - int n = m_constrainedObjects.Number(); + int n = m_constrainedObjects.GetCount(); double totalObjectWidth = 0.0; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); totalObjectWidth += width2; - node = node->Next(); + node = node->GetNext(); } double startX; double spacingX; @@ -252,10 +252,10 @@ bool wxOGLConstraint::Evaluate() // Now position the objects bool changed = FALSE; - node = m_constrainedObjects.First(); + node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); startX += (double)(spacingX + (width2/2.0)); @@ -265,25 +265,25 @@ bool wxOGLConstraint::Evaluate() changed = TRUE; } startX += (double)(width2/2.0); - node = node->Next(); + node = node->GetNext(); } return changed; } case gyCONSTRAINT_CENTRED_BOTH: { - int n = m_constrainedObjects.Number(); + int n = m_constrainedObjects.GetCount(); double totalObjectWidth = 0.0; double totalObjectHeight = 0.0; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); totalObjectWidth += width2; totalObjectHeight += height2; - node = node->Next(); + node = node->GetNext(); } double startX; double spacingX; @@ -318,10 +318,10 @@ bool wxOGLConstraint::Evaluate() // Now position the objects bool changed = FALSE; - node = m_constrainedObjects.First(); + node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); startX += (double)(spacingX + (width2/2.0)); @@ -336,7 +336,7 @@ bool wxOGLConstraint::Evaluate() startX += (double)(width2/2.0); startY += (double)(height2/2.0); - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -344,10 +344,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -359,7 +359,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -367,10 +367,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -382,7 +382,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; @@ -392,10 +392,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -407,7 +407,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -415,10 +415,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -430,7 +430,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -438,10 +438,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -453,7 +453,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -461,10 +461,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -476,7 +476,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; @@ -486,10 +486,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -501,7 +501,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -509,10 +509,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -524,7 +524,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -532,10 +532,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double x3 = (double)(x - (minWidth/2.0)); if (!Equals(x3, constrainedObject->GetX())) @@ -544,7 +544,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -552,10 +552,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double x3 = (double)(x + (minWidth/2.0)); if (!Equals(x3, constrainedObject->GetX())) @@ -564,7 +564,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; @@ -574,10 +574,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double y3 = (double)(y - (minHeight/2.0)); if (!Equals(y3, constrainedObject->GetY())) @@ -586,7 +586,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -594,10 +594,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double y3 = (double)(y + (minHeight/2.0)); if (!Equals(y3, constrainedObject->GetY())) @@ -606,7 +606,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } diff --git a/contrib/src/ogl/divided.cpp b/contrib/src/ogl/divided.cpp index aa929c8b55..cb1de4fbaa 100644 --- a/contrib/src/ogl/divided.cpp +++ b/contrib/src/ogl/divided.cpp @@ -74,7 +74,7 @@ void wxDividedShape::OnDraw(wxDC& dc) void wxDividedShape::OnDrawContents(wxDC& dc) { - double defaultProportion = (double)(GetRegions().Number() > 0 ? (1.0/((double)(GetRegions().Number()))) : 0.0); + double defaultProportion = (double)(GetRegions().GetCount() > 0 ? (1.0/((double)(GetRegions().GetCount()))) : 0.0); double currentY = (double)(m_ypos - (m_height / 2.0)); double maxY = (double)(m_ypos + (m_height / 2.0)); @@ -104,10 +104,10 @@ void wxDividedShape::OnDrawContents(wxDC& dc) double yMargin = 2; dc.SetBackgroundMode(wxTRANSPARENT); - wxNode *node = GetRegions().First(); + wxNode *node = GetRegions().GetFirst(); while (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); dc.SetFont(* region->GetFont()); dc.SetTextForeground(* region->GetActualColourObject()); @@ -123,7 +123,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc) oglDrawFormattedText(dc, ®ion->m_formattedText, (double)(centreX), (double)(centreY), (double)(m_width-2*xMargin), (double)(actualY - currentY - 2*yMargin), region->m_formatMode); - if ((y <= maxY) && (node->Next())) + if ((y <= maxY) && (node->GetNext())) { wxPen *regionPen = region->GetActualPen(); if (regionPen) @@ -135,7 +135,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc) currentY = actualY; - node = node->Next(); + node = node->GetNext(); } } @@ -149,20 +149,20 @@ void wxDividedShape::SetSize(double w, double h, bool recursive) void wxDividedShape::SetRegionSizes() { - if (GetRegions().Number() == 0) + if (GetRegions().GetCount() == 0) return; - double defaultProportion = (double)(GetRegions().Number() > 0 ? (1.0/((double)(GetRegions().Number()))) : 0.0); + double defaultProportion = (double)(GetRegions().GetCount() > 0 ? (1.0/((double)(GetRegions().GetCount()))) : 0.0); double currentY = (double)(m_ypos - (m_height / 2.0)); double maxY = (double)(m_ypos + (m_height / 2.0)); // double leftX = (double)(m_xpos - (m_width / 2.0)); // double rightX = (double)(m_xpos + (m_width / 2.0)); - wxNode *node = GetRegions().First(); + wxNode *node = GetRegions().GetFirst(); while (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); double proportion = region->m_regionProportionY <= 0.0 ? defaultProportion : region->m_regionProportionY; @@ -175,7 +175,7 @@ void wxDividedShape::SetRegionSizes() region->SetSize(m_width, sizeY); region->SetPosition(0.0, (double)(centreY - m_ypos)); currentY = actualY; - node = node->Next(); + node = node->GetNext(); } } @@ -183,13 +183,13 @@ void wxDividedShape::SetRegionSizes() bool wxDividedShape::GetAttachmentPosition(int attachment, double *x, double *y, int nth, int no_arcs, wxLineShape *line) { - int totalNumberAttachments = (GetRegions().Number() * 2) + 2; + int totalNumberAttachments = (GetRegions().GetCount() * 2) + 2; if ((GetAttachmentMode() == ATTACHMENT_MODE_NONE) || (attachment >= totalNumberAttachments)) { return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs); } - int n = GetRegions().Number(); + int n = GetRegions().GetCount(); bool isEnd = (line && line->IsEnd(this)); double left = (double)(m_xpos - m_width/2.0); @@ -257,10 +257,10 @@ bool wxDividedShape::GetAttachmentPosition(int attachment, double *x, double *y, i = (totalNumberAttachments - attachment - 1); isLeft = TRUE; } - wxNode *node = GetRegions().Nth(i); + wxNode *node = GetRegions().Item(i); if (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); if (isLeft) *x = left; @@ -307,23 +307,23 @@ int wxDividedShape::GetNumberOfAttachments() const { // There are two attachments for each region (left and right), // plus one on the top and one on the bottom. - int n = (GetRegions().Number() * 2) + 2; + int n = (GetRegions().GetCount() * 2) + 2; int maxN = n - 1; - wxNode *node = m_attachmentPoints.First(); + wxNode *node = m_attachmentPoints.GetFirst(); while (node) { - wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); + wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); if (point->m_id > maxN) maxN = point->m_id; - node = node->Next(); + node = node->GetNext(); } return maxN + 1; } bool wxDividedShape::AttachmentIsValid(int attachment) { - int totalNumberAttachments = (GetRegions().Number() * 2) + 2; + int totalNumberAttachments = (GetRegions().GetCount() * 2) + 2; if (attachment >= totalNumberAttachments) { return wxShape::AttachmentIsValid(attachment); @@ -353,18 +353,18 @@ void wxDividedShape::MakeMandatoryControlPoints() double currentY = (double)(GetY() - (m_height / 2.0)); double maxY = (double)(GetY() + (m_height / 2.0)); - wxNode *node = GetRegions().First(); + wxNode *node = GetRegions().GetFirst(); int i = 0; while (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); double proportion = region->m_regionProportionY; double y = currentY + m_height*proportion; double actualY = (double)(maxY < y ? maxY : y); - if (node->Next()) + if (node->GetNext()) { wxDividedShapeControlPoint *controlPoint = new wxDividedShapeControlPoint(m_canvas, this, i, CONTROL_POINT_SIZE, 0.0, (double)(actualY - GetY()), 0); @@ -373,14 +373,14 @@ void wxDividedShape::MakeMandatoryControlPoints() } currentY = actualY; i ++; - node = node->Next(); + node = node->GetNext(); } } void wxDividedShape::ResetControlPoints() { // May only have the region handles, (n - 1) of them. - if (m_controlPoints.Number() > (GetRegions().Number() - 1)) + if (m_controlPoints.GetCount() > (GetRegions().GetCount() - 1)) wxRectangleShape::ResetControlPoints(); ResetMandatoryControlPoints(); @@ -391,15 +391,15 @@ void wxDividedShape::ResetMandatoryControlPoints() double currentY = (double)(GetY() - (m_height / 2.0)); double maxY = (double)(GetY() + (m_height / 2.0)); - wxNode *node = m_controlPoints.First(); + wxNode *node = m_controlPoints.GetFirst(); int i = 0; while (node) { - wxControlPoint *controlPoint = (wxControlPoint *)node->Data(); + wxControlPoint *controlPoint = (wxControlPoint *)node->GetData(); if (controlPoint->IsKindOf(CLASSINFO(wxDividedShapeControlPoint))) { - wxNode *node1 = GetRegions().Nth(i); - wxShapeRegion *region = (wxShapeRegion *)node1->Data(); + wxNode *node1 = GetRegions().Item(i); + wxShapeRegion *region = (wxShapeRegion *)node1->GetData(); double proportion = region->m_regionProportionY; @@ -411,7 +411,7 @@ void wxDividedShape::ResetMandatoryControlPoints() currentY = actualY; i ++; } - node = node->Next(); + node = node->GetNext(); } } @@ -438,7 +438,7 @@ void wxDividedShape::EditRegions() // TODO #if 0 - if (GetRegions().Number() < 2) + if (GetRegions().GetCount() < 2) return; wxBeginBusyCursor(); @@ -446,15 +446,15 @@ void wxDividedShape::EditRegions() GraphicsForm *form = new GraphicsForm("Divided nodes"); // Need an array to store all the style strings, // since they need to be converted to integers - char **styleStrings = new char *[GetRegions().Number()]; - for (int j = 0; j < GetRegions().Number(); j++) + char **styleStrings = new char *[GetRegions().GetCount()]; + for (int j = 0; j < GetRegions().GetCount(); j++) styleStrings[j] = NULL; int i = 0; - wxNode *node = GetRegions().First(); - while (node && node->Next()) + wxNode *node = GetRegions().GetFirst(); + while (node && node->GetNext()) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); char buf[50]; sprintf(buf, "Region %d", (i+1)); form->Add(wxMakeFormMessage(buf)); @@ -518,9 +518,9 @@ void wxDividedShape::EditRegions() "Dot Dash" , NULL), NULL), NULL, wxVERTICAL, 100)); - node = node->Next(); + node = node->GetNext(); i ++; - if (node && node->Next()) + if (node && node->GetNext()) form->Add(wxMakeFormNewLine()); } wxDialogBox *dialog = new wxDialogBox(m_canvas->GetParent(), "Divided object properties", 10, 10, 500, 500); @@ -538,11 +538,11 @@ void wxDividedShape::EditRegions() dialog->Show(TRUE); - node = GetRegions().First(); + node = GetRegions().GetFirst(); i = 0; while (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); if (styleStrings[i]) { @@ -559,7 +559,7 @@ void wxDividedShape::EditRegions() delete[] styleStrings[i]; } region->m_actualPenObject = NULL; - node = node->Next(); + node = node->GetNext(); i ++; } delete[] styleStrings; @@ -634,11 +634,11 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int GetCanvas()->PrepareDC(dc); wxDividedShape *dividedObject = (wxDividedShape *)m_shape; - wxNode *node = dividedObject->GetRegions().Nth(regionId); + wxNode *node = dividedObject->GetRegions().Item(regionId); if (!node) return; - wxShapeRegion *thisRegion = (wxShapeRegion *)node->Data(); + wxShapeRegion *thisRegion = (wxShapeRegion *)node->GetData(); wxShapeRegion *nextRegion = NULL; // Region below this one dc.SetLogicalFunction(wxCOPY); @@ -657,10 +657,10 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int double thisRegionBottom = 0.0; double nextRegionBottom = 0.0; - node = dividedObject->GetRegions().First(); + node = dividedObject->GetRegions().GetFirst(); while (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); double proportion = region->m_regionProportionY; double yy = currentY + (dividedObject->GetHeight()*proportion); @@ -670,8 +670,8 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int { thisRegionTop = currentY; thisRegionBottom = actualY; - if (node->Next()) - nextRegion = (wxShapeRegion *)node->Next()->Data(); + if (node->GetNext()) + nextRegion = (wxShapeRegion *)node->GetNext()->GetData(); } if (region == nextRegion) { @@ -679,7 +679,7 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int } currentY = actualY; - node = node->Next(); + node = node->GetNext(); } if (!nextRegion) return; @@ -700,17 +700,17 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int // Now reformat text int i = 0; - node = dividedObject->GetRegions().First(); + node = dividedObject->GetRegions().GetFirst(); while (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); if (region->GetText()) { wxChar *s = copystring(region->GetText()); dividedObject->FormatText(dc, s, i); delete[] s; } - node = node->Next(); + node = node->GetNext(); i++; } dividedObject->SetRegionSizes(); diff --git a/contrib/src/ogl/drawn.cpp b/contrib/src/ogl/drawn.cpp index 800d78db17..bb5c79e463 100644 --- a/contrib/src/ogl/drawn.cpp +++ b/contrib/src/ogl/drawn.cpp @@ -148,15 +148,15 @@ void wxDrawnShape::Rotate(double x, double y, double theta) // Rotate attachment points double sinTheta = (double)sin(actualTheta); double cosTheta = (double)cos(actualTheta); - wxNode *node = m_attachmentPoints.First(); + wxNode *node = m_attachmentPoints.GetFirst(); while (node) { - wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); + wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); double x1 = point->m_x; double y1 = point->m_y; point->m_x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta; point->m_y = x1*sinTheta + y1*cosTheta + y*(1.0 - cosTheta) + x*sinTheta; - node = node->Next(); + node = node->GetNext(); } m_rotation = theta; @@ -204,9 +204,9 @@ void wxDrawnShape::OnDrawOutline(wxDC& dc, double x, double y, double w, double { if (m_metafiles[m_currentAngle].GetOutlineOp() != -1) { - wxNode* node = m_metafiles[m_currentAngle].GetOps().Nth(m_metafiles[m_currentAngle].GetOutlineOp()); + wxNode* node = m_metafiles[m_currentAngle].GetOps().Item(m_metafiles[m_currentAngle].GetOutlineOp()); wxASSERT (node != NULL); - wxDrawOp* op = (wxDrawOp*) node->Data(); + wxDrawOp* op = (wxDrawOp*) node->GetData(); if (op->OnDrawOutline(dc, x, y, w, h, m_width, m_height)) return; @@ -224,9 +224,9 @@ bool wxDrawnShape::GetPerimeterPoint(double x1, double y1, { if (m_metafiles[m_currentAngle].GetOutlineOp() != -1) { - wxNode* node = m_metafiles[m_currentAngle].GetOps().Nth(m_metafiles[m_currentAngle].GetOutlineOp()); + wxNode* node = m_metafiles[m_currentAngle].GetOps().Item(m_metafiles[m_currentAngle].GetOutlineOp()); wxASSERT (node != NULL); - wxDrawOp* op = (wxDrawOp*) node->Data(); + wxDrawOp* op = (wxDrawOp*) node->GetData(); if (op->GetPerimeterPoint(x1, y1, x2, y2, x3, y3, GetX(), GetY(), GetAttachmentMode())) return TRUE; @@ -437,10 +437,10 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset) } else { - wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex); + wxNode *node = m_image->m_gdiObjects.Item(m_gdiIndex); if (node) { - wxPen *pen = (wxPen *)node->Data(); + wxPen *pen = (wxPen *)node->GetData(); if (pen) dc.SetPen(* pen); } @@ -470,10 +470,10 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset) } else { - wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex); + wxNode *node = m_image->m_gdiObjects.Item(m_gdiIndex); if (node) { - wxBrush *brush = (wxBrush *)node->Data(); + wxBrush *brush = (wxBrush *)node->GetData(); if (brush) dc.SetBrush(* brush); } @@ -482,10 +482,10 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset) } case DRAWOP_SET_FONT: { - wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex); + wxNode *node = m_image->m_gdiObjects.Item(m_gdiIndex); if (node) { - wxFont *font = (wxFont *)node->Data(); + wxFont *font = (wxFont *)node->GetData(); if (font) dc.SetFont(* font); } @@ -563,20 +563,20 @@ void wxOpSetGDI::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) case DRAWOP_SET_BRUSH: case DRAWOP_SET_FONT: { - m_gdiIndex = (int)expr->Nth(1)->IntegerValue(); + m_gdiIndex = (int)expr->Item(1)->IntegerValue(); break; } case DRAWOP_SET_TEXT_COLOUR: case DRAWOP_SET_BK_COLOUR: { - m_r = (unsigned char)expr->Nth(1)->IntegerValue(); - m_g = (unsigned char)expr->Nth(2)->IntegerValue(); - m_b = (unsigned char)expr->Nth(3)->IntegerValue(); + m_r = (unsigned char)expr->Item(1)->IntegerValue(); + m_g = (unsigned char)expr->Item(2)->IntegerValue(); + m_b = (unsigned char)expr->Item(3)->IntegerValue(); break; } case DRAWOP_SET_BK_MODE: { - m_mode = (int)expr->Nth(1)->IntegerValue(); + m_mode = (int)expr->Item(1)->IntegerValue(); break; } default: @@ -665,10 +665,10 @@ void wxOpSetClipping::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) { case DRAWOP_SET_CLIPPING_RECT: { - m_x1 = expr->Nth(1)->RealValue(); - m_y1 = expr->Nth(2)->RealValue(); - m_x2 = expr->Nth(3)->RealValue(); - m_y2 = expr->Nth(4)->RealValue(); + m_x1 = expr->Item(1)->RealValue(); + m_y1 = expr->Item(2)->RealValue(); + m_x2 = expr->Item(3)->RealValue(); + m_y2 = expr->Item(4)->RealValue(); break; } default: @@ -950,44 +950,44 @@ void wxOpDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) case DRAWOP_DRAW_RECT: case DRAWOP_DRAW_ELLIPSE: { - m_x1 = expr->Nth(1)->RealValue(); - m_y1 = expr->Nth(2)->RealValue(); - m_x2 = expr->Nth(3)->RealValue(); - m_y2 = expr->Nth(4)->RealValue(); + m_x1 = expr->Item(1)->RealValue(); + m_y1 = expr->Item(2)->RealValue(); + m_x2 = expr->Item(3)->RealValue(); + m_y2 = expr->Item(4)->RealValue(); break; } case DRAWOP_DRAW_ROUNDED_RECT: { - m_x1 = expr->Nth(1)->RealValue(); - m_y1 = expr->Nth(2)->RealValue(); - m_x2 = expr->Nth(3)->RealValue(); - m_y2 = expr->Nth(4)->RealValue(); - m_radius = expr->Nth(5)->RealValue(); + m_x1 = expr->Item(1)->RealValue(); + m_y1 = expr->Item(2)->RealValue(); + m_x2 = expr->Item(3)->RealValue(); + m_y2 = expr->Item(4)->RealValue(); + m_radius = expr->Item(5)->RealValue(); break; } case DRAWOP_DRAW_POINT: { - m_x1 = expr->Nth(1)->RealValue(); - m_y1 = expr->Nth(2)->RealValue(); + m_x1 = expr->Item(1)->RealValue(); + m_y1 = expr->Item(2)->RealValue(); break; } case DRAWOP_DRAW_TEXT: { - m_x1 = expr->Nth(1)->RealValue(); - m_y1 = expr->Nth(2)->RealValue(); - wxString str(expr->Nth(3)->StringValue()); + m_x1 = expr->Item(1)->RealValue(); + m_y1 = expr->Item(2)->RealValue(); + wxString str(expr->Item(3)->StringValue()); m_textString = copystring(str); break; } case DRAWOP_DRAW_ARC: case DRAWOP_DRAW_ELLIPTIC_ARC: { - m_x1 = expr->Nth(1)->RealValue(); - m_y1 = expr->Nth(2)->RealValue(); - m_x2 = expr->Nth(3)->RealValue(); - m_y2 = expr->Nth(4)->RealValue(); - m_x3 = expr->Nth(5)->RealValue(); - m_y3 = expr->Nth(6)->RealValue(); + m_x1 = expr->Item(1)->RealValue(); + m_y1 = expr->Item(2)->RealValue(); + m_x2 = expr->Item(3)->RealValue(); + m_y2 = expr->Item(4)->RealValue(); + m_x3 = expr->Item(5)->RealValue(); + m_y3 = expr->Item(6)->RealValue(); break; } default: @@ -1156,7 +1156,7 @@ wxExpr *wxOpPolyDraw::WriteExpr(wxPseudoMetaFile *image) void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) { - m_noPoints = (int)expr->Nth(1)->IntegerValue(); + m_noPoints = (int)expr->Item(1)->IntegerValue(); char buf1[5]; char buf2[5]; @@ -1164,7 +1164,7 @@ void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) m_points = new wxRealPoint[m_noPoints]; int i = 0; int bufPtr = 0; - wxString hexString = expr->Nth(2)->StringValue(); + wxString hexString = expr->Item(2)->StringValue(); while (i < m_noPoints) { buf1[0] = hexString[(size_t)bufPtr]; @@ -1390,12 +1390,12 @@ wxPseudoMetaFile::~wxPseudoMetaFile() void wxPseudoMetaFile::Clear() { - wxNode *node = m_ops.First(); + wxNode *node = m_ops.GetFirst(); while (node) { - wxDrawOp *op = (wxDrawOp *)node->Data(); + wxDrawOp *op = (wxDrawOp *)node->GetData(); delete op; - node = node->Next(); + node = node->GetNext(); } m_ops.Clear(); m_gdiObjects.Clear(); @@ -1406,23 +1406,23 @@ void wxPseudoMetaFile::Clear() void wxPseudoMetaFile::Draw(wxDC& dc, double xoffset, double yoffset) { - wxNode *node = m_ops.First(); + wxNode *node = m_ops.GetFirst(); while (node) { - wxDrawOp *op = (wxDrawOp *)node->Data(); + wxDrawOp *op = (wxDrawOp *)node->GetData(); op->Do(dc, xoffset, yoffset); - node = node->Next(); + node = node->GetNext(); } } void wxPseudoMetaFile::Scale(double sx, double sy) { - wxNode *node = m_ops.First(); + wxNode *node = m_ops.GetFirst(); while (node) { - wxDrawOp *op = (wxDrawOp *)node->Data(); + wxDrawOp *op = (wxDrawOp *)node->GetData(); op->Scale(sx, sy); - node = node->Next(); + node = node->GetNext(); } m_width *= sx; m_height *= sy; @@ -1430,12 +1430,12 @@ void wxPseudoMetaFile::Scale(double sx, double sy) void wxPseudoMetaFile::Translate(double x, double y) { - wxNode *node = m_ops.First(); + wxNode *node = m_ops.GetFirst(); while (node) { - wxDrawOp *op = (wxDrawOp *)node->Data(); + wxDrawOp *op = (wxDrawOp *)node->GetData(); op->Translate(x, y); - node = node->Next(); + node = node->GetNext(); } } @@ -1446,12 +1446,12 @@ void wxPseudoMetaFile::Rotate(double x, double y, double theta) double cosTheta = (double)cos(theta1); double sinTheta = (double)sin(theta1); - wxNode *node = m_ops.First(); + wxNode *node = m_ops.GetFirst(); while (node) { - wxDrawOp *op = (wxDrawOp *)node->Data(); + wxDrawOp *op = (wxDrawOp *)node->GetData(); op->Rotate(x, y, theta, sinTheta, cosTheta); - node = node->Next(); + node = node->GetNext(); } m_currentRotation = theta; } @@ -1480,11 +1480,11 @@ void wxPseudoMetaFile::WriteAttributes(wxExpr *clause, int whichAngle) // Write GDI objects char buf[50]; int i = 1; - wxNode *node = m_gdiObjects.First(); + wxNode *node = m_gdiObjects.GetFirst(); while (node) { sprintf(buf, "gdi%d_%d", whichAngle, i); - wxObject *obj = (wxObject *)node->Data(); + wxObject *obj = (wxObject *)node->GetData(); wxExpr *expr = NULL; if (obj) { @@ -1533,48 +1533,48 @@ void wxPseudoMetaFile::WriteAttributes(wxExpr *clause, int whichAngle) clause->AddAttributeValue(buf, expr); i ++; } - node = node->Next(); + node = node->GetNext(); } // Write drawing operations i = 1; - node = m_ops.First(); + node = m_ops.GetFirst(); while (node) { sprintf(buf, "op%d_%d", whichAngle, i); - wxDrawOp *op = (wxDrawOp *)node->Data(); + wxDrawOp *op = (wxDrawOp *)node->GetData(); wxExpr *expr = op->WriteExpr(this); if (expr) { clause->AddAttributeValue(buf, expr); i ++; } - node = node->Next(); + node = node->GetNext(); } // Write outline and fill GDI op lists (if any) - if (m_outlineColours.Number() > 0) + if (m_outlineColours.GetCount() > 0) { wxExpr *outlineExpr = new wxExpr(wxExprList); - node = m_outlineColours.First(); + node = m_outlineColours.GetFirst(); while (node) { - outlineExpr->Append(new wxExpr((long)node->Data())); - node = node->Next(); + outlineExpr->Append(new wxExpr((long)node->GetData())); + node = node->GetNext(); } wxString outlineObjectsStr; outlineObjectsStr.Printf(wxT("outline_objects%d"), whichAngle); clause->AddAttributeValue(outlineObjectsStr, outlineExpr); } - if (m_fillColours.Number() > 0) + if (m_fillColours.GetCount() > 0) { wxExpr *fillExpr = new wxExpr(wxExprList); - node = m_fillColours.First(); + node = m_fillColours.GetFirst(); while (node) { - fillExpr->Append(new wxExpr((long)node->Data())); - node = node->Next(); + fillExpr->Append(new wxExpr((long)node->GetData())); + node = node->GetNext(); } wxString fillObjectsStr; fillObjectsStr.Printf(wxT("fill_objects%d"), whichAngle); @@ -1621,16 +1621,16 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle) } else { - wxExpr *idExpr = expr->Nth(0); + wxExpr *idExpr = expr->Item(0); switch (idExpr->IntegerValue()) { case gyTYPE_PEN: { - int penWidth = (int)expr->Nth(1)->IntegerValue(); - int penStyle = (int)expr->Nth(2)->IntegerValue(); - int penRed = (int)expr->Nth(3)->IntegerValue(); - int penGreen = (int)expr->Nth(4)->IntegerValue(); - int penBlue = (int)expr->Nth(5)->IntegerValue(); + int penWidth = (int)expr->Item(1)->IntegerValue(); + int penStyle = (int)expr->Item(2)->IntegerValue(); + int penRed = (int)expr->Item(3)->IntegerValue(); + int penGreen = (int)expr->Item(4)->IntegerValue(); + int penBlue = (int)expr->Item(5)->IntegerValue(); wxColour col(penRed, penGreen, penBlue); wxPen *p = wxThePenList->FindOrCreatePen(col, penWidth, penStyle); if (!p) @@ -1640,10 +1640,10 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle) } case gyTYPE_BRUSH: { - int brushStyle = (int)expr->Nth(1)->IntegerValue(); - int brushRed = (int)expr->Nth(2)->IntegerValue(); - int brushGreen = (int)expr->Nth(3)->IntegerValue(); - int brushBlue = (int)expr->Nth(4)->IntegerValue(); + int brushStyle = (int)expr->Item(1)->IntegerValue(); + int brushRed = (int)expr->Item(2)->IntegerValue(); + int brushGreen = (int)expr->Item(3)->IntegerValue(); + int brushBlue = (int)expr->Item(4)->IntegerValue(); wxColour col(brushRed, brushGreen, brushBlue); wxBrush *b = wxTheBrushList->FindOrCreateBrush(col, brushStyle); if (!b) @@ -1653,11 +1653,11 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle) } case gyTYPE_FONT: { - int fontPointSize = (int)expr->Nth(1)->IntegerValue(); - int fontFamily = (int)expr->Nth(2)->IntegerValue(); - int fontStyle = (int)expr->Nth(3)->IntegerValue(); - int fontWeight = (int)expr->Nth(4)->IntegerValue(); - int fontUnderlined = (int)expr->Nth(5)->IntegerValue(); + int fontPointSize = (int)expr->Item(1)->IntegerValue(); + int fontFamily = (int)expr->Item(2)->IntegerValue(); + int fontStyle = (int)expr->Item(3)->IntegerValue(); + int fontWeight = (int)expr->Item(4)->IntegerValue(); + int fontUnderlined = (int)expr->Item(5)->IntegerValue(); m_gdiObjects.Append(wxTheFontList->FindOrCreateFont(fontPointSize, fontFamily, fontStyle, fontWeight, (fontUnderlined != 0))); break; @@ -1687,7 +1687,7 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle) } else { - wxExpr *idExpr = expr->Nth(0); + wxExpr *idExpr = expr->Item(0); int opId = (int)idExpr->IntegerValue(); switch (opId) { @@ -1787,35 +1787,35 @@ void wxPseudoMetaFile::Copy(wxPseudoMetaFile& copy) copy.m_outlineOp = m_outlineOp; // Copy the GDI objects - wxNode *node = m_gdiObjects.First(); + wxNode *node = m_gdiObjects.GetFirst(); while (node) { - wxObject *obj = (wxObject *)node->Data(); + wxObject *obj = (wxObject *)node->GetData(); copy.m_gdiObjects.Append(obj); - node = node->Next(); + node = node->GetNext(); } // Copy the operations - node = m_ops.First(); + node = m_ops.GetFirst(); while (node) { - wxDrawOp *op = (wxDrawOp *)node->Data(); + wxDrawOp *op = (wxDrawOp *)node->GetData(); copy.m_ops.Append(op->Copy(©)); - node = node->Next(); + node = node->GetNext(); } // Copy the outline/fill operations - node = m_outlineColours.First(); + node = m_outlineColours.GetFirst(); while (node) { - copy.m_outlineColours.Append((wxObject *)node->Data()); - node = node->Next(); + copy.m_outlineColours.Append((wxObject *)node->GetData()); + node = node->GetNext(); } - node = m_fillColours.First(); + node = m_fillColours.GetFirst(); while (node) { - copy.m_fillColours.Append((wxObject *)node->Data()); - node = node->Next(); + copy.m_fillColours.Append((wxObject *)node->GetData()); + node = node->GetNext(); } } @@ -1828,7 +1828,7 @@ void wxPseudoMetaFile::Copy(wxPseudoMetaFile& copy) bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth, double *rheight) { if (!wxFileExists(filename)) - return NULL; + return FALSE; wxXMetaFile *metaFile = new wxXMetaFile; @@ -1842,10 +1842,10 @@ bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth double lastY = 0.0; // Convert from metafile records to wxDrawnShape records - wxNode *node = metaFile->metaRecords.First(); + wxNode *node = metaFile->metaRecords.GetFirst(); while (node) { - wxMetaRecord *record = (wxMetaRecord *)node->Data(); + wxMetaRecord *record = (wxMetaRecord *)node->GetData(); switch (record->metaFunction) { case META_SETBKCOLOR: @@ -2017,10 +2017,10 @@ bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth { // The pen, brush etc. has already been created when the metafile // was read in, so we don't create it - we set it. - wxNode *recNode = metaFile->gdiObjects.Nth((int)record->param2); + wxNode *recNode = metaFile->gdiObjects.Item((int)record->param2); if (recNode) { - wxMetaRecord *gdiRec = (wxMetaRecord *)recNode->Data(); + wxMetaRecord *gdiRec = (wxMetaRecord *)recNode->GetData(); if (gdiRec && (gdiRec->param1 != 0)) { wxObject *obj = (wxObject *)gdiRec->param1; @@ -2135,7 +2135,7 @@ bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth break; } } - node = node->Next(); + node = node->GetNext(); } double actualWidth = (double)fabs(metaFile->right - metaFile->left); double actualHeight = (double)fabs(metaFile->bottom - metaFile->top); @@ -2192,10 +2192,10 @@ void wxPseudoMetaFile::GetBounds(double *boundMinX, double *boundMinY, double *b double minX = (double) 99999.9; double minY = (double) 99999.9; - wxNode *node = m_ops.First(); + wxNode *node = m_ops.GetFirst(); while (node) { - wxDrawOp *op = (wxDrawOp *)node->Data(); + wxDrawOp *op = (wxDrawOp *)node->GetData(); switch (op->GetOp()) { case DRAWOP_DRAW_LINE: @@ -2262,7 +2262,7 @@ void wxPseudoMetaFile::GetBounds(double *boundMinX, double *boundMinY, double *b default: break; } - node = node->Next(); + node = node->GetNext(); } *boundMinX = minX; @@ -2400,7 +2400,7 @@ void wxPseudoMetaFile::DrawPolygon(int n, wxPoint pts[], int flags) m_ops.Append(theOp); if (flags & oglMETAFLAGS_OUTLINE) - m_outlineOp = (m_ops.Number() - 1); + m_outlineOp = (m_ops.GetCount() - 1); } void wxPseudoMetaFile::DrawSpline(int n, wxPoint pts[]) @@ -2433,7 +2433,7 @@ void wxPseudoMetaFile::DestroyClippingRect() void wxPseudoMetaFile::SetPen(wxPen* pen, bool isOutline) { m_gdiObjects.Append(pen); - int n = m_gdiObjects.Number(); + int n = m_gdiObjects.GetCount(); wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_PEN, this, n - 1); @@ -2448,7 +2448,7 @@ void wxPseudoMetaFile::SetPen(wxPen* pen, bool isOutline) void wxPseudoMetaFile::SetBrush(wxBrush* brush, bool isFill) { m_gdiObjects.Append(brush); - int n = m_gdiObjects.Number(); + int n = m_gdiObjects.GetCount(); wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_BRUSH, this, n - 1); @@ -2463,7 +2463,7 @@ void wxPseudoMetaFile::SetBrush(wxBrush* brush, bool isFill) void wxPseudoMetaFile::SetFont(wxFont* font) { m_gdiObjects.Append(font); - int n = m_gdiObjects.Number(); + int n = m_gdiObjects.GetCount(); wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_FONT, this, n - 1); diff --git a/contrib/src/ogl/lines.cpp b/contrib/src/ogl/lines.cpp index fac1286eac..045202c68b 100644 --- a/contrib/src/ogl/lines.cpp +++ b/contrib/src/ogl/lines.cpp @@ -131,10 +131,10 @@ wxNode *wxLineShape::InsertLineControlPoint(wxDC* dc) if (dc) Erase(*dc); - wxNode *last = m_lineControlPoints->Last(); - wxNode *second_last = last->Previous(); - wxRealPoint *last_point = (wxRealPoint *)last->Data(); - wxRealPoint *second_last_point = (wxRealPoint *)second_last->Data(); + wxNode *last = m_lineControlPoints->GetLast(); + wxNode *second_last = last->GetPrevious(); + wxRealPoint *last_point = (wxRealPoint *)last->GetData(); + wxRealPoint *second_last_point = (wxRealPoint *)second_last->GetData(); // Choose a point half way between the last and penultimate points double line_x = ((last_point->x + second_last_point->x)/2); @@ -147,13 +147,13 @@ wxNode *wxLineShape::InsertLineControlPoint(wxDC* dc) bool wxLineShape::DeleteLineControlPoint() { - if (m_lineControlPoints->Number() < 3) + if (m_lineControlPoints->GetCount() < 3) return FALSE; - wxNode *last = m_lineControlPoints->Last(); - wxNode *second_last = last->Previous(); + wxNode *last = m_lineControlPoints->GetLast(); + wxNode *second_last = last->GetPrevious(); - wxRealPoint *second_last_point = (wxRealPoint *)second_last->Data(); + wxRealPoint *second_last_point = (wxRealPoint *)second_last->GetData(); delete second_last_point; delete second_last; @@ -165,19 +165,19 @@ void wxLineShape::Initialise() if (m_lineControlPoints) { // Just move the first and last control points - wxNode *first = m_lineControlPoints->First(); - wxRealPoint *first_point = (wxRealPoint *)first->Data(); + wxNode *first = m_lineControlPoints->GetFirst(); + wxRealPoint *first_point = (wxRealPoint *)first->GetData(); - wxNode *last = m_lineControlPoints->Last(); - wxRealPoint *last_point = (wxRealPoint *)last->Data(); + wxNode *last = m_lineControlPoints->GetLast(); + wxRealPoint *last_point = (wxRealPoint *)last->GetData(); // If any of the line points are at -999, we must // initialize them by placing them half way between the first // and the last. - wxNode *node = first->Next(); + wxNode *node = first->GetNext(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); if (point->x == -999) { double x1, y1, x2, y2; @@ -194,7 +194,7 @@ void wxLineShape::Initialise() point->x = ((x2 - x1)/2 + x1); point->y = ((y2 - y1)/2 + y1); } - node = node->Next(); + node = node->GetNext(); } } } @@ -206,13 +206,13 @@ void wxLineShape::FormatText(wxDC& dc, const wxString& s, int i) double w, h; ClearText(i); - if (m_regions.Number() < 1) + if (m_regions.GetCount() < 1) return; - wxNode *node = m_regions.Nth(i); + wxNode *node = m_regions.Item(i); if (!node) return; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->SetText(s); dc.SetFont(* region->GetFont()); @@ -225,13 +225,13 @@ void wxLineShape::FormatText(wxDC& dc, const wxString& s, int i) } wxStringList *string_list = oglFormatText(dc, s, (w-5), (h-5), region->GetFormatMode()); - node = string_list->First(); + node = (wxNode*)string_list->GetFirst(); while (node) { - wxChar *s = (wxChar *)node->Data(); + wxChar *s = (wxChar *)node->GetData(); wxShapeTextLine *line = new wxShapeTextLine(0.0, 0.0, s); region->GetFormattedText().Append((wxObject *)line); - node = node->Next(); + node = node->GetNext(); } delete string_list; double actualW = w; @@ -280,7 +280,7 @@ void wxLineShape::DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y double yp = yy + y; // First, clear a rectangle for the text IF there is any - if (region->GetFormattedText().Number() > 0) + if (region->GetFormattedText().GetCount() > 0) { dc.SetPen(GetBackgroundPen()); dc.SetBrush(GetBackgroundBrush()); @@ -316,7 +316,7 @@ void wxLineShape::EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double double xp = xx + x; double yp = yy + y; - if (region->GetFormattedText().Number() > 0) + if (region->GetFormattedText().GetCount() > 0) { dc.SetPen(GetBackgroundPen()); dc.SetBrush(GetBackgroundBrush()); @@ -335,14 +335,14 @@ void wxLineShape::GetLabelPosition(int position, double *x, double *y) case 0: { // Want to take the middle section for the label - int n = m_lineControlPoints->Number(); + int n = m_lineControlPoints->GetCount(); int half_way = (int)(n/2); // Find middle of this line - wxNode *node = m_lineControlPoints->Nth(half_way - 1); - wxRealPoint *point = (wxRealPoint *)node->Data(); - wxNode *next_node = node->Next(); - wxRealPoint *next_point = (wxRealPoint *)next_node->Data(); + wxNode *node = m_lineControlPoints->Item(half_way - 1); + wxRealPoint *point = (wxRealPoint *)node->GetData(); + wxNode *next_node = node->GetNext(); + wxRealPoint *next_point = (wxRealPoint *)next_node->GetData(); double dx = (next_point->x - point->x); double dy = (next_point->y - point->y); @@ -352,16 +352,16 @@ void wxLineShape::GetLabelPosition(int position, double *x, double *y) } case 1: { - wxNode *node = m_lineControlPoints->First(); - *x = ((wxRealPoint *)node->Data())->x; - *y = ((wxRealPoint *)node->Data())->y; + wxNode *node = m_lineControlPoints->GetFirst(); + *x = ((wxRealPoint *)node->GetData())->x; + *y = ((wxRealPoint *)node->GetData())->y; break; } case 2: { - wxNode *node = m_lineControlPoints->Last(); - *x = ((wxRealPoint *)node->Data())->x; - *y = ((wxRealPoint *)node->Data())->y; + wxNode *node = m_lineControlPoints->GetLast(); + *x = ((wxRealPoint *)node->GetData())->x; + *y = ((wxRealPoint *)node->GetData())->y; break; } default: @@ -390,29 +390,29 @@ void GraphicsStraightenLine(wxRealPoint *point1, wxRealPoint *point2) void wxLineShape::Straighten(wxDC *dc) { - if (!m_lineControlPoints || m_lineControlPoints->Number() < 3) + if (!m_lineControlPoints || m_lineControlPoints->GetCount() < 3) return; if (dc) Erase(* dc); - wxNode *first_point_node = m_lineControlPoints->First(); - wxNode *last_point_node = m_lineControlPoints->Last(); - wxNode *second_last_point_node = last_point_node->Previous(); + wxNode *first_point_node = m_lineControlPoints->GetFirst(); + wxNode *last_point_node = m_lineControlPoints->GetLast(); + wxNode *second_last_point_node = last_point_node->GetPrevious(); - wxRealPoint *last_point = (wxRealPoint *)last_point_node->Data(); - wxRealPoint *second_last_point = (wxRealPoint *)second_last_point_node->Data(); + wxRealPoint *last_point = (wxRealPoint *)last_point_node->GetData(); + wxRealPoint *second_last_point = (wxRealPoint *)second_last_point_node->GetData(); GraphicsStraightenLine(last_point, second_last_point); wxNode *node = first_point_node; while (node && (node != second_last_point_node)) { - wxRealPoint *point = (wxRealPoint *)node->Data(); - wxRealPoint *next_point = (wxRealPoint *)(node->Next()->Data()); + wxRealPoint *point = (wxRealPoint *)node->GetData(); + wxRealPoint *next_point = (wxRealPoint *)(node->GetNext()->GetData()); GraphicsStraightenLine(point, next_point); - node = node->Next(); + node = node->GetNext(); } if (dc) @@ -433,10 +433,10 @@ void wxLineShape::Unlink() void wxLineShape::SetEnds(double x1, double y1, double x2, double y2) { // Find centre point - wxNode *first_point_node = m_lineControlPoints->First(); - wxNode *last_point_node = m_lineControlPoints->Last(); - wxRealPoint *first_point = (wxRealPoint *)first_point_node->Data(); - wxRealPoint *last_point = (wxRealPoint *)last_point_node->Data(); + wxNode *first_point_node = m_lineControlPoints->GetFirst(); + wxNode *last_point_node = m_lineControlPoints->GetLast(); + wxRealPoint *first_point = (wxRealPoint *)first_point_node->GetData(); + wxRealPoint *last_point = (wxRealPoint *)last_point_node->GetData(); first_point->x = x1; first_point->y = y1; @@ -450,10 +450,10 @@ void wxLineShape::SetEnds(double x1, double y1, double x2, double y2) // Get absolute positions of ends void wxLineShape::GetEnds(double *x1, double *y1, double *x2, double *y2) { - wxNode *first_point_node = m_lineControlPoints->First(); - wxNode *last_point_node = m_lineControlPoints->Last(); - wxRealPoint *first_point = (wxRealPoint *)first_point_node->Data(); - wxRealPoint *last_point = (wxRealPoint *)last_point_node->Data(); + wxNode *first_point_node = m_lineControlPoints->GetFirst(); + wxNode *last_point_node = m_lineControlPoints->GetLast(); + wxRealPoint *first_point = (wxRealPoint *)first_point_node->GetData(); + wxRealPoint *last_point = (wxRealPoint *)last_point_node->GetData(); *x1 = first_point->x; *y1 = first_point->y; *x2 = last_point->x; *y2 = last_point->y; @@ -474,11 +474,11 @@ bool wxLineShape::HitTest(double x, double y, int *attachment, double *distance) bool inLabelRegion = FALSE; for (int i = 0; i < 3; i ++) { - wxNode *regionNode = m_regions.Nth(i); + wxNode *regionNode = m_regions.Item(i); if (regionNode) { - wxShapeRegion *region = (wxShapeRegion *)regionNode->Data(); - if (region->m_formattedText.Number() > 0) + wxShapeRegion *region = (wxShapeRegion *)regionNode->GetData(); + if (region->m_formattedText.GetCount() > 0) { double xp, yp, cx, cy, cw, ch; GetLabelPosition(i, &xp, &yp); @@ -500,12 +500,12 @@ bool wxLineShape::HitTest(double x, double y, int *attachment, double *distance) } } - wxNode *node = m_lineControlPoints->First(); + wxNode *node = m_lineControlPoints->GetFirst(); - while (node && node->Next()) + while (node && node->GetNext()) { - wxRealPoint *point1 = (wxRealPoint *)node->Data(); - wxRealPoint *point2 = (wxRealPoint *)node->Next()->Data(); + wxRealPoint *point1 = (wxRealPoint *)node->GetData(); + wxRealPoint *point2 = (wxRealPoint *)node->GetNext()->GetData(); // Allow for inaccurate mousing or vert/horiz lines int extra = 4; @@ -526,7 +526,7 @@ bool wxLineShape::HitTest(double x, double y, int *attachment, double *distance) return TRUE; } - node = node->Next(); + node = node->GetNext(); } return FALSE; } @@ -538,10 +538,10 @@ void wxLineShape::DrawArrows(wxDC& dc) double endArrowPos = 0.0; double middleArrowPos = 0.0; - wxNode *node = m_arcArrows.First(); + wxNode *node = m_arcArrows.GetFirst(); while (node) { - wxArrowHead *arrow = (wxArrowHead *)node->Data(); + wxArrowHead *arrow = (wxArrowHead *)node->GetData(); switch (arrow->GetArrowEnd()) { case ARROW_POSITION_START: @@ -580,21 +580,21 @@ void wxLineShape::DrawArrows(wxDC& dc) break; } } - node = node->Next(); + node = node->GetNext(); } } void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool proportionalOffset) { - wxNode *first_line_node = m_lineControlPoints->First(); - wxRealPoint *first_line_point = (wxRealPoint *)first_line_node->Data(); - wxNode *second_line_node = first_line_node->Next(); - wxRealPoint *second_line_point = (wxRealPoint *)second_line_node->Data(); + wxNode *first_line_node = m_lineControlPoints->GetFirst(); + wxRealPoint *first_line_point = (wxRealPoint *)first_line_node->GetData(); + wxNode *second_line_node = first_line_node->GetNext(); + wxRealPoint *second_line_point = (wxRealPoint *)second_line_node->GetData(); - wxNode *last_line_node = m_lineControlPoints->Last(); - wxRealPoint *last_line_point = (wxRealPoint *)last_line_node->Data(); - wxNode *second_last_line_node = last_line_node->Previous(); - wxRealPoint *second_last_line_point = (wxRealPoint *)second_last_line_node->Data(); + wxNode *last_line_node = m_lineControlPoints->GetLast(); + wxRealPoint *last_line_point = (wxRealPoint *)last_line_node->GetData(); + wxNode *second_last_line_node = last_line_node->GetPrevious(); + wxRealPoint *second_last_line_point = (wxRealPoint *)second_last_line_node->GetData(); // Position where we want to start drawing double positionOnLineX, positionOnLineY; @@ -859,11 +859,11 @@ void wxLineShape::OnErase(wxDC& dc) // Undraw text regions for (int i = 0; i < 3; i++) { - wxNode *node = m_regions.Nth(i); + wxNode *node = m_regions.Item(i); if (node) { double x, y; - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); GetLabelPosition(i, &x, &y); EraseRegion(dc, region, x, y); } @@ -899,17 +899,17 @@ void wxLineShape::GetBoundingBoxMin(double *w, double *h) double x2 = -10000; double y2 = -10000; - wxNode *node = m_lineControlPoints->First(); + wxNode *node = m_lineControlPoints->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); if (point->x < x1) x1 = point->x; if (point->y < y1) y1 = point->y; if (point->x > x2) x2 = point->x; if (point->y > y2) y2 = point->y; - node = node->Next(); + node = node->GetNext(); } *w = (double)(x2 - x1); *h = (double)(y2 - y1); @@ -924,7 +924,7 @@ void wxLineShape::FindNth(wxShape *image, int *nth, int *no_arcs, bool incoming) { int n = -1; int num = 0; - wxNode *node = image->GetLines().First(); + wxNode *node = image->GetLines().GetFirst(); int this_attachment; if (image == m_to) this_attachment = m_attachmentTo; @@ -934,7 +934,7 @@ void wxLineShape::FindNth(wxShape *image, int *nth, int *no_arcs, bool incoming) // Find number of lines going into/out of this particular attachment point while (node) { - wxLineShape *line = (wxLineShape *)node->Data(); + wxLineShape *line = (wxLineShape *)node->GetData(); if (line->m_from == image) { @@ -958,7 +958,7 @@ void wxLineShape::FindNth(wxShape *image, int *nth, int *no_arcs, bool incoming) num ++; } - node = node->Next(); + node = node->GetNext(); } *nth = n; *no_arcs = num; @@ -988,13 +988,13 @@ bool wxLineShape::OnMovePre(wxDC& dc, double x, double y, double old_x, double o if (m_lineControlPoints && !(x_offset == 0.0 && y_offset == 0.0)) { - wxNode *node = m_lineControlPoints->First(); + wxNode *node = m_lineControlPoints->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); point->x += x_offset; point->y += y_offset; - node = node->Next(); + node = node->GetNext(); } } @@ -1007,10 +1007,10 @@ bool wxLineShape::OnMovePre(wxDC& dc, double x, double y, double old_x, double o m_labelObjects[i]->Erase(dc); double xp, yp, xr, yr; GetLabelPosition(i, &xp, &yp); - wxNode *node = m_regions.Nth(i); + wxNode *node = m_regions.Item(i); if (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->GetPosition(&xr, &yr); } else @@ -1029,7 +1029,7 @@ void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints) if (!m_from || !m_to) return; - if (m_lineControlPoints->Number() > 2) + if (m_lineControlPoints->GetCount() > 2) Initialise(); // Do each end - nothing in the middle. User has to move other points @@ -1039,10 +1039,10 @@ void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints) FindLineEndPoints(&end_x, &end_y, &other_end_x, &other_end_y); - wxNode *first = m_lineControlPoints->First(); - wxRealPoint *first_point = (wxRealPoint *)first->Data(); - wxNode *last = m_lineControlPoints->Last(); - wxRealPoint *last_point = (wxRealPoint *)last->Data(); + wxNode *first = m_lineControlPoints->GetFirst(); + wxRealPoint *first_point = (wxRealPoint *)first->GetData(); + wxNode *last = m_lineControlPoints->GetLast(); + wxRealPoint *last_point = (wxRealPoint *)last->GetData(); /* This is redundant, surely? Done by SetEnds. first_point->x = end_x; first_point->y = end_y; @@ -1066,16 +1066,16 @@ void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints) // Only move control points if it's a self link. And only works if attachment mode is ON. if ((m_from == m_to) && (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE) && moveControlPoints && m_lineControlPoints && !(x_offset == 0.0 && y_offset == 0.0)) { - wxNode *node = m_lineControlPoints->First(); + wxNode *node = m_lineControlPoints->GetFirst(); while (node) { - if ((node != m_lineControlPoints->First()) && (node != m_lineControlPoints->Last())) + if ((node != m_lineControlPoints->GetFirst()) && (node != m_lineControlPoints->GetLast())) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); point->x += x_offset; point->y += y_offset; } - node = node->Next(); + node = node->GetNext(); } } @@ -1096,18 +1096,18 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d double end_x, end_y; double other_end_x, other_end_y; - wxNode *first = m_lineControlPoints->First(); - wxRealPoint *first_point = (wxRealPoint *)first->Data(); - wxNode *last = m_lineControlPoints->Last(); - wxRealPoint *last_point = (wxRealPoint *)last->Data(); + wxNode *first = m_lineControlPoints->GetFirst(); + wxRealPoint *first_point = (wxRealPoint *)first->GetData(); + wxNode *last = m_lineControlPoints->GetLast(); + wxRealPoint *last_point = (wxRealPoint *)last->GetData(); - wxNode *second = first->Next(); - wxRealPoint *second_point = (wxRealPoint *)second->Data(); + wxNode *second = first->GetNext(); + wxRealPoint *second_point = (wxRealPoint *)second->GetData(); - wxNode *second_last = last->Previous(); - wxRealPoint *second_last_point = (wxRealPoint *)second_last->Data(); + wxNode *second_last = last->GetPrevious(); + wxRealPoint *second_last_point = (wxRealPoint *)second_last->GetData(); - if (m_lineControlPoints->Number() > 2) + if (m_lineControlPoints->GetCount() > 2) { if (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { @@ -1181,12 +1181,12 @@ void wxLineShape::OnDraw(wxDC& dc) if (m_brush) dc.SetBrush(* m_brush); - int n = m_lineControlPoints->Number(); + int n = m_lineControlPoints->GetCount(); wxPoint *points = new wxPoint[n]; int i; for (i = 0; i < n; i++) { - wxRealPoint* point = (wxRealPoint*) m_lineControlPoints->Nth(i)->Data(); + wxRealPoint* point = (wxRealPoint*) m_lineControlPoints->Item(i)->GetData(); points[i].x = WXROUND(point->x); points[i].y = WXROUND(point->y); } @@ -1284,10 +1284,10 @@ void wxLineShape::OnDrawContents(wxDC& dc) for (int i = 0; i < 3; i++) { - wxNode *node = m_regions.Nth(i); + wxNode *node = m_regions.Item(i); if (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); double x, y; GetLabelPosition(i, &x, &y); DrawRegion(dc, region, x, y); @@ -1309,10 +1309,10 @@ void wxLineShape::MakeControlPoints() { if (m_canvas && m_lineControlPoints) { - wxNode *first = m_lineControlPoints->First(); - wxNode *last = m_lineControlPoints->Last(); - wxRealPoint *first_point = (wxRealPoint *)first->Data(); - wxRealPoint *last_point = (wxRealPoint *)last->Data(); + wxNode *first = m_lineControlPoints->GetFirst(); + wxNode *last = m_lineControlPoints->GetLast(); + wxRealPoint *first_point = (wxRealPoint *)first->GetData(); + wxRealPoint *last_point = (wxRealPoint *)last->GetData(); wxLineControlPoint *control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, first_point->x, first_point->y, @@ -1322,10 +1322,10 @@ void wxLineShape::MakeControlPoints() m_controlPoints.Append(control); - wxNode *node = first->Next(); + wxNode *node = first->GetNext(); while (node != last) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, point->x, point->y, @@ -1335,7 +1335,7 @@ void wxLineShape::MakeControlPoints() m_canvas->AddShape(control); m_controlPoints.Append(control); - node = node->Next(); + node = node->GetNext(); } control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, last_point->x, last_point->y, @@ -1350,19 +1350,19 @@ void wxLineShape::MakeControlPoints() void wxLineShape::ResetControlPoints() { - if (m_canvas && m_lineControlPoints && m_controlPoints.Number() > 0) + if (m_canvas && m_lineControlPoints && m_controlPoints.GetCount() > 0) { - wxNode *node = m_controlPoints.First(); - wxNode *control_node = m_lineControlPoints->First(); + wxNode *node = m_controlPoints.GetFirst(); + wxNode *control_node = m_lineControlPoints->GetFirst(); while (node && control_node) { - wxRealPoint *point = (wxRealPoint *)control_node->Data(); - wxLineControlPoint *control = (wxLineControlPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)control_node->GetData(); + wxLineControlPoint *control = (wxLineControlPoint *)node->GetData(); control->SetX(point->x); control->SetY(point->y); - node = node->Next(); - control_node = control_node->Next(); + node = node->GetNext(); + control_node = control_node->GetNext(); } } } @@ -1393,10 +1393,10 @@ void wxLineShape::WriteAttributes(wxExpr *clause) // Make a list of lists for the (sp)line controls wxExpr *list = new wxExpr(wxExprList); - wxNode *node = m_lineControlPoints->First(); + wxNode *node = m_lineControlPoints->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); wxExpr *point_list = new wxExpr(wxExprList); wxExpr *x_expr = new wxExpr((double) point->x); wxExpr *y_expr = new wxExpr((double) point->y); @@ -1404,20 +1404,20 @@ void wxLineShape::WriteAttributes(wxExpr *clause) point_list->Append(y_expr); list->Append(point_list); - node = node->Next(); + node = node->GetNext(); } clause->AddAttributeValue("controls", list); // Write arc arrows in new OGL format, if there are any. // This is a list of lists. Each sublist comprises: // (arrowType arrowEnd xOffset arrowSize) - if (m_arcArrows.Number() > 0) + if (m_arcArrows.GetCount() > 0) { wxExpr *arrow_list = new wxExpr(wxExprList); - node = m_arcArrows.First(); + node = m_arcArrows.GetFirst(); while (node) { - wxArrowHead *head = (wxArrowHead *)node->Data(); + wxArrowHead *head = (wxArrowHead *)node->GetData(); wxExpr *head_list = new wxExpr(wxExprList); head_list->Append(new wxExpr((long)head->_GetType())); head_list->Append(new wxExpr((long)head->GetArrowEnd())); @@ -1432,7 +1432,7 @@ void wxLineShape::WriteAttributes(wxExpr *clause) arrow_list->Append(head_list); - node = node->Next(); + node = node->GetNext(); } clause->AddAttributeValue("arrows", arrow_list); } @@ -1454,20 +1454,20 @@ void wxLineShape::ReadAttributes(wxExpr *clause) clause->AssignAttributeValue(wxT("align_end"), &m_alignmentEnd); // Compatibility: check for no regions. - if (m_regions.Number() == 0) + if (m_regions.GetCount() == 0) { wxShapeRegion *newRegion = new wxShapeRegion; newRegion->SetName("Middle"); newRegion->SetSize(150, 50); m_regions.Append((wxObject *)newRegion); - if (m_text.Number() > 0) + if (m_text.GetCount() > 0) { newRegion->ClearText(); - wxNode *node = m_text.First(); + wxNode *node = m_text.GetFirst(); while (node) { - wxShapeTextLine *textLine = (wxShapeTextLine *)node->Data(); - wxNode *next = node->Next(); + wxShapeTextLine *textLine = (wxShapeTextLine *)node->GetData(); + wxNode *next = node->GetNext(); newRegion->GetFormattedText().Append((wxObject *)textLine); delete node; node = next; @@ -1541,16 +1541,16 @@ void wxLineShape::ReadAttributes(wxExpr *clause) wxString arrowName; long arrowId = -1; - wxExpr *type_expr = node->Nth(0); - wxExpr *end_expr = node->Nth(1); - wxExpr *dist_expr = node->Nth(2); - wxExpr *size_expr = node->Nth(3); - wxExpr *name_expr = node->Nth(4); - wxExpr *id_expr = node->Nth(5); + wxExpr *type_expr = node->Item(0); + wxExpr *end_expr = node->Item(1); + wxExpr *dist_expr = node->Item(2); + wxExpr *size_expr = node->Item(3); + wxExpr *name_expr = node->Item(4); + wxExpr *id_expr = node->Item(5); // New members of wxArrowHead - wxExpr *yOffsetExpr = node->Nth(6); - wxExpr *spacingExpr = node->Nth(7); + wxExpr *yOffsetExpr = node->Item(6); + wxExpr *spacingExpr = node->Item(7); if (type_expr) arrowType = (int)type_expr->IntegerValue(); @@ -1600,11 +1600,11 @@ void wxLineShape::Copy(wxShape& copy) lineCopy.m_maintainStraightLines = m_maintainStraightLines; lineCopy.m_lineOrientations.Clear(); - wxNode *node = m_lineOrientations.First(); + wxNode *node = m_lineOrientations.GetFirst(); while (node) { - lineCopy.m_lineOrientations.Append(node->Data()); - node = node->Next(); + lineCopy.m_lineOrientations.Append(node->GetData()); + node = node->GetNext(); } if (lineCopy.m_lineControlPoints) @@ -1615,23 +1615,23 @@ void wxLineShape::Copy(wxShape& copy) lineCopy.m_lineControlPoints = new wxList; - node = m_lineControlPoints->First(); + node = m_lineControlPoints->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *new_point = new wxRealPoint(point->x, point->y); lineCopy.m_lineControlPoints->Append((wxObject*) new_point); - node = node->Next(); + node = node->GetNext(); } // Copy arrows lineCopy.ClearArrowsAtPosition(-1); - node = m_arcArrows.First(); + node = m_arcArrows.GetFirst(); while (node) { - wxArrowHead *arrow = (wxArrowHead *)node->Data(); + wxArrowHead *arrow = (wxArrowHead *)node->GetData(); lineCopy.m_arcArrows.Append(new wxArrowHead(*arrow)); - node = node->Next(); + node = node->GetNext(); } } @@ -1643,11 +1643,11 @@ void wxLineShape::Select(bool select, wxDC* dc) { for (int i = 0; i < 3; i++) { - wxNode *node = m_regions.Nth(i); + wxNode *node = m_regions.Item(i); if (node) { - wxShapeRegion *region = (wxShapeRegion *)node->Data(); - if (region->m_formattedText.Number() > 0) + wxShapeRegion *region = (wxShapeRegion *)node->GetData(); + if (region->m_formattedText.GetCount() > 0) { double w, h, x, y, xx, yy; region->GetSize(&w, &h); @@ -1874,8 +1874,8 @@ void wxLineShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, in // Needed? #if 0 int i = 0; - for (i = 0; i < lineShape->GetLineControlPoints()->Number(); i++) - if (((wxRealPoint *)(lineShape->GetLineControlPoints()->Nth(i)->Data())) == lpt->m_point) + for (i = 0; i < lineShape->GetLineControlPoints()->GetCount(); i++) + if (((wxRealPoint *)(lineShape->GetLineControlPoints()->Item(i)->GetData())) == lpt->m_point) break; // N.B. in OnMoveControlPoint, an event handler in Hardy could have deselected @@ -1981,8 +1981,8 @@ void wxLineControlPoint::OnEndDragRight(double x, double y, int keys, int attach } } int i = 0; - for (i = 0; i < lineShape->GetLineControlPoints()->Number(); i++) - if (((wxRealPoint *)(lineShape->GetLineControlPoints()->Nth(i)->Data())) == m_point) + for (i = 0; i < lineShape->GetLineControlPoints()->GetCount(); i++) + if (((wxRealPoint *)(lineShape->GetLineControlPoints()->Item(i)->GetData())) == m_point) break; lineShape->OnMoveControlPoint(i+1, x, y); if (!m_canvas->GetQuickEditMode()) m_canvas->Redraw(dc); @@ -2023,15 +2023,15 @@ wxArrowHead *wxLineShape::AddArrow(WXTYPE type, int end, double size, double xOf */ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end) { - wxNode *refNode = referenceList.First(); - wxNode *currNode = m_arcArrows.First(); + wxNode *refNode = referenceList.GetFirst(); + wxNode *currNode = m_arcArrows.GetFirst(); wxString targetName(arrow->GetName()); if (!refNode) return FALSE; // First check whether we need to insert in front of list, // because this arrowhead is the first in the reference // list and should therefore be first in the current list. - wxArrowHead *refArrow = (wxArrowHead *)refNode->Data(); + wxArrowHead *refArrow = (wxArrowHead *)refNode->GetData(); if (refArrow->GetName() == targetName) { m_arcArrows.Insert(arrow); @@ -2040,16 +2040,16 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int while (refNode && currNode) { - wxArrowHead *currArrow = (wxArrowHead *)currNode->Data(); - refArrow = (wxArrowHead *)refNode->Data(); + wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData(); + refArrow = (wxArrowHead *)refNode->GetData(); // Matching: advance current arrow pointer if ((currArrow->GetArrowEnd() == end) && (currArrow->GetName() == refArrow->GetName())) { - currNode = currNode->Next(); // Could be NULL now + currNode = currNode->GetNext(); // Could be NULL now if (currNode) - currArrow = (wxArrowHead *)currNode->Data(); + currArrow = (wxArrowHead *)currNode->GetData(); } // Check if we're at the correct position in the @@ -2062,7 +2062,7 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int m_arcArrows.Append(arrow); return TRUE; } - refNode = refNode->Next(); + refNode = refNode->GetNext(); } m_arcArrows.Append(arrow); return TRUE; @@ -2070,11 +2070,11 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int void wxLineShape::ClearArrowsAtPosition(int end) { - wxNode *node = m_arcArrows.First(); + wxNode *node = m_arcArrows.GetFirst(); while (node) { - wxArrowHead *arrow = (wxArrowHead *)node->Data(); - wxNode *next = node->Next(); + wxArrowHead *arrow = (wxArrowHead *)node->GetData(); + wxNode *next = node->GetNext(); switch (end) { case -1: @@ -2117,17 +2117,17 @@ void wxLineShape::ClearArrowsAtPosition(int end) bool wxLineShape::ClearArrow(const wxString& name) { - wxNode *node = m_arcArrows.First(); + wxNode *node = m_arcArrows.GetFirst(); while (node) { - wxArrowHead *arrow = (wxArrowHead *)node->Data(); + wxArrowHead *arrow = (wxArrowHead *)node->GetData(); if (arrow->GetName() == name) { delete arrow; delete node; return TRUE; } - node = node->Next(); + node = node->GetNext(); } return FALSE; } @@ -2139,27 +2139,27 @@ bool wxLineShape::ClearArrow(const wxString& name) wxArrowHead *wxLineShape::FindArrowHead(int position, const wxString& name) { - wxNode *node = m_arcArrows.First(); + wxNode *node = m_arcArrows.GetFirst(); while (node) { - wxArrowHead *arrow = (wxArrowHead *)node->Data(); + wxArrowHead *arrow = (wxArrowHead *)node->GetData(); if (((position == -1) || (position == arrow->GetArrowEnd())) && (arrow->GetName() == name)) return arrow; - node = node->Next(); + node = node->GetNext(); } return NULL; } wxArrowHead *wxLineShape::FindArrowHead(long arrowId) { - wxNode *node = m_arcArrows.First(); + wxNode *node = m_arcArrows.GetFirst(); while (node) { - wxArrowHead *arrow = (wxArrowHead *)node->Data(); + wxArrowHead *arrow = (wxArrowHead *)node->GetData(); if (arrowId == arrow->GetId()) return arrow; - node = node->Next(); + node = node->GetNext(); } return NULL; } @@ -2171,10 +2171,10 @@ wxArrowHead *wxLineShape::FindArrowHead(long arrowId) bool wxLineShape::DeleteArrowHead(int position, const wxString& name) { - wxNode *node = m_arcArrows.First(); + wxNode *node = m_arcArrows.GetFirst(); while (node) { - wxArrowHead *arrow = (wxArrowHead *)node->Data(); + wxArrowHead *arrow = (wxArrowHead *)node->GetData(); if (((position == -1) || (position == arrow->GetArrowEnd())) && (arrow->GetName() == name)) { @@ -2182,7 +2182,7 @@ bool wxLineShape::DeleteArrowHead(int position, const wxString& name) delete node; return TRUE; } - node = node->Next(); + node = node->GetNext(); } return FALSE; } @@ -2190,17 +2190,17 @@ bool wxLineShape::DeleteArrowHead(int position, const wxString& name) // Overloaded DeleteArrowHead: pass arrowhead id. bool wxLineShape::DeleteArrowHead(long id) { - wxNode *node = m_arcArrows.First(); + wxNode *node = m_arcArrows.GetFirst(); while (node) { - wxArrowHead *arrow = (wxArrowHead *)node->Data(); + wxArrowHead *arrow = (wxArrowHead *)node->GetData(); if (arrow->GetId() == id) { delete arrow; delete node; return TRUE; } - node = node->Next(); + node = node->GetNext(); } return FALSE; } @@ -2214,15 +2214,15 @@ bool wxLineShape::DeleteArrowHead(long id) double wxLineShape::FindMinimumWidth() { double minWidth = 0.0; - wxNode *node = m_arcArrows.First(); + wxNode *node = m_arcArrows.GetFirst(); while (node) { - wxArrowHead *arrowHead = (wxArrowHead *)node->Data(); + wxArrowHead *arrowHead = (wxArrowHead *)node->GetData(); minWidth += arrowHead->GetSize(); - if (node->Next()) + if (node->GetNext()) minWidth += arrowHead->GetSpacing(); - node = node->Next(); + node = node->GetNext(); } // We have ABSOLUTE minimum now. So // scale it to give it reasonable aesthetics @@ -2319,7 +2319,7 @@ int wxLineShape::GetAlignmentType(bool isEnd) wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject) { - int n = m_lineControlPoints->Number(); + int n = m_lineControlPoints->GetCount(); int nn = 0; if (m_to == nodeObject) { @@ -2328,10 +2328,10 @@ wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject) nn = n - 2; } else nn = 1; - wxNode *node = m_lineControlPoints->Nth(nn); + wxNode *node = m_lineControlPoints->Item(nn); if (node) { - return (wxRealPoint *)node->Data(); + return (wxRealPoint *)node->GetData(); } else return FALSE; @@ -2471,14 +2471,14 @@ bool wxLineShape::OnLabelMovePre(wxDC& dc, wxLabelShape* labelShape, double x, d // Find position in line's region list int i = 0; - wxNode *node = GetRegions().First(); + wxNode *node = GetRegions().GetFirst(); while (node) { - if (labelShape->m_shapeRegion == (wxShapeRegion *)node->Data()) + if (labelShape->m_shapeRegion == (wxShapeRegion *)node->GetData()) node = NULL; else { - node = node->Next(); + node = node->GetNext(); i ++; } } diff --git a/contrib/src/ogl/mfutils.cpp b/contrib/src/ogl/mfutils.cpp index 2d752cb1b5..27f471e414 100644 --- a/contrib/src/ogl/mfutils.cpp +++ b/contrib/src/ogl/mfutils.cpp @@ -479,7 +479,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) metaRecords.Append(rec); gdiObjects.Append(rec); AddMetaRecordHandle(rec); - rec->param2 = (long)(gdiObjects.Number() - 1); + rec->param2 = (long)(gdiObjects.GetCount() - 1); break; } // case META_STRETCHDIB: @@ -504,7 +504,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) metaRecords.Append(rec); gdiObjects.Append(rec); AddMetaRecordHandle(rec); - rec->param2 = (long)(gdiObjects.Number() - 1); + rec->param2 = (long)(gdiObjects.GetCount() - 1); break; } case META_CREATEBRUSH: @@ -514,7 +514,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) metaRecords.Append(rec); gdiObjects.Append(rec); AddMetaRecordHandle(rec); - rec->param2 = (long)(gdiObjects.Number() - 1); + rec->param2 = (long)(gdiObjects.GetCount() - 1); break; } case META_CREATEPATTERNBRUSH: @@ -524,7 +524,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) metaRecords.Append(rec); gdiObjects.Append(rec); AddMetaRecordHandle(rec); - rec->param2 = (long)(gdiObjects.Number() - 1); + rec->param2 = (long)(gdiObjects.GetCount() - 1); break; } case META_CREATEPENINDIRECT: @@ -550,7 +550,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) gdiObjects.Append(rec); AddMetaRecordHandle(rec); - rec->param2 = (long)(gdiObjects.Number() - 1); + rec->param2 = (long)(gdiObjects.GetCount() - 1); // For some reason, the size of this record is sometimes 9 words!!! // instead of the usual 8. So read 2 characters extra. @@ -622,7 +622,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) metaRecords.Append(rec); gdiObjects.Append(rec); AddMetaRecordHandle(rec); - rec->param2 = (long)(gdiObjects.Number() - 1); + rec->param2 = (long)(gdiObjects.GetCount() - 1); break; } case META_CREATEBRUSHINDIRECT: @@ -679,7 +679,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) metaRecords.Append(rec); gdiObjects.Append(rec); AddMetaRecordHandle(rec); - rec->param2 = (long)(gdiObjects.Number() - 1); + rec->param2 = (long)(gdiObjects.GetCount() - 1); break; } case META_CREATEBITMAPINDIRECT: @@ -690,7 +690,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) metaRecords.Append(rec); gdiObjects.Append(rec); AddMetaRecordHandle(rec); - rec->param2 = (long)(gdiObjects.Number() - 1); + rec->param2 = (long)(gdiObjects.GetCount() - 1); break; } case META_CREATEBITMAP: @@ -701,7 +701,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) metaRecords.Append(rec); gdiObjects.Append(rec); AddMetaRecordHandle(rec); - rec->param2 = (long)(gdiObjects.Number() - 1); + rec->param2 = (long)(gdiObjects.GetCount() - 1); break; } case META_CREATEREGION: @@ -712,7 +712,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) metaRecords.Append(rec); gdiObjects.Append(rec); AddMetaRecordHandle(rec); - rec->param2 = (long)(gdiObjects.Number() - 1); + rec->param2 = (long)(gdiObjects.GetCount() - 1); break; } default: @@ -728,12 +728,12 @@ bool wxXMetaFile::ReadFile(const wxChar *file) wxXMetaFile::~wxXMetaFile(void) { - wxNode *node = metaRecords.First(); + wxNode *node = metaRecords.GetFirst(); while (node) { - wxMetaRecord *rec = (wxMetaRecord *)node->Data(); + wxMetaRecord *rec = (wxMetaRecord *)node->GetData(); delete rec; - wxNode *next = node->Next(); + wxNode *next = node->GetNext(); delete node; node = next; } @@ -746,10 +746,10 @@ bool wxXMetaFile::SetClipboard(int width, int height) bool wxXMetaFile::Play(wxDC *dc) { - wxNode *node = metaRecords.First(); + wxNode *node = metaRecords.GetFirst(); while (node) { - wxMetaRecord *rec = (wxMetaRecord *)node->Data(); + wxMetaRecord *rec = (wxMetaRecord *)node->GetData(); int rdFunction = rec->metaFunction; switch (rdFunction) @@ -1080,7 +1080,7 @@ bool wxXMetaFile::Play(wxDC *dc) break; } } - node = node->Next(); + node = node->GetNext(); } return TRUE; } diff --git a/contrib/src/ogl/misc.cpp b/contrib/src/ogl/misc.cpp index d40bd8a896..50cc5b9c7e 100644 --- a/contrib/src/ogl/misc.cpp +++ b/contrib/src/ogl/misc.cpp @@ -172,7 +172,7 @@ void oglCentreText(wxDC& dc, wxList *text_list, double m_xpos, double m_ypos, double width, double height, int formatMode) { - int n = text_list->Number(); + int n = text_list->GetCount(); if (!text_list || (n == 0)) return; @@ -186,17 +186,17 @@ void oglCentreText(wxDC& dc, wxList *text_list, // Store text extents for speed double *widths = new double[n]; - wxNode *current = text_list->First(); + wxNode *current = text_list->GetFirst(); int i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); dc.GetTextExtent(line->GetText(), ¤t_width, &char_height); widths[i] = current_width; if (current_width > max_width) max_width = current_width; - current = current->Next(); + current = current->GetNext(); i ++; } @@ -229,12 +229,12 @@ void oglCentreText(wxDC& dc, wxList *text_list, xOffset = 0.0; } - current = text_list->First(); + current = text_list->GetFirst(); i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); double x; if ((formatMode & FORMAT_CENTRE_HORIZ) && (widths[i] < width)) @@ -244,7 +244,7 @@ void oglCentreText(wxDC& dc, wxList *text_list, double y = (double)(i*char_height + yoffset); line->SetX( x - xOffset ); line->SetY( y - yOffset ); - current = current->Next(); + current = current->GetNext(); i ++; } @@ -255,7 +255,7 @@ void oglCentreText(wxDC& dc, wxList *text_list, void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, double m_xpos, double m_ypos, double width, double height) { - int n = text_list->Number(); + int n = text_list->GetCount(); if (!text_list || (n == 0)) return; @@ -269,17 +269,17 @@ void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, // Store text extents for speed double *widths = new double[n]; - wxNode *current = text_list->First(); + wxNode *current = text_list->GetFirst(); int i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); dc.GetTextExtent(line->GetText(), ¤t_width, &char_height); widths[i] = current_width; if (current_width > max_width) max_width = current_width; - current = current->Next(); + current = current->GetNext(); i ++; } @@ -289,18 +289,18 @@ void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, double xoffset = (double)(m_xpos - width/2.0); - current = text_list->First(); + current = text_list->GetFirst(); i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); double x = (double)((width - widths[i])/2.0 + xoffset); double y = (double)(i*char_height + yoffset); line->SetX( x - m_xpos ); line->SetY( y - m_ypos ); - current = current->Next(); + current = current->GetNext(); i ++; } delete widths; @@ -310,7 +310,7 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list, double m_xpos, double m_ypos, double width, double height, double *actual_width, double *actual_height) { - int n = text_list->Number(); + int n = text_list->GetCount(); if (!text_list || (n == 0)) { @@ -325,16 +325,16 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list, long max_width = 0; long current_width = 0; - wxNode *current = text_list->First(); + wxNode *current = text_list->GetFirst(); int i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); dc.GetTextExtent(line->GetText(), ¤t_width, &char_height); if (current_width > max_width) max_width = current_width; - current = current->Next(); + current = current->GetNext(); i ++; } @@ -411,14 +411,14 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double wxStringList *string_list = new wxStringList; wxString buffer; - wxNode *node = word_list.First(); + wxNode *node = (wxNode*)word_list.GetFirst(); long x, y; while (node) { wxString oldBuffer(buffer); - wxChar *s = (wxChar *)node->Data(); + wxChar *s = (wxChar *)node->GetData(); if (!s) { // FORCE NEW LINE @@ -447,7 +447,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double } } - node = node->Next(); + node = node->GetNext(); } if (buffer.Length() != 0) string_list->Add(buffer); @@ -474,13 +474,13 @@ void oglDrawFormattedText(wxDC& dc, wxList *text_list, (long)(m_xpos - width/2.0), (long)(m_ypos - height/2.0), (long)width, (long)height); - wxNode *current = text_list->First(); + wxNode *current = text_list->GetFirst(); while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); dc.DrawText(line->GetText(), WXROUND(xoffset + line->GetX()), WXROUND(yoffset + line->GetY())); - current = current->Next(); + current = current->GetNext(); } dc.DestroyClippingRegion(); @@ -496,17 +496,17 @@ void oglFindPolylineCentroid(wxList *points, double *x, double *y) double xcount = 0; double ycount = 0; - wxNode *node = points->First(); + wxNode *node = points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); xcount += point->x; ycount += point->y; - node = node->Next(); + node = node->GetNext(); } - *x = (xcount/points->Number()); - *y = (ycount/points->Number()); + *x = (xcount/points->GetCount()); + *y = (ycount/points->GetCount()); } /* @@ -774,12 +774,12 @@ void UpdateListBox(wxListBox *item, wxList *list) if (!list) return; - wxNode *node = list->First(); + wxNode *node = list->GetFirst(); while (node) { - wxChar *s = (wxChar *)node->Data(); + wxChar *s = (wxChar *)node->GetData(); item->Append(s); - node = node->Next(); + node = node->GetNext(); } } diff --git a/contrib/src/ogl/ogldiag.cpp b/contrib/src/ogl/ogldiag.cpp index a1b71884b0..932bbcdf75 100644 --- a/contrib/src/ogl/ogldiag.cpp +++ b/contrib/src/ogl/ogldiag.cpp @@ -87,15 +87,15 @@ void wxDiagram::Redraw(wxDC& dc) { if (GetCanvas()) GetCanvas()->SetCursor(* wxHOURGLASS_CURSOR); - wxNode *current = m_shapeList->First(); + wxNode *current = m_shapeList->GetFirst(); while (current) { - wxShape *object = (wxShape *)current->Data(); + wxShape *object = (wxShape *)current->GetData(); if (!object->GetParent()) object->Draw(dc); - current = current->Next(); + current = current->GetNext(); } if (GetCanvas()) GetCanvas()->SetCursor(* wxSTANDARD_CURSOR); @@ -118,8 +118,8 @@ void wxDiagram::AddShape(wxShape *object, wxShape *addAfter) { if (nodeAfter) { - if (nodeAfter->Next()) - m_shapeList->Insert(nodeAfter->Next(), object); + if (nodeAfter->GetNext()) + m_shapeList->Insert(nodeAfter->GetNext(), object); else m_shapeList->Append(object); } @@ -148,31 +148,31 @@ void wxDiagram::RemoveAllShapes() void wxDiagram::DeleteAllShapes() { - wxNode *node = m_shapeList->First(); + wxNode *node = m_shapeList->GetFirst(); while (node) { - wxShape *shape = (wxShape *)node->Data(); + wxShape *shape = (wxShape *)node->GetData(); if (!shape->GetParent()) { RemoveShape(shape); delete shape; - node = m_shapeList->First(); + node = m_shapeList->GetFirst(); } else - node = node->Next(); + node = node->GetNext(); } } void wxDiagram::ShowAll(bool show) { - wxNode *current = m_shapeList->First(); + wxNode *current = m_shapeList->GetFirst(); while (current) { - wxShape *object = (wxShape *)current->Data(); + wxShape *object = (wxShape *)current->GetData(); object->Show(show); - current = current->Next(); + current = current->GetNext(); } } @@ -204,12 +204,12 @@ void wxDiagram::DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2 // Make sure all text that should be centred, is centred. void wxDiagram::RecentreAll(wxDC& dc) { - wxNode *object_node = m_shapeList->First(); + wxNode *object_node = m_shapeList->GetFirst(); while (object_node) { - wxShape *obj = (wxShape *)object_node->Data(); + wxShape *obj = (wxShape *)object_node->GetData(); obj->Recentre(dc); - object_node = object_node->Next(); + object_node = object_node->GetNext(); } } @@ -227,10 +227,10 @@ bool wxDiagram::SaveFile(const wxString& filename) database->Append(header); - wxNode *node = m_shapeList->First(); + wxNode *node = m_shapeList->GetFirst(); while (node) { - wxShape *shape = (wxShape *)node->Data(); + wxShape *shape = (wxShape *)node->GetData(); if (!shape->IsKindOf(CLASSINFO(wxControlPoint))) { @@ -314,7 +314,7 @@ bool wxDiagram::LoadFile(const wxString& filename) wxNode *node = database.First(); while (node) { - wxExpr *clause = (wxExpr *)node->Data(); + wxExpr *clause = (wxExpr *)node->GetData(); long id = -1; clause->GetAttributeValue("id", id); wxRegisterId(id); @@ -453,7 +453,7 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database) if (divisionExpr) { int i = 0; - wxExpr *idExpr = divisionExpr->Nth(i); + wxExpr *idExpr = divisionExpr->Item(i); while (idExpr) { long divisionId = idExpr->IntegerValue(); @@ -510,7 +510,7 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database) } } i ++; - idExpr = divisionExpr->Nth(i); + idExpr = divisionExpr->Item(i); } } } @@ -540,7 +540,7 @@ bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) wxNode *node = shape.GetChildren().First(); while (node) { - wxShape *childShape = (wxShape *)node->Data(); + wxShape *childShape = (wxShape *)node->GetData(); wxExpr *childExpr = new wxExpr("shape"); OnShapeSave(db, *childShape, *childExpr); node = node->Next(); @@ -576,13 +576,13 @@ void wxDiagram::SetCanvas(wxShapeCanvas *can) // Find a shape by its id wxShape* wxDiagram::FindShape(long id) const { - wxNode* node = GetShapeList()->First(); + wxNode* node = GetShapeList()->GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); if (shape->GetId() == id) return shape; - node = node->Next(); + node = node->GetNext(); } return NULL; } @@ -602,27 +602,27 @@ wxLineCrossings::~wxLineCrossings() void wxLineCrossings::FindCrossings(wxDiagram& diagram) { ClearCrossings(); - wxNode* node1 = diagram.GetShapeList()->First(); + wxNode* node1 = diagram.GetShapeList()->GetFirst(); while (node1) { - wxShape* shape1 = (wxShape*) node1->Data(); + wxShape* shape1 = (wxShape*) node1->GetData(); if (shape1->IsKindOf(CLASSINFO(wxLineShape))) { wxLineShape* lineShape1 = (wxLineShape*) shape1; // Iterate through the segments wxList* pts1 = lineShape1->GetLineControlPoints(); int i; - for (i = 0; i < (pts1->Number() - 1); i++) + for (i = 0; i < (pts1->GetCount() - 1); i++) { - wxRealPoint* pt1_a = (wxRealPoint*) (pts1->Nth(i)->Data()); - wxRealPoint* pt1_b = (wxRealPoint*) (pts1->Nth(i+1)->Data()); + wxRealPoint* pt1_a = (wxRealPoint*) (pts1->Item(i)->GetData()); + wxRealPoint* pt1_b = (wxRealPoint*) (pts1->Item(i+1)->GetData()); // Now we iterate through the segments again - wxNode* node2 = diagram.GetShapeList()->First(); + wxNode* node2 = diagram.GetShapeList()->GetFirst(); while (node2) { - wxShape* shape2 = (wxShape*) node2->Data(); + wxShape* shape2 = (wxShape*) node2->GetData(); // Assume that the same line doesn't cross itself if (shape2->IsKindOf(CLASSINFO(wxLineShape)) && (shape1 != shape2)) @@ -631,10 +631,10 @@ void wxLineCrossings::FindCrossings(wxDiagram& diagram) // Iterate through the segments wxList* pts2 = lineShape2->GetLineControlPoints(); int j; - for (j = 0; j < (pts2->Number() - 1); j++) + for (j = 0; j < (pts2->GetCount() - 1); j++) { - wxRealPoint* pt2_a = (wxRealPoint*) (pts2->Nth(j)->Data()); - wxRealPoint* pt2_b = (wxRealPoint*) (pts2->Nth(j+1)->Data()); + wxRealPoint* pt2_a = (wxRealPoint*) (pts2->Item(j)->GetData()); + wxRealPoint* pt2_b = (wxRealPoint*) (pts2->Item(j+1)->GetData()); // Now let's see if these two segments cross. double ratio1, ratio2; @@ -661,12 +661,12 @@ void wxLineCrossings::FindCrossings(wxDiagram& diagram) } } } - node2 = node2->Next(); + node2 = node2->GetNext(); } } } - node1 = node1->Next(); + node1 = node1->GetNext(); } } @@ -676,10 +676,10 @@ void wxLineCrossings::DrawCrossings(wxDiagram& diagram, wxDC& dc) long arcWidth = 8; - wxNode* node = m_crossings.First(); + wxNode* node = m_crossings.GetFirst(); while (node) { - wxLineCrossing* crossing = (wxLineCrossing*) node->Data(); + wxLineCrossing* crossing = (wxLineCrossing*) node->GetData(); // dc.DrawEllipse((long) (crossing->m_intersect.x - (arcWidth/2.0) + 0.5), (long) (crossing->m_intersect.y - (arcWidth/2.0) + 0.5), // arcWidth, arcWidth); @@ -731,18 +731,18 @@ void wxLineCrossings::DrawCrossings(wxDiagram& diagram, wxDC& dc) dc.SetPen(*wxWHITE_PEN); dc.DrawLine( (long) arcX1, (long) arcY1, (long) arcX2, (long) arcY2 ); - node = node->Next(); + node = node->GetNext(); } } void wxLineCrossings::ClearCrossings() { - wxNode* node = m_crossings.First(); + wxNode* node = m_crossings.GetFirst(); while (node) { - wxLineCrossing* crossing = (wxLineCrossing*) node->Data(); + wxLineCrossing* crossing = (wxLineCrossing*) node->GetData(); delete crossing; - node = node->Next(); + node = node->GetNext(); } m_crossings.Clear(); } diff --git a/contrib/src/ogl/oglmisc.cpp b/contrib/src/ogl/oglmisc.cpp index 30deb1d87b..e5cb93999d 100644 --- a/contrib/src/ogl/oglmisc.cpp +++ b/contrib/src/ogl/oglmisc.cpp @@ -205,7 +205,7 @@ void oglCentreText(wxDC& dc, wxList *text_list, double m_xpos, double m_ypos, double width, double height, int formatMode) { - int n = text_list->Number(); + int n = text_list->GetCount(); if (!text_list || (n == 0)) return; @@ -219,11 +219,11 @@ void oglCentreText(wxDC& dc, wxList *text_list, // Store text extents for speed double *widths = new double[n]; - wxNode *current = text_list->First(); + wxNode *current = text_list->GetFirst(); int i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); dc.GetTextExtent(line->GetText(), ¤t_width, &char_height); widths[i] = current_width; @@ -262,12 +262,12 @@ void oglCentreText(wxDC& dc, wxList *text_list, xOffset = 0.0; } - current = text_list->First(); + current = text_list->GetFirst(); i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); double x; if ((formatMode & FORMAT_CENTRE_HORIZ) && (widths[i] < width)) @@ -288,7 +288,7 @@ void oglCentreText(wxDC& dc, wxList *text_list, void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, double m_xpos, double m_ypos, double width, double height) { - int n = text_list->Number(); + int n = text_list->GetCount(); if (!text_list || (n == 0)) return; @@ -302,11 +302,11 @@ void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, // Store text extents for speed double *widths = new double[n]; - wxNode *current = text_list->First(); + wxNode *current = text_list->GetFirst(); int i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); dc.GetTextExtent(line->GetText(), ¤t_width, &char_height); widths[i] = current_width; @@ -322,12 +322,12 @@ void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, double xoffset = (double)(m_xpos - width/2.0); - current = text_list->First(); + current = text_list->GetFirst(); i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); double x = (double)((width - widths[i])/2.0 + xoffset); double y = (double)(i*char_height + yoffset); @@ -343,7 +343,7 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list, double m_xpos, double m_ypos, double width, double height, double *actual_width, double *actual_height) { - int n = text_list->Number(); + int n = text_list->GetCount(); if (!text_list || (n == 0)) { @@ -358,11 +358,11 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list, long max_width = 0; long current_width = 0; - wxNode *current = text_list->First(); + wxNode *current = text_list->GetFirst(); int i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); dc.GetTextExtent(line->GetText(), ¤t_width, &char_height); if (current_width > max_width) @@ -452,7 +452,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double { wxString oldBuffer(buffer); - char *s = (char *)node->Data(); + char *s = (char *)node->GetData(); if (!s) { // FORCE NEW LINE @@ -508,10 +508,10 @@ void oglDrawFormattedText(wxDC& dc, wxList *text_list, (long)(m_xpos - width/2.0), (long)(m_ypos - height/2.0), (long)width, (long)height); - wxNode *current = text_list->First(); + wxNode *current = text_list->GetFirst(); while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); dc.DrawText(line->GetText(), WXROUND(xoffset + line->GetX()), WXROUND(yoffset + line->GetY())); current = current->Next(); @@ -530,17 +530,17 @@ void oglFindPolylineCentroid(wxList *points, double *x, double *y) double xcount = 0; double ycount = 0; - wxNode *node = points->First(); + wxNode *node = points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); xcount += point->x; ycount += point->y; node = node->Next(); } - *x = (xcount/points->Number()); - *y = (ycount/points->Number()); + *x = (xcount/points->GetCount()); + *y = (ycount/points->GetCount()); } /* @@ -808,10 +808,10 @@ void UpdateListBox(wxListBox *item, wxList *list) if (!list) return; - wxNode *node = list->First(); + wxNode *node = list->GetFirst(); while (node) { - char *s = (char *)node->Data(); + char *s = (char *)node->GetData(); item->Append(s); node = node->Next(); } -- 2.45.2