Removed deprecation warnings in OGL and Gizmos

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-03-25 06:58:05 +00:00
parent 1e4a197e4c
commit b9ac87bc5c
16 changed files with 1008 additions and 1008 deletions

View File

@@ -339,7 +339,7 @@ class wxShape: public wxShapeEvtHandler
virtual wxFont *GetFont(int regionId = 0) const; virtual wxFont *GetFont(int regionId = 0) const;
virtual void SetTextColour(const wxString& colour, int regionId = 0); virtual void SetTextColour(const wxString& colour, int regionId = 0);
virtual wxString GetTextColour(int regionId = 0) const; 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); virtual void SetRegionName(const wxString& name, int regionId = 0);
// Get the name representing the region for this image alone. // Get the name representing the region for this image alone.

View File

@@ -74,7 +74,7 @@ class wxPseudoMetaFile: public wxObject
inline wxList& GetOps() const { return (wxList&) m_ops; } inline wxList& GetOps() const { return (wxList&) m_ops; }
// Is this a valid (non-empty) metafile? // 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: public:
/// Set of functions for drawing into a pseudo metafile. /// Set of functions for drawing into a pseudo metafile.

View File

@@ -62,7 +62,7 @@ public:
inline void SetMouseTolerance(int tol) { m_mouseTolerance = tol; } inline void SetMouseTolerance(int tol) { m_mouseTolerance = tol; }
inline int GetMouseTolerance() const { return m_mouseTolerance; } inline int GetMouseTolerance() const { return m_mouseTolerance; }
inline wxList *GetShapeList() const { return m_shapeList; } 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. // Make sure all text that should be centred, is centred.
void RecentreAll(wxDC& dc); void RecentreAll(wxDC& dc);

View File

@@ -629,9 +629,9 @@ wxSplitterScrolledWindow::wxSplitterScrolledWindow(wxWindow* parent, wxWindowID
void wxSplitterScrolledWindow::OnSize(wxSizeEvent& event) void wxSplitterScrolledWindow::OnSize(wxSizeEvent& event)
{ {
wxSize sz = GetClientSize(); 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 // Find targets in splitter window and send the event to them
wxNode* node = GetChildren().First(); wxWindowListNode* node = GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindow* child = (wxWindow*) node->Data(); wxWindow* child = (wxWindow*) node->GetData();
if (child->IsKindOf(CLASSINFO(wxSplitterWindow))) if (child->IsKindOf(CLASSINFO(wxSplitterWindow)))
{ {
wxSplitterWindow* splitter = (wxSplitterWindow*) child; wxSplitterWindow* splitter = (wxSplitterWindow*) child;
@@ -695,7 +695,7 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
splitter->GetWindow2()->ProcessEvent(event); splitter->GetWindow2()->ProcessEvent(event);
break; break;
} }
node = node->Next(); node = node->GetNext();
} }
#ifdef __WXMAC__ #ifdef __WXMAC__

File diff suppressed because it is too large Load Diff

View File

@@ -71,13 +71,13 @@ void wxPolygonShape::Create(wxList *the_points)
// Duplicate the list of points // Duplicate the list of points
m_points = new wxList; m_points = new wxList;
wxNode *node = the_points->First(); wxNode *node = the_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxRealPoint *new_point = new wxRealPoint(point->x, point->y); wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
m_points->Append((wxObject*) new_point); m_points->Append((wxObject*) new_point);
node = node->Next(); node = node->GetNext();
} }
CalculateBoundingBox(); CalculateBoundingBox();
m_originalWidth = m_boundWidth; m_originalWidth = m_boundWidth;
@@ -94,26 +94,26 @@ void wxPolygonShape::ClearPoints()
{ {
if (m_points) if (m_points)
{ {
wxNode *node = m_points->First(); wxNode *node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
delete point; delete point;
delete node; delete node;
node = m_points->First(); node = m_points->GetFirst();
} }
delete m_points; delete m_points;
m_points = NULL; m_points = NULL;
} }
if (m_originalPoints) if (m_originalPoints)
{ {
wxNode *node = m_originalPoints->First(); wxNode *node = m_originalPoints->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
delete point; delete point;
delete node; delete node;
node = m_originalPoints->First(); node = m_originalPoints->GetFirst();
} }
delete m_originalPoints; delete m_originalPoints;
m_originalPoints = NULL; m_originalPoints = NULL;
@@ -136,17 +136,17 @@ void wxPolygonShape::CalculateBoundingBox()
double top = 10000; double top = 10000;
double bottom = -10000; double bottom = -10000;
wxNode *node = m_points->First(); wxNode *node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
if (point->x < left) left = point->x; if (point->x < left) left = point->x;
if (point->x > right) right = point->x; if (point->x > right) right = point->x;
if (point->y < top) top = point->y; if (point->y < top) top = point->y;
if (point->y > bottom) bottom = point->y; if (point->y > bottom) bottom = point->y;
node = node->Next(); node = node->GetNext();
} }
m_boundWidth = right - left; m_boundWidth = right - left;
m_boundHeight = bottom - top; m_boundHeight = bottom - top;
@@ -164,17 +164,17 @@ void wxPolygonShape::CalculatePolygonCentre()
double top = 10000; double top = 10000;
double bottom = -10000; double bottom = -10000;
wxNode *node = m_points->First(); wxNode *node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
if (point->x < left) left = point->x; if (point->x < left) left = point->x;
if (point->x > right) right = point->x; if (point->x > right) right = point->x;
if (point->y < top) top = point->y; if (point->y < top) top = point->y;
if (point->y > bottom) bottom = point->y; if (point->y > bottom) bottom = point->y;
node = node->Next(); node = node->GetNext();
} }
double bwidth = right - left; double bwidth = right - left;
double bheight = bottom - top; double bheight = bottom - top;
@@ -182,13 +182,13 @@ void wxPolygonShape::CalculatePolygonCentre()
double newCentreX = (double)(left + (bwidth/2.0)); double newCentreX = (double)(left + (bwidth/2.0));
double newCentreY = (double)(top + (bheight/2.0)); double newCentreY = (double)(top + (bheight/2.0));
node = m_points->First(); node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
point->x -= newCentreX; point->x -= newCentreX;
point->y -= newCentreY; point->y -= newCentreY;
node = node->Next(); node = node->GetNext();
} }
m_xpos += newCentreX; m_xpos += newCentreX;
m_ypos += newCentreY; m_ypos += newCentreY;
@@ -260,17 +260,17 @@ bool wxPolygonShape::HitTest(double x, double y, int *attachment, double *distan
endPointsY[3] = y; endPointsY[3] = y;
// Store polygon points in an array // Store polygon points in an array
int np = m_points->Number(); int np = m_points->GetCount();
double *xpoints = new double[np]; double *xpoints = new double[np];
double *ypoints = new double[np]; double *ypoints = new double[np];
wxNode *node = m_points->First(); wxNode *node = m_points->GetFirst();
int i = 0; int i = 0;
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
xpoints[i] = point->x + m_xpos; xpoints[i] = point->x + m_xpos;
ypoints[i] = point->y + m_ypos; ypoints[i] = point->y + m_ypos;
node = node->Next(); node = node->GetNext();
i ++; 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 x_proportion = (double)(fabs(new_width/m_originalWidth));
double y_proportion = (double)(fabs(new_height/m_originalHeight)); double y_proportion = (double)(fabs(new_height/m_originalHeight));
wxNode *node = m_points->First(); wxNode *node = m_points->GetFirst();
wxNode *original_node = m_originalPoints->First(); wxNode *original_node = m_originalPoints->GetFirst();
while (node && original_node) while (node && original_node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxRealPoint *original_point = (wxRealPoint *)original_node->Data(); wxRealPoint *original_point = (wxRealPoint *)original_node->GetData();
point->x = (original_point->x * x_proportion); point->x = (original_point->x * x_proportion);
point->y = (original_point->y * y_proportion); point->y = (original_point->y * y_proportion);
node = node->Next(); node = node->GetNext();
original_node = original_node->Next(); original_node = original_node->GetNext();
} }
// CalculateBoundingBox(); // CalculateBoundingBox();
@@ -355,25 +355,25 @@ void wxPolygonShape::SetSize(double new_width, double new_height, bool recursive
void wxPolygonShape::UpdateOriginalPoints() void wxPolygonShape::UpdateOriginalPoints()
{ {
if (!m_originalPoints) m_originalPoints = new wxList; if (!m_originalPoints) m_originalPoints = new wxList;
wxNode *original_node = m_originalPoints->First(); wxNode *original_node = m_originalPoints->GetFirst();
while (original_node) while (original_node)
{ {
wxNode *next_node = original_node->Next(); wxNode *next_node = original_node->GetNext();
wxRealPoint *original_point = (wxRealPoint *)original_node->Data(); wxRealPoint *original_point = (wxRealPoint *)original_node->GetData();
delete original_point; delete original_point;
delete original_node; delete original_node;
original_node = next_node; original_node = next_node;
} }
wxNode *node = m_points->First(); wxNode *node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxRealPoint *original_point = new wxRealPoint(point->x, point->y); wxRealPoint *original_point = new wxRealPoint(point->x, point->y);
m_originalPoints->Append((wxObject*) original_point); m_originalPoints->Append((wxObject*) original_point);
node = node->Next(); node = node->GetNext();
} }
CalculateBoundingBox(); CalculateBoundingBox();
m_originalWidth = m_boundWidth; m_originalWidth = m_boundWidth;
@@ -382,19 +382,19 @@ void wxPolygonShape::UpdateOriginalPoints()
void wxPolygonShape::AddPolygonPoint(int pos) void wxPolygonShape::AddPolygonPoint(int pos)
{ {
wxNode *node = m_points->Nth(pos); wxNode *node = m_points->Item(pos);
if (!node) node = m_points->First(); if (!node) node = m_points->GetFirst();
wxRealPoint *firstPoint = (wxRealPoint *)node->Data(); wxRealPoint *firstPoint = (wxRealPoint *)node->GetData();
wxNode *node2 = m_points->Nth(pos + 1); wxNode *node2 = m_points->Item(pos + 1);
if (!node2) node2 = m_points->First(); if (!node2) node2 = m_points->GetFirst();
wxRealPoint *secondPoint = (wxRealPoint *)node2->Data(); wxRealPoint *secondPoint = (wxRealPoint *)node2->GetData();
double x = (double)((secondPoint->x - firstPoint->x)/2.0 + firstPoint->x); double x = (double)((secondPoint->x - firstPoint->x)/2.0 + firstPoint->x);
double y = (double)((secondPoint->y - firstPoint->y)/2.0 + firstPoint->y); double y = (double)((secondPoint->y - firstPoint->y)/2.0 + firstPoint->y);
wxRealPoint *point = new wxRealPoint(x, y); wxRealPoint *point = new wxRealPoint(x, y);
if (pos >= (m_points->Number() - 1)) if (pos >= (m_points->GetCount() - 1))
m_points->Append((wxObject*) point); m_points->Append((wxObject*) point);
else else
m_points->Insert(node2, (wxObject*) point); m_points->Insert(node2, (wxObject*) point);
@@ -410,10 +410,10 @@ void wxPolygonShape::AddPolygonPoint(int pos)
void wxPolygonShape::DeletePolygonPoint(int pos) void wxPolygonShape::DeletePolygonPoint(int pos)
{ {
wxNode *node = m_points->Nth(pos); wxNode *node = m_points->Item(pos);
if (node) if (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
delete point; delete point;
delete node; delete node;
UpdateOriginalPoints(); UpdateOriginalPoints();
@@ -430,7 +430,7 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1,
double x2, double y2, double x2, double y2,
double *x3, double *y3) double *x3, double *y3)
{ {
int n = m_points->Number(); int n = m_points->GetCount();
// First check for situation where the line is vertical, // First check for situation where the line is vertical,
// and we would want to connect to a point on that 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 // Look for the point we'd be connecting to. This is
// a heuristic... // a heuristic...
wxNode *node = m_points->First(); wxNode *node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
if (point->x == 0.0) if (point->x == 0.0)
{ {
if ((y2 > y1) && (point->y > 0.0)) if ((y2 > y1) && (point->y > 0.0))
@@ -459,21 +459,21 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1,
return TRUE; return TRUE;
} }
} }
node = node->Next(); node = node->GetNext();
} }
} }
double *xpoints = new double[n]; double *xpoints = new double[n];
double *ypoints = new double[n]; double *ypoints = new double[n];
wxNode *node = m_points->First(); wxNode *node = m_points->GetFirst();
int i = 0; int i = 0;
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
xpoints[i] = point->x + m_xpos; xpoints[i] = point->x + m_xpos;
ypoints[i] = point->y + m_ypos; ypoints[i] = point->y + m_ypos;
node = node->Next(); node = node->GetNext();
i ++; i ++;
} }
@@ -488,12 +488,12 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1,
void wxPolygonShape::OnDraw(wxDC& dc) void wxPolygonShape::OnDraw(wxDC& dc)
{ {
int n = m_points->Number(); int n = m_points->GetCount();
wxPoint *intPoints = new wxPoint[n]; wxPoint *intPoints = new wxPoint[n];
int i; int i;
for (i = 0; i < n; 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].x = WXROUND(point->x);
intPoints[i].y = WXROUND(point->y); 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 x_proportion = (double)(fabs(w/m_originalWidth));
double y_proportion = (double)(fabs(h/m_originalHeight)); double y_proportion = (double)(fabs(h/m_originalHeight));
int n = m_originalPoints->Number(); int n = m_originalPoints->GetCount();
wxPoint *intPoints = new wxPoint[n]; wxPoint *intPoints = new wxPoint[n];
int i; int i;
for (i = 0; i < n; 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].x = WXROUND(x_proportion * point->x);
intPoints[i].y = WXROUND(y_proportion * point->y); 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. // Make as many control points as there are vertices.
void wxPolygonShape::MakeControlPoints() void wxPolygonShape::MakeControlPoints()
{ {
wxNode *node = m_points->First(); wxNode *node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxPolygonControlPoint *control = new wxPolygonControlPoint(m_canvas, this, CONTROL_POINT_SIZE, wxPolygonControlPoint *control = new wxPolygonControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
point, point->x, point->y); point, point->x, point->y);
m_canvas->AddShape(control); m_canvas->AddShape(control);
m_controlPoints.Append(control); m_controlPoints.Append(control);
node = node->Next(); node = node->GetNext();
} }
} }
void wxPolygonShape::ResetControlPoints() void wxPolygonShape::ResetControlPoints()
{ {
wxNode *node = m_points->First(); wxNode *node = m_points->GetFirst();
wxNode *controlPointNode = m_controlPoints.First(); wxNode *controlPointNode = m_controlPoints.GetFirst();
while (node && controlPointNode) while (node && controlPointNode)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxPolygonControlPoint *controlPoint = (wxPolygonControlPoint *)controlPointNode->Data(); wxPolygonControlPoint *controlPoint = (wxPolygonControlPoint *)controlPointNode->GetData();
controlPoint->m_xoffset = point->x; controlPoint->m_xoffset = point->x;
controlPoint->m_yoffset = point->y; controlPoint->m_yoffset = point->y;
controlPoint->m_polygonVertex = point; controlPoint->m_polygonVertex = point;
node = node->Next(); node = node->GetNext();
controlPointNode = controlPointNode->Next(); controlPointNode = controlPointNode->GetNext();
} }
} }
@@ -585,10 +585,10 @@ void wxPolygonShape::WriteAttributes(wxExpr *clause)
// Make a list of lists for the coordinates // Make a list of lists for the coordinates
wxExpr *list = new wxExpr(wxExprList); wxExpr *list = new wxExpr(wxExprList);
wxNode *node = m_points->First(); wxNode *node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxExpr *point_list = new wxExpr(wxExprList); wxExpr *point_list = new wxExpr(wxExprList);
wxExpr *x_expr = new wxExpr((double)point->x); wxExpr *x_expr = new wxExpr((double)point->x);
wxExpr *y_expr = new wxExpr((double)point->y); wxExpr *y_expr = new wxExpr((double)point->y);
@@ -597,16 +597,16 @@ void wxPolygonShape::WriteAttributes(wxExpr *clause)
point_list->Append(y_expr); point_list->Append(y_expr);
list->Append(point_list); list->Append(point_list);
node = node->Next(); node = node->GetNext();
} }
clause->AddAttributeValue(wxT("points"), list); clause->AddAttributeValue(wxT("points"), list);
// Save the original (unscaled) points // Save the original (unscaled) points
list = new wxExpr(wxExprList); list = new wxExpr(wxExprList);
node = m_originalPoints->First(); node = m_originalPoints->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxExpr *point_list = new wxExpr(wxExprList); wxExpr *point_list = new wxExpr(wxExprList);
wxExpr *x_expr = new wxExpr((double) point->x); wxExpr *x_expr = new wxExpr((double) point->x);
wxExpr *y_expr = new wxExpr((double) point->y); wxExpr *y_expr = new wxExpr((double) point->y);
@@ -614,7 +614,7 @@ void wxPolygonShape::WriteAttributes(wxExpr *clause)
point_list->Append(y_expr); point_list->Append(y_expr);
list->Append(point_list); list->Append(point_list);
node = node->Next(); node = node->GetNext();
} }
clause->AddAttributeValue(wxT("m_originalPoints"), list); clause->AddAttributeValue(wxT("m_originalPoints"), list);
} }
@@ -743,21 +743,21 @@ void wxPolygonShape::Copy(wxShape& copy)
polyCopy.m_points = new wxList; polyCopy.m_points = new wxList;
polyCopy.m_originalPoints = new wxList; polyCopy.m_originalPoints = new wxList;
wxNode *node = m_points->First(); wxNode *node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxRealPoint *new_point = new wxRealPoint(point->x, point->y); wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
polyCopy.m_points->Append((wxObject*) new_point); polyCopy.m_points->Append((wxObject*) new_point);
node = node->Next(); node = node->GetNext();
} }
node = m_originalPoints->First(); node = m_originalPoints->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxRealPoint *new_point = new wxRealPoint(point->x, point->y); wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
polyCopy.m_originalPoints->Append((wxObject*) new_point); polyCopy.m_originalPoints->Append((wxObject*) new_point);
node = node->Next(); node = node->GetNext();
} }
polyCopy.m_boundWidth = m_boundWidth; polyCopy.m_boundWidth = m_boundWidth;
polyCopy.m_boundHeight = m_boundHeight; polyCopy.m_boundHeight = m_boundHeight;
@@ -767,14 +767,14 @@ void wxPolygonShape::Copy(wxShape& copy)
int wxPolygonShape::GetNumberOfAttachments() const int wxPolygonShape::GetNumberOfAttachments() const
{ {
int maxN = (m_points ? (m_points->Number() - 1) : 0); int maxN = (m_points ? (m_points->GetCount() - 1) : 0);
wxNode *node = m_attachmentPoints.First(); wxNode *node = m_attachmentPoints.GetFirst();
while (node) while (node)
{ {
wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
if (point->m_id > maxN) if (point->m_id > maxN)
maxN = point->m_id; maxN = point->m_id;
node = node->Next(); node = node->GetNext();
} }
return maxN+1;; return maxN+1;;
} }
@@ -782,9 +782,9 @@ int wxPolygonShape::GetNumberOfAttachments() const
bool wxPolygonShape::GetAttachmentPosition(int attachment, double *x, double *y, bool wxPolygonShape::GetAttachmentPosition(int attachment, double *x, double *y,
int nth, int no_arcs, wxLineShape *line) 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; *x = point->x + m_xpos;
*y = point->y + m_ypos; *y = point->y + m_ypos;
return TRUE; return TRUE;
@@ -798,16 +798,16 @@ bool wxPolygonShape::AttachmentIsValid(int attachment)
if (!m_points) if (!m_points)
return FALSE; return FALSE;
if ((attachment >= 0) && (attachment < m_points->Number())) if ((attachment >= 0) && (attachment < m_points->GetCount()))
return TRUE; return TRUE;
wxNode *node = m_attachmentPoints.First(); wxNode *node = m_attachmentPoints.GetFirst();
while (node) while (node)
{ {
wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
if (point->m_id == attachment) if (point->m_id == attachment)
return TRUE; return TRUE;
node = node->Next(); node = node->GetNext();
} }
return FALSE; return FALSE;
} }
@@ -820,36 +820,36 @@ void wxPolygonShape::Rotate(double x, double y, double theta)
// Rotate attachment points // Rotate attachment points
double sinTheta = (double)sin(actualTheta); double sinTheta = (double)sin(actualTheta);
double cosTheta = (double)cos(actualTheta); double cosTheta = (double)cos(actualTheta);
wxNode *node = m_attachmentPoints.First(); wxNode *node = m_attachmentPoints.GetFirst();
while (node) while (node)
{ {
wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
double x1 = point->m_x; double x1 = point->m_x;
double y1 = point->m_y; double y1 = point->m_y;
point->m_x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta; 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; 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) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
double x1 = point->x; double x1 = point->x;
double y1 = point->y; double y1 = point->y;
point->x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta; point->x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta;
point->y = x1*sinTheta + y1*cosTheta + y*(1.0 - cosTheta) + x*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) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
double x1 = point->x; double x1 = point->x;
double y1 = point->y; double y1 = point->y;
point->x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta; point->x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta;
point->y = x1*sinTheta + y1*cosTheta + y*(1.0 - cosTheta) + x*sinTheta; point->y = x1*sinTheta + y1*cosTheta + y*(1.0 - cosTheta) + x*sinTheta;
node = node->Next(); node = node->GetNext();
} }
m_rotation = theta; m_rotation = theta;
@@ -955,9 +955,9 @@ void wxRectangleShape::ReadAttributes(wxExpr *clause)
clause->AssignAttributeValue(wxT("corner"), &m_cornerRadius); clause->AssignAttributeValue(wxT("corner"), &m_cornerRadius);
// In case we're reading an old file, set the region's size // 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); region->SetSize(m_width, m_height);
} }
} }
@@ -1092,9 +1092,9 @@ void wxEllipseShape::ReadAttributes(wxExpr *clause)
clause->AssignAttributeValue(wxT("height"), &m_height); clause->AssignAttributeValue(wxT("height"), &m_height);
// In case we're reading an old file, set the region's size // 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); 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. // Recursively redraw links if we have a composite.
if (theObject->GetChildren().Number() > 0) if (theObject->GetChildren().GetCount() > 0)
theObject->DrawLinks(dc, -1, TRUE); theObject->DrawLinks(dc, -1, TRUE);
double width, height; double width, height;
@@ -1798,14 +1798,14 @@ wxShapeRegion::wxShapeRegion(wxShapeRegion& region)
m_penColour = region.m_penColour; m_penColour = region.m_penColour;
ClearText(); ClearText();
wxNode *node = region.m_formattedText.First(); wxNode *node = region.m_formattedText.GetFirst();
while (node) while (node)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)node->Data(); wxShapeTextLine *line = (wxShapeTextLine *)node->GetData();
wxShapeTextLine *new_line = wxShapeTextLine *new_line =
new wxShapeTextLine(line->GetX(), line->GetY(), line->GetText()); new wxShapeTextLine(line->GetX(), line->GetY(), line->GetText());
m_formattedText.Append(new_line); m_formattedText.Append(new_line);
node = node->Next(); node = node->GetNext();
} }
} }
@@ -1816,11 +1816,11 @@ wxShapeRegion::~wxShapeRegion()
void wxShapeRegion::ClearText() void wxShapeRegion::ClearText()
{ {
wxNode *node = m_formattedText.First(); wxNode *node = m_formattedText.GetFirst();
while (node) while (node)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)node->Data(); wxShapeTextLine *line = (wxShapeTextLine *)node->GetData();
wxNode *next = node->Next(); wxNode *next = node->GetNext();
delete line; delete line;
delete node; delete node;
node = next; node = next;

View File

@@ -397,10 +397,10 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn
// the other objects // the other objects
// (b) to find the control points FIRST if they exist // (b) to find the control points FIRST if they exist
wxNode *current = GetDiagram()->GetShapeList()->Last(); wxNode *current = GetDiagram()->GetShapeList()->GetLast();
while (current) while (current)
{ {
wxShape *object = (wxShape *)current->Data(); wxShape *object = (wxShape *)current->GetData();
double dist; double dist;
int temp_attachment; int temp_attachment;
@@ -430,13 +430,13 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn
} }
} }
if (current) if (current)
current = current->Previous(); current = current->GetPrevious();
} }
current = GetDiagram()->GetShapeList()->Last(); current = GetDiagram()->GetShapeList()->GetLast();
while (current) while (current)
{ {
wxShape *object = (wxShape *)current->Data(); wxShape *object = (wxShape *)current->GetData();
double dist; double dist;
int temp_attachment; int temp_attachment;
@@ -461,7 +461,7 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn
} }
} }
if (current) if (current)
current = current->Previous(); current = current->GetPrevious();
} }
*attachment = nearest_attachment; *attachment = nearest_attachment;

View File

@@ -74,18 +74,18 @@ wxCompositeShape::wxCompositeShape(): wxRectangleShape(10.0, 10.0)
wxCompositeShape::~wxCompositeShape() wxCompositeShape::~wxCompositeShape()
{ {
wxNode *node = m_constraints.First(); wxNode *node = m_constraints.GetFirst();
while (node) while (node)
{ {
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
delete constraint; delete constraint;
node = node->Next(); node = node->GetNext();
} }
node = m_children.First(); node = m_children.GetFirst();
while (node) while (node)
{ {
wxShape *object = (wxShape *)node->Data(); wxShape *object = (wxShape *)node->GetData();
wxNode *next = node->Next(); wxNode *next = node->GetNext();
object->Unlink(); object->Unlink();
delete object; delete object;
node = next; node = next;
@@ -113,13 +113,13 @@ void wxCompositeShape::OnDraw(wxDC& dc)
void wxCompositeShape::OnDrawContents(wxDC& dc) void wxCompositeShape::OnDrawContents(wxDC& dc)
{ {
wxNode *node = m_children.First(); wxNode *node = m_children.GetFirst();
while (node) while (node)
{ {
wxShape *object = (wxShape *)node->Data(); wxShape *object = (wxShape *)node->GetData();
object->Draw(dc); object->Draw(dc);
object->DrawLinks(dc); object->DrawLinks(dc);
node = node->Next(); node = node->GetNext();
} }
wxShape::OnDrawContents(dc); wxShape::OnDrawContents(dc);
} }
@@ -128,15 +128,15 @@ bool wxCompositeShape::OnMovePre(wxDC& dc, double x, double y, double oldx, doub
{ {
double diffX = x - oldx; double diffX = x - oldx;
double diffY = y - oldy; double diffY = y - oldy;
wxNode *node = m_children.First(); wxNode *node = m_children.GetFirst();
while (node) while (node)
{ {
wxShape *object = (wxShape *)node->Data(); wxShape *object = (wxShape *)node->GetData();
object->Erase(dc); object->Erase(dc);
object->Move(dc, object->GetX() + diffX, object->GetY() + diffY, display); object->Move(dc, object->GetX() + diffX, object->GetY() + diffY, display);
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
} }
@@ -144,12 +144,12 @@ bool wxCompositeShape::OnMovePre(wxDC& dc, double x, double y, double oldx, doub
void wxCompositeShape::OnErase(wxDC& dc) void wxCompositeShape::OnErase(wxDC& dc)
{ {
wxRectangleShape::OnErase(dc); wxRectangleShape::OnErase(dc);
wxNode *node = m_children.First(); wxNode *node = m_children.GetFirst();
while (node) while (node)
{ {
wxShape *object = (wxShape *)node->Data(); wxShape *object = (wxShape *)node->GetData();
object->Erase(dc); 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. // the division, so we can invoke a user interface for dealing with regions.
if (keys & KEY_CTRL) if (keys & KEY_CTRL)
{ {
wxNode *node = m_divisions.First(); wxNode *node = m_divisions.GetFirst();
while (node) while (node)
{ {
wxDivisionShape *division = (wxDivisionShape *)node->Data(); wxDivisionShape *division = (wxDivisionShape *)node->GetData();
wxNode *next = node->Next(); wxNode *next = node->GetNext();
int attach = 0; int attach = 0;
double dist = 0.0; double dist = 0.0;
if (division->HitTest(x, y, &attach, &dist)) if (division->HitTest(x, y, &attach, &dist))
@@ -267,7 +267,7 @@ void wxCompositeShape::SetSize(double w, double h, bool recursive)
if (!recursive) return; if (!recursive) return;
wxNode *node = m_children.First(); wxNode *node = m_children.GetFirst();
wxClientDC dc(GetCanvas()); wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
@@ -275,7 +275,7 @@ void wxCompositeShape::SetSize(double w, double h, bool recursive)
double xBound, yBound; double xBound, yBound;
while (node) while (node)
{ {
wxShape *object = (wxShape *)node->Data(); wxShape *object = (wxShape *)node->GetData();
// Scale the position first // Scale the position first
double newX = (double)(((object->GetX() - GetX())*xScale) + GetX()); 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->SetSize(object->GetFixedWidth() ? xBound : xScale*xBound,
object->GetFixedHeight() ? yBound : yScale*yBound); object->GetFixedHeight() ? yBound : yScale*yBound);
node = node->Next(); node = node->GetNext();
} }
SetDefaultRegionSize(); SetDefaultRegionSize();
} }
@@ -317,11 +317,11 @@ void wxCompositeShape::RemoveChild(wxShape *child)
void wxCompositeShape::DeleteConstraintsInvolvingChild(wxShape *child) void wxCompositeShape::DeleteConstraintsInvolvingChild(wxShape *child)
{ {
wxNode *node = m_constraints.First(); wxNode *node = m_constraints.GetFirst();
while (node) while (node)
{ {
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
wxNode *nextNode = node->Next(); wxNode *nextNode = node->GetNext();
if ((constraint->m_constrainingObject == child) || if ((constraint->m_constrainingObject == child) ||
constraint->m_constrainedObjects.Member(child)) constraint->m_constrainedObjects.Member(child))
@@ -335,11 +335,11 @@ void wxCompositeShape::DeleteConstraintsInvolvingChild(wxShape *child)
void wxCompositeShape::RemoveChildFromConstraints(wxShape *child) void wxCompositeShape::RemoveChildFromConstraints(wxShape *child)
{ {
wxNode *node = m_constraints.First(); wxNode *node = m_constraints.GetFirst();
while (node) while (node)
{ {
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
wxNode *nextNode = node->Next(); wxNode *nextNode = node->GetNext();
if (constraint->m_constrainedObjects.Member(child)) if (constraint->m_constrainedObjects.Member(child))
constraint->m_constrainedObjects.DeleteObject(child); constraint->m_constrainedObjects.DeleteObject(child);
@@ -369,10 +369,10 @@ void wxCompositeShape::Copy(wxShape& copy)
oglObjectCopyMapping.Append((long)this, &compositeCopy); oglObjectCopyMapping.Append((long)this, &compositeCopy);
// Copy the children // Copy the children
wxNode *node = m_children.First(); wxNode *node = m_children.GetFirst();
while (node) while (node)
{ {
wxShape *object = (wxShape *)node->Data(); wxShape *object = (wxShape *)node->GetData();
wxShape *newObject = object->CreateNewCopy(FALSE, FALSE); wxShape *newObject = object->CreateNewCopy(FALSE, FALSE);
if (newObject->GetId() == 0) if (newObject->GetId() == 0)
newObject->SetId(wxNewId()); newObject->SetId(wxNewId());
@@ -386,25 +386,25 @@ void wxCompositeShape::Copy(wxShape& copy)
oglObjectCopyMapping.Append((long)object, newObject); oglObjectCopyMapping.Append((long)object, newObject);
node = node->Next(); node = node->GetNext();
} }
// Copy the constraints // Copy the constraints
node = m_constraints.First(); node = m_constraints.GetFirst();
while (node) 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; wxList newConstrainedList;
wxNode *node2 = constraint->m_constrainedObjects.First(); wxNode *node2 = constraint->m_constrainedObjects.GetFirst();
while (node2) while (node2)
{ {
wxShape *constrainedObject = (wxShape *)node2->Data(); wxShape *constrainedObject = (wxShape *)node2->GetData();
wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->Data()); wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->GetData());
newConstrainedList.Append(newConstrained); newConstrainedList.Append(newConstrained);
node2 = node2->Next(); node2 = node2->GetNext();
} }
wxOGLConstraint *newConstraint = new wxOGLConstraint(constraint->m_constraintType, newConstraining, 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); newConstraint->SetSpacing(constraint->m_xSpacing, constraint->m_ySpacing);
compositeCopy.m_constraints.Append(newConstraint); compositeCopy.m_constraints.Append(newConstraint);
node = node->Next(); node = node->GetNext();
} }
// Now compositeCopy the division geometry // Now compositeCopy the division geometry
node = m_divisions.First(); node = m_divisions.GetFirst();
while (node) while (node)
{ {
wxDivisionShape *division = (wxDivisionShape *)node->Data(); wxDivisionShape *division = (wxDivisionShape *)node->GetData();
wxNode *node1 = oglObjectCopyMapping.Find((long)division); wxNode *node1 = oglObjectCopyMapping.Find((long)division);
wxNode *leftNode = NULL; wxNode *leftNode = NULL;
wxNode *topNode = NULL; wxNode *topNode = NULL;
@@ -440,17 +440,17 @@ void wxCompositeShape::Copy(wxShape& copy)
bottomNode = oglObjectCopyMapping.Find((long)division->GetBottomSide()); bottomNode = oglObjectCopyMapping.Find((long)division->GetBottomSide());
if (node1) if (node1)
{ {
wxDivisionShape *newDivision = (wxDivisionShape *)node1->Data(); wxDivisionShape *newDivision = (wxDivisionShape *)node1->GetData();
if (leftNode) if (leftNode)
newDivision->SetLeftSide((wxDivisionShape *)leftNode->Data()); newDivision->SetLeftSide((wxDivisionShape *)leftNode->GetData());
if (topNode) if (topNode)
newDivision->SetTopSide((wxDivisionShape *)topNode->Data()); newDivision->SetTopSide((wxDivisionShape *)topNode->GetData());
if (rightNode) if (rightNode)
newDivision->SetRightSide((wxDivisionShape *)rightNode->Data()); newDivision->SetRightSide((wxDivisionShape *)rightNode->GetData());
if (bottomNode) 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) wxOGLConstraint *wxCompositeShape::FindConstraint(long cId, wxCompositeShape **actualComposite)
{ {
wxNode *node = m_constraints.First(); wxNode *node = m_constraints.GetFirst();
while (node) while (node)
{ {
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
if (constraint->m_constraintId == cId) if (constraint->m_constraintId == cId)
{ {
if (actualComposite) if (actualComposite)
*actualComposite = this; *actualComposite = this;
return constraint; return constraint;
} }
node = node->Next(); node = node->GetNext();
} }
// If not found, try children. // If not found, try children.
node = m_children.First(); node = m_children.GetFirst();
while (node) while (node)
{ {
wxShape *child = (wxShape *)node->Data(); wxShape *child = (wxShape *)node->GetData();
if (child->IsKindOf(CLASSINFO(wxCompositeShape))) if (child->IsKindOf(CLASSINFO(wxCompositeShape)))
{ {
wxOGLConstraint *constraint = ((wxCompositeShape *)child)->FindConstraint(cId, actualComposite); wxOGLConstraint *constraint = ((wxCompositeShape *)child)->FindConstraint(cId, actualComposite);
@@ -511,7 +511,7 @@ wxOGLConstraint *wxCompositeShape::FindConstraint(long cId, wxCompositeShape **a
return constraint; return constraint;
} }
} }
node = node->Next(); node = node->GetNext();
} }
return NULL; return NULL;
} }
@@ -530,10 +530,10 @@ void wxCompositeShape::CalculateSize()
double minY = (double) 999999.9; double minY = (double) 999999.9;
double w, h; double w, h;
wxNode *node = m_children.First(); wxNode *node = m_children.GetFirst();
while (node) while (node)
{ {
wxShape *object = (wxShape *)node->Data(); wxShape *object = (wxShape *)node->GetData();
// Recalculate size of composite objects because may not conform // Recalculate size of composite objects because may not conform
// to size it was set to - depends on the children. // to size it was set to - depends on the children.
@@ -549,7 +549,7 @@ void wxCompositeShape::CalculateSize()
if ((object->GetY() - (h/2.0)) < minY) if ((object->GetY() - (h/2.0)) < minY)
minY = (double)(object->GetY() - (h/2.0)); minY = (double)(object->GetY() - (h/2.0));
node = node->Next(); node = node->GetNext();
} }
m_width = maxX - minX; m_width = maxX - minX;
m_height = maxY - minY; m_height = maxY - minY;
@@ -580,21 +580,21 @@ bool wxCompositeShape::Constrain()
CalculateSize(); CalculateSize();
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_children.First(); wxNode *node = m_children.GetFirst();
while (node) while (node)
{ {
wxShape *object = (wxShape *)node->Data(); wxShape *object = (wxShape *)node->GetData();
if (object->Constrain()) if (object->Constrain())
changed = TRUE; changed = TRUE;
node = node->Next(); node = node->GetNext();
} }
node = m_constraints.First(); node = m_constraints.GetFirst();
while (node) while (node)
{ {
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
if (constraint->Evaluate()) changed = TRUE; if (constraint->Evaluate()) changed = TRUE;
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }
@@ -609,10 +609,10 @@ void wxCompositeShape::WriteAttributes(wxExpr *clause)
// Output constraints as constraint1 = (...), constraint2 = (...), etc. // Output constraints as constraint1 = (...), constraint2 = (...), etc.
int constraintNo = 1; int constraintNo = 1;
char m_constraintNameBuf[20]; char m_constraintNameBuf[20];
wxNode *node = m_constraints.First(); wxNode *node = m_constraints.GetFirst();
while (node) while (node)
{ {
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data(); wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
sprintf(m_constraintNameBuf, "constraint%d", constraintNo); sprintf(m_constraintNameBuf, "constraint%d", constraintNo);
// Each constraint is stored in the form // Each constraint is stored in the form
@@ -626,42 +626,42 @@ void wxCompositeShape::WriteAttributes(wxExpr *clause)
constraintExpr->Append(new wxExpr(constraint->m_constrainingObject->GetId())); constraintExpr->Append(new wxExpr(constraint->m_constrainingObject->GetId()));
wxExpr *objectList = new wxExpr(wxExprList); wxExpr *objectList = new wxExpr(wxExprList);
wxNode *node1 = constraint->m_constrainedObjects.First(); wxNode *node1 = constraint->m_constrainedObjects.GetFirst();
while (node1) while (node1)
{ {
wxShape *obj = (wxShape *)node1->Data(); wxShape *obj = (wxShape *)node1->GetData();
objectList->Append(new wxExpr(obj->GetId())); objectList->Append(new wxExpr(obj->GetId()));
node1 = node1->Next(); node1 = node1->GetNext();
} }
constraintExpr->Append(objectList); constraintExpr->Append(objectList);
clause->AddAttributeValue(m_constraintNameBuf, constraintExpr); clause->AddAttributeValue(m_constraintNameBuf, constraintExpr);
node = node->Next(); node = node->GetNext();
constraintNo ++; constraintNo ++;
} }
// Write the ids of all the child images // Write the ids of all the child images
wxExpr *childrenExpr = new wxExpr(wxExprList); wxExpr *childrenExpr = new wxExpr(wxExprList);
node = m_children.First(); node = m_children.GetFirst();
while (node) while (node)
{ {
wxShape *child = (wxShape *)node->Data(); wxShape *child = (wxShape *)node->GetData();
childrenExpr->Append(new wxExpr(child->GetId())); childrenExpr->Append(new wxExpr(child->GetId()));
node = node->Next(); node = node->GetNext();
} }
clause->AddAttributeValue("children", childrenExpr); clause->AddAttributeValue("children", childrenExpr);
// Write the ids of all the division images // Write the ids of all the division images
if (m_divisions.Number() > 0) if (m_divisions.GetCount() > 0)
{ {
wxExpr *divisionsExpr = new wxExpr(wxExprList); wxExpr *divisionsExpr = new wxExpr(wxExprList);
node = m_divisions.First(); node = m_divisions.GetFirst();
while (node) while (node)
{ {
wxShape *child = (wxShape *)node->Data(); wxShape *child = (wxShape *)node->GetData();
divisionsExpr->Append(new wxExpr(child->GetId())); divisionsExpr->Append(new wxExpr(child->GetId()));
node = node->Next(); node = node->GetNext();
} }
clause->AddAttributeValue("divisions", divisionsExpr); clause->AddAttributeValue("divisions", divisionsExpr);
} }
@@ -706,13 +706,13 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database)
// Each constraint is stored in the form // Each constraint is stored in the form
// (type name id xspacing yspacing m_constrainingObjectId constrainedObjectIdList) // (type name id xspacing yspacing m_constrainingObjectId constrainedObjectIdList)
wxExpr *typeExpr = constraintExpr->Nth(0); wxExpr *typeExpr = constraintExpr->Item(0);
wxExpr *nameExpr = constraintExpr->Nth(1); wxExpr *nameExpr = constraintExpr->Item(1);
wxExpr *idExpr = constraintExpr->Nth(2); wxExpr *idExpr = constraintExpr->Item(2);
wxExpr *xExpr = constraintExpr->Nth(3); wxExpr *xExpr = constraintExpr->Item(3);
wxExpr *yExpr = constraintExpr->Nth(4); wxExpr *yExpr = constraintExpr->Item(4);
wxExpr *constrainingExpr = constraintExpr->Nth(5); wxExpr *constrainingExpr = constraintExpr->Item(5);
wxExpr *constrainedExpr = constraintExpr->Nth(6); wxExpr *constrainedExpr = constraintExpr->Item(6);
cType = (int)typeExpr->IntegerValue(); cType = (int)typeExpr->IntegerValue();
cXSpacing = xExpr->RealValue(); 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.")); wxLogFatalError(wxT("Object graphics error: Couldn't find constraining image of composite."));
int i = 0; int i = 0;
wxExpr *currentIdExpr = constrainedExpr->Nth(i); wxExpr *currentIdExpr = constrainedExpr->Item(i);
while (currentIdExpr) while (currentIdExpr)
{ {
long currentId = currentIdExpr->IntegerValue(); long currentId = currentIdExpr->IntegerValue();
@@ -742,7 +742,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database)
} }
i ++; i ++;
currentIdExpr = constrainedExpr->Nth(i); currentIdExpr = constrainedExpr->Item(i);
} }
wxOGLConstraint *newConstraint = AddConstraint(cType, m_constrainingObject, m_constrainedObjects); wxOGLConstraint *newConstraint = AddConstraint(cType, m_constrainingObject, m_constrainedObjects);
newConstraint->SetSpacing(cXSpacing, cYSpacing); newConstraint->SetSpacing(cXSpacing, cYSpacing);
@@ -777,13 +777,13 @@ wxDivisionShape *wxCompositeShape::OnCreateDivision()
wxShape *wxCompositeShape::FindContainerImage() wxShape *wxCompositeShape::FindContainerImage()
{ {
wxNode *node = m_children.First(); wxNode *node = m_children.GetFirst();
while (node) while (node)
{ {
wxShape *child = (wxShape *)node->Data(); wxShape *child = (wxShape *)node->GetData();
if (!m_divisions.Member(child)) if (!m_divisions.Member(child))
return child; return child;
node = node->Next(); node = node->GetNext();
} }
return NULL; return NULL;
} }
@@ -793,17 +793,17 @@ bool wxCompositeShape::ContainsDivision(wxDivisionShape *division)
{ {
if (m_divisions.Member(division)) if (m_divisions.Member(division))
return TRUE; return TRUE;
wxNode *node = m_children.First(); wxNode *node = m_children.GetFirst();
while (node) while (node)
{ {
wxShape *child = (wxShape *)node->Data(); wxShape *child = (wxShape *)node->GetData();
if (child->IsKindOf(CLASSINFO(wxCompositeShape))) if (child->IsKindOf(CLASSINFO(wxCompositeShape)))
{ {
bool ans = ((wxCompositeShape *)child)->ContainsDivision(division); bool ans = ((wxCompositeShape *)child)->ContainsDivision(division);
if (ans) if (ans)
return TRUE; return TRUE;
} }
node = node->Next(); node = node->GetNext();
} }
return FALSE; return FALSE;
} }
@@ -879,13 +879,13 @@ bool wxDivisionShape::OnMovePre(wxDC& dc, double x, double y, double oldx, doubl
{ {
double diffX = x - oldx; double diffX = x - oldx;
double diffY = y - oldy; double diffY = y - oldy;
wxNode *node = m_children.First(); wxNode *node = m_children.GetFirst();
while (node) while (node)
{ {
wxShape *object = (wxShape *)node->Data(); wxShape *object = (wxShape *)node->GetData();
object->Erase(dc); object->Erase(dc);
object->Move(dc, object->GetX() + diffX, object->GetY() + diffY, display); object->Move(dc, object->GetX() + diffX, object->GetY() + diffY, display);
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
} }
@@ -1084,13 +1084,13 @@ bool wxDivisionShape::Divide(int direction)
// Anything adjoining the bottom of this division now adjoins the // Anything adjoining the bottom of this division now adjoins the
// bottom of the new division. // bottom of the new division.
wxNode *node = compositeParent->GetDivisions().First(); wxNode *node = compositeParent->GetDivisions().GetFirst();
while (node) while (node)
{ {
wxDivisionShape *obj = (wxDivisionShape *)node->Data(); wxDivisionShape *obj = (wxDivisionShape *)node->GetData();
if (obj->GetTopSide() == this) if (obj->GetTopSide() == this)
obj->SetTopSide(newDivision); obj->SetTopSide(newDivision);
node = node->Next(); node = node->GetNext();
} }
newDivision->SetTopSide(this); newDivision->SetTopSide(this);
newDivision->SetBottomSide(m_bottomSide); newDivision->SetBottomSide(m_bottomSide);
@@ -1135,13 +1135,13 @@ bool wxDivisionShape::Divide(int direction)
// Anything adjoining the left of this division now adjoins the // Anything adjoining the left of this division now adjoins the
// left of the new division. // left of the new division.
wxNode *node = compositeParent->GetDivisions().First(); wxNode *node = compositeParent->GetDivisions().GetFirst();
while (node) while (node)
{ {
wxDivisionShape *obj = (wxDivisionShape *)node->Data(); wxDivisionShape *obj = (wxDivisionShape *)node->GetData();
if (obj->GetLeftSide() == this) if (obj->GetLeftSide() == this)
obj->SetLeftSide(newDivision); obj->SetLeftSide(newDivision);
node = node->Next(); node = node->GetNext();
} }
newDivision->SetTopSide(m_topSide); newDivision->SetTopSide(m_topSide);
newDivision->SetBottomSide(m_bottomSide); newDivision->SetBottomSide(m_bottomSide);
@@ -1253,17 +1253,17 @@ void wxDivisionShape::ResetControlPoints()
void wxDivisionShape::ResetMandatoryControlPoints() void wxDivisionShape::ResetMandatoryControlPoints()
{ {
if (m_controlPoints.Number() < 1) if (m_controlPoints.GetCount() < 1)
return; return;
double maxX, maxY; double maxX, maxY;
GetBoundingBoxMax(&maxX, &maxY); GetBoundingBoxMax(&maxX, &maxY);
/* /*
wxNode *node = m_controlPoints.First(); wxNode *node = m_controlPoints.GetFirst();
while (node) while (node)
{ {
wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->Data(); wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->GetData();
if (control->type == CONTROL_POINT_HORIZONTAL) if (control->type == CONTROL_POINT_HORIZONTAL)
{ {
control->xoffset = (double)(-maxX/2.0); control->m_yoffset = 0.0; 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); 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) 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; control->m_xoffset = (double)(-maxX/2.0); control->m_yoffset = 0.0;
} }
if ((m_handleSide == DIVISION_SIDE_TOP) && node) 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); control->m_xoffset = 0.0; control->m_yoffset = (double)(-maxY/2.0);
} }
if ((m_handleSide == DIVISION_SIDE_RIGHT) && node) 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; control->m_xoffset = (double)(maxX/2.0); control->m_yoffset = 0.0;
} }
if ((m_handleSide == DIVISION_SIDE_BOTTOM) && node) 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); 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) bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test)
{ {
wxCompositeShape *divisionParent = (wxCompositeShape *)GetParent(); wxCompositeShape *divisionParent = (wxCompositeShape *)GetParent();
wxNode *node = divisionParent->GetDivisions().First(); wxNode *node = divisionParent->GetDivisions().GetFirst();
while (node) while (node)
{ {
wxDivisionShape *division = (wxDivisionShape *)node->Data(); wxDivisionShape *division = (wxDivisionShape *)node->GetData();
switch (side) switch (side)
{ {
case DIVISION_SIDE_LEFT: case DIVISION_SIDE_LEFT:
@@ -1561,7 +1561,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test)
default: default:
break; break;
} }
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;

View File

@@ -110,12 +110,12 @@ void OGLCleanUpConstraintTypes()
if (!wxOGLConstraintTypes) if (!wxOGLConstraintTypes)
return; return;
wxNode* node = wxOGLConstraintTypes->First(); wxNode* node = wxOGLConstraintTypes->GetFirst();
while (node) while (node)
{ {
wxOGLConstraintType* ct = (wxOGLConstraintType*) node->Data(); wxOGLConstraintType* ct = (wxOGLConstraintType*) node->GetData();
delete ct; delete ct;
node = node->Next(); node = node->GetNext();
} }
delete wxOGLConstraintTypes; delete wxOGLConstraintTypes;
wxOGLConstraintTypes = NULL; wxOGLConstraintTypes = NULL;
@@ -139,11 +139,11 @@ wxOGLConstraint::wxOGLConstraint(int type, wxShape *constraining, wxList& constr
m_constraintId = 0; m_constraintId = 0;
m_constraintName = wxT("noname"); m_constraintName = wxT("noname");
wxNode *node = constrained.First(); wxNode *node = constrained.GetFirst();
while (node) while (node)
{ {
m_constrainedObjects.Append(node->Data()); m_constrainedObjects.Append(node->GetData());
node = node->Next(); node = node->GetNext();
} }
} }
@@ -175,17 +175,17 @@ bool wxOGLConstraint::Evaluate()
{ {
case gyCONSTRAINT_CENTRED_VERTICALLY: case gyCONSTRAINT_CENTRED_VERTICALLY:
{ {
int n = m_constrainedObjects.Number(); int n = m_constrainedObjects.GetCount();
double totalObjectHeight = 0.0; double totalObjectHeight = 0.0;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
totalObjectHeight += height2; totalObjectHeight += height2;
node = node->Next(); node = node->GetNext();
} }
double startY; double startY;
double spacingY; double spacingY;
@@ -204,10 +204,10 @@ bool wxOGLConstraint::Evaluate()
// Now position the objects // Now position the objects
bool changed = FALSE; bool changed = FALSE;
node = m_constrainedObjects.First(); node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
startY += (double)(spacingY + (height2/2.0)); startY += (double)(spacingY + (height2/2.0));
@@ -217,23 +217,23 @@ bool wxOGLConstraint::Evaluate()
changed = TRUE; changed = TRUE;
} }
startY += (double)(height2/2.0); startY += (double)(height2/2.0);
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }
case gyCONSTRAINT_CENTRED_HORIZONTALLY: case gyCONSTRAINT_CENTRED_HORIZONTALLY:
{ {
int n = m_constrainedObjects.Number(); int n = m_constrainedObjects.GetCount();
double totalObjectWidth = 0.0; double totalObjectWidth = 0.0;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
totalObjectWidth += width2; totalObjectWidth += width2;
node = node->Next(); node = node->GetNext();
} }
double startX; double startX;
double spacingX; double spacingX;
@@ -252,10 +252,10 @@ bool wxOGLConstraint::Evaluate()
// Now position the objects // Now position the objects
bool changed = FALSE; bool changed = FALSE;
node = m_constrainedObjects.First(); node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
startX += (double)(spacingX + (width2/2.0)); startX += (double)(spacingX + (width2/2.0));
@@ -265,25 +265,25 @@ bool wxOGLConstraint::Evaluate()
changed = TRUE; changed = TRUE;
} }
startX += (double)(width2/2.0); startX += (double)(width2/2.0);
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }
case gyCONSTRAINT_CENTRED_BOTH: case gyCONSTRAINT_CENTRED_BOTH:
{ {
int n = m_constrainedObjects.Number(); int n = m_constrainedObjects.GetCount();
double totalObjectWidth = 0.0; double totalObjectWidth = 0.0;
double totalObjectHeight = 0.0; double totalObjectHeight = 0.0;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
totalObjectWidth += width2; totalObjectWidth += width2;
totalObjectHeight += height2; totalObjectHeight += height2;
node = node->Next(); node = node->GetNext();
} }
double startX; double startX;
double spacingX; double spacingX;
@@ -318,10 +318,10 @@ bool wxOGLConstraint::Evaluate()
// Now position the objects // Now position the objects
bool changed = FALSE; bool changed = FALSE;
node = m_constrainedObjects.First(); node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
startX += (double)(spacingX + (width2/2.0)); startX += (double)(spacingX + (width2/2.0));
@@ -336,7 +336,7 @@ bool wxOGLConstraint::Evaluate()
startX += (double)(width2/2.0); startX += (double)(width2/2.0);
startY += (double)(height2/2.0); startY += (double)(height2/2.0);
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }
@@ -344,10 +344,10 @@ bool wxOGLConstraint::Evaluate()
{ {
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
@@ -359,7 +359,7 @@ bool wxOGLConstraint::Evaluate()
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
} }
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }
@@ -367,10 +367,10 @@ bool wxOGLConstraint::Evaluate()
{ {
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
@@ -382,7 +382,7 @@ bool wxOGLConstraint::Evaluate()
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
} }
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
@@ -392,10 +392,10 @@ bool wxOGLConstraint::Evaluate()
{ {
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
@@ -407,7 +407,7 @@ bool wxOGLConstraint::Evaluate()
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
} }
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }
@@ -415,10 +415,10 @@ bool wxOGLConstraint::Evaluate()
{ {
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
@@ -430,7 +430,7 @@ bool wxOGLConstraint::Evaluate()
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
} }
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }
@@ -438,10 +438,10 @@ bool wxOGLConstraint::Evaluate()
{ {
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
@@ -453,7 +453,7 @@ bool wxOGLConstraint::Evaluate()
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
} }
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }
@@ -461,10 +461,10 @@ bool wxOGLConstraint::Evaluate()
{ {
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
@@ -476,7 +476,7 @@ bool wxOGLConstraint::Evaluate()
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
} }
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
@@ -486,10 +486,10 @@ bool wxOGLConstraint::Evaluate()
{ {
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
@@ -501,7 +501,7 @@ bool wxOGLConstraint::Evaluate()
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
} }
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }
@@ -509,10 +509,10 @@ bool wxOGLConstraint::Evaluate()
{ {
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2; double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2); constrainedObject->GetBoundingBoxMax(&width2, &height2);
@@ -524,7 +524,7 @@ bool wxOGLConstraint::Evaluate()
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
} }
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }
@@ -532,10 +532,10 @@ bool wxOGLConstraint::Evaluate()
{ {
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double x3 = (double)(x - (minWidth/2.0)); double x3 = (double)(x - (minWidth/2.0));
if (!Equals(x3, constrainedObject->GetX())) if (!Equals(x3, constrainedObject->GetX()))
@@ -544,7 +544,7 @@ bool wxOGLConstraint::Evaluate()
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
} }
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }
@@ -552,10 +552,10 @@ bool wxOGLConstraint::Evaluate()
{ {
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double x3 = (double)(x + (minWidth/2.0)); double x3 = (double)(x + (minWidth/2.0));
if (!Equals(x3, constrainedObject->GetX())) if (!Equals(x3, constrainedObject->GetX()))
@@ -564,7 +564,7 @@ bool wxOGLConstraint::Evaluate()
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
} }
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
@@ -574,10 +574,10 @@ bool wxOGLConstraint::Evaluate()
{ {
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double y3 = (double)(y - (minHeight/2.0)); double y3 = (double)(y - (minHeight/2.0));
if (!Equals(y3, constrainedObject->GetY())) if (!Equals(y3, constrainedObject->GetY()))
@@ -586,7 +586,7 @@ bool wxOGLConstraint::Evaluate()
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
} }
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }
@@ -594,10 +594,10 @@ bool wxOGLConstraint::Evaluate()
{ {
bool changed = FALSE; bool changed = FALSE;
wxNode *node = m_constrainedObjects.First(); wxNode *node = m_constrainedObjects.GetFirst();
while (node) while (node)
{ {
wxShape *constrainedObject = (wxShape *)node->Data(); wxShape *constrainedObject = (wxShape *)node->GetData();
double y3 = (double)(y + (minHeight/2.0)); double y3 = (double)(y + (minHeight/2.0));
if (!Equals(y3, constrainedObject->GetY())) if (!Equals(y3, constrainedObject->GetY()))
@@ -606,7 +606,7 @@ bool wxOGLConstraint::Evaluate()
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
} }
node = node->Next(); node = node->GetNext();
} }
return changed; return changed;
} }

View File

@@ -74,7 +74,7 @@ void wxDividedShape::OnDraw(wxDC& dc)
void wxDividedShape::OnDrawContents(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 currentY = (double)(m_ypos - (m_height / 2.0));
double maxY = (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; double yMargin = 2;
dc.SetBackgroundMode(wxTRANSPARENT); dc.SetBackgroundMode(wxTRANSPARENT);
wxNode *node = GetRegions().First(); wxNode *node = GetRegions().GetFirst();
while (node) while (node)
{ {
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
dc.SetFont(* region->GetFont()); dc.SetFont(* region->GetFont());
dc.SetTextForeground(* region->GetActualColourObject()); dc.SetTextForeground(* region->GetActualColourObject());
@@ -123,7 +123,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc)
oglDrawFormattedText(dc, &region->m_formattedText, oglDrawFormattedText(dc, &region->m_formattedText,
(double)(centreX), (double)(centreY), (double)(m_width-2*xMargin), (double)(actualY - currentY - 2*yMargin), (double)(centreX), (double)(centreY), (double)(m_width-2*xMargin), (double)(actualY - currentY - 2*yMargin),
region->m_formatMode); region->m_formatMode);
if ((y <= maxY) && (node->Next())) if ((y <= maxY) && (node->GetNext()))
{ {
wxPen *regionPen = region->GetActualPen(); wxPen *regionPen = region->GetActualPen();
if (regionPen) if (regionPen)
@@ -135,7 +135,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc)
currentY = actualY; currentY = actualY;
node = node->Next(); node = node->GetNext();
} }
} }
@@ -149,20 +149,20 @@ void wxDividedShape::SetSize(double w, double h, bool recursive)
void wxDividedShape::SetRegionSizes() void wxDividedShape::SetRegionSizes()
{ {
if (GetRegions().Number() == 0) if (GetRegions().GetCount() == 0)
return; 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 currentY = (double)(m_ypos - (m_height / 2.0));
double maxY = (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 leftX = (double)(m_xpos - (m_width / 2.0));
// double rightX = (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) while (node)
{ {
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
double proportion = double proportion =
region->m_regionProportionY <= 0.0 ? defaultProportion : region->m_regionProportionY; region->m_regionProportionY <= 0.0 ? defaultProportion : region->m_regionProportionY;
@@ -175,7 +175,7 @@ void wxDividedShape::SetRegionSizes()
region->SetSize(m_width, sizeY); region->SetSize(m_width, sizeY);
region->SetPosition(0.0, (double)(centreY - m_ypos)); region->SetPosition(0.0, (double)(centreY - m_ypos));
currentY = actualY; 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, bool wxDividedShape::GetAttachmentPosition(int attachment, double *x, double *y, int nth, int no_arcs,
wxLineShape *line) wxLineShape *line)
{ {
int totalNumberAttachments = (GetRegions().Number() * 2) + 2; int totalNumberAttachments = (GetRegions().GetCount() * 2) + 2;
if ((GetAttachmentMode() == ATTACHMENT_MODE_NONE) || (attachment >= totalNumberAttachments)) if ((GetAttachmentMode() == ATTACHMENT_MODE_NONE) || (attachment >= totalNumberAttachments))
{ {
return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs); return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs);
} }
int n = GetRegions().Number(); int n = GetRegions().GetCount();
bool isEnd = (line && line->IsEnd(this)); bool isEnd = (line && line->IsEnd(this));
double left = (double)(m_xpos - m_width/2.0); 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); i = (totalNumberAttachments - attachment - 1);
isLeft = TRUE; isLeft = TRUE;
} }
wxNode *node = GetRegions().Nth(i); wxNode *node = GetRegions().Item(i);
if (node) if (node)
{ {
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
if (isLeft) if (isLeft)
*x = left; *x = left;
@@ -307,23 +307,23 @@ int wxDividedShape::GetNumberOfAttachments() const
{ {
// There are two attachments for each region (left and right), // There are two attachments for each region (left and right),
// plus one on the top and one on the bottom. // 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; int maxN = n - 1;
wxNode *node = m_attachmentPoints.First(); wxNode *node = m_attachmentPoints.GetFirst();
while (node) while (node)
{ {
wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
if (point->m_id > maxN) if (point->m_id > maxN)
maxN = point->m_id; maxN = point->m_id;
node = node->Next(); node = node->GetNext();
} }
return maxN + 1; return maxN + 1;
} }
bool wxDividedShape::AttachmentIsValid(int attachment) bool wxDividedShape::AttachmentIsValid(int attachment)
{ {
int totalNumberAttachments = (GetRegions().Number() * 2) + 2; int totalNumberAttachments = (GetRegions().GetCount() * 2) + 2;
if (attachment >= totalNumberAttachments) if (attachment >= totalNumberAttachments)
{ {
return wxShape::AttachmentIsValid(attachment); return wxShape::AttachmentIsValid(attachment);
@@ -353,18 +353,18 @@ void wxDividedShape::MakeMandatoryControlPoints()
double currentY = (double)(GetY() - (m_height / 2.0)); double currentY = (double)(GetY() - (m_height / 2.0));
double maxY = (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; int i = 0;
while (node) while (node)
{ {
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
double proportion = region->m_regionProportionY; double proportion = region->m_regionProportionY;
double y = currentY + m_height*proportion; double y = currentY + m_height*proportion;
double actualY = (double)(maxY < y ? maxY : y); double actualY = (double)(maxY < y ? maxY : y);
if (node->Next()) if (node->GetNext())
{ {
wxDividedShapeControlPoint *controlPoint = wxDividedShapeControlPoint *controlPoint =
new wxDividedShapeControlPoint(m_canvas, this, i, CONTROL_POINT_SIZE, 0.0, (double)(actualY - GetY()), 0); new wxDividedShapeControlPoint(m_canvas, this, i, CONTROL_POINT_SIZE, 0.0, (double)(actualY - GetY()), 0);
@@ -373,14 +373,14 @@ void wxDividedShape::MakeMandatoryControlPoints()
} }
currentY = actualY; currentY = actualY;
i ++; i ++;
node = node->Next(); node = node->GetNext();
} }
} }
void wxDividedShape::ResetControlPoints() void wxDividedShape::ResetControlPoints()
{ {
// May only have the region handles, (n - 1) of them. // 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(); wxRectangleShape::ResetControlPoints();
ResetMandatoryControlPoints(); ResetMandatoryControlPoints();
@@ -391,15 +391,15 @@ void wxDividedShape::ResetMandatoryControlPoints()
double currentY = (double)(GetY() - (m_height / 2.0)); double currentY = (double)(GetY() - (m_height / 2.0));
double maxY = (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; int i = 0;
while (node) while (node)
{ {
wxControlPoint *controlPoint = (wxControlPoint *)node->Data(); wxControlPoint *controlPoint = (wxControlPoint *)node->GetData();
if (controlPoint->IsKindOf(CLASSINFO(wxDividedShapeControlPoint))) if (controlPoint->IsKindOf(CLASSINFO(wxDividedShapeControlPoint)))
{ {
wxNode *node1 = GetRegions().Nth(i); wxNode *node1 = GetRegions().Item(i);
wxShapeRegion *region = (wxShapeRegion *)node1->Data(); wxShapeRegion *region = (wxShapeRegion *)node1->GetData();
double proportion = region->m_regionProportionY; double proportion = region->m_regionProportionY;
@@ -411,7 +411,7 @@ void wxDividedShape::ResetMandatoryControlPoints()
currentY = actualY; currentY = actualY;
i ++; i ++;
} }
node = node->Next(); node = node->GetNext();
} }
} }
@@ -438,7 +438,7 @@ void wxDividedShape::EditRegions()
// TODO // TODO
#if 0 #if 0
if (GetRegions().Number() < 2) if (GetRegions().GetCount() < 2)
return; return;
wxBeginBusyCursor(); wxBeginBusyCursor();
@@ -446,15 +446,15 @@ void wxDividedShape::EditRegions()
GraphicsForm *form = new GraphicsForm("Divided nodes"); GraphicsForm *form = new GraphicsForm("Divided nodes");
// Need an array to store all the style strings, // Need an array to store all the style strings,
// since they need to be converted to integers // since they need to be converted to integers
char **styleStrings = new char *[GetRegions().Number()]; char **styleStrings = new char *[GetRegions().GetCount()];
for (int j = 0; j < GetRegions().Number(); j++) for (int j = 0; j < GetRegions().GetCount(); j++)
styleStrings[j] = NULL; styleStrings[j] = NULL;
int i = 0; int i = 0;
wxNode *node = GetRegions().First(); wxNode *node = GetRegions().GetFirst();
while (node && node->Next()) while (node && node->GetNext())
{ {
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
char buf[50]; char buf[50];
sprintf(buf, "Region %d", (i+1)); sprintf(buf, "Region %d", (i+1));
form->Add(wxMakeFormMessage(buf)); form->Add(wxMakeFormMessage(buf));
@@ -518,9 +518,9 @@ void wxDividedShape::EditRegions()
"Dot Dash" , "Dot Dash" ,
NULL), NULL),
NULL), NULL, wxVERTICAL, 100)); NULL), NULL, wxVERTICAL, 100));
node = node->Next(); node = node->GetNext();
i ++; i ++;
if (node && node->Next()) if (node && node->GetNext())
form->Add(wxMakeFormNewLine()); form->Add(wxMakeFormNewLine());
} }
wxDialogBox *dialog = new wxDialogBox(m_canvas->GetParent(), "Divided object properties", 10, 10, 500, 500); wxDialogBox *dialog = new wxDialogBox(m_canvas->GetParent(), "Divided object properties", 10, 10, 500, 500);
@@ -538,11 +538,11 @@ void wxDividedShape::EditRegions()
dialog->Show(TRUE); dialog->Show(TRUE);
node = GetRegions().First(); node = GetRegions().GetFirst();
i = 0; i = 0;
while (node) while (node)
{ {
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
if (styleStrings[i]) if (styleStrings[i])
{ {
@@ -559,7 +559,7 @@ void wxDividedShape::EditRegions()
delete[] styleStrings[i]; delete[] styleStrings[i];
} }
region->m_actualPenObject = NULL; region->m_actualPenObject = NULL;
node = node->Next(); node = node->GetNext();
i ++; i ++;
} }
delete[] styleStrings; delete[] styleStrings;
@@ -634,11 +634,11 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
wxDividedShape *dividedObject = (wxDividedShape *)m_shape; wxDividedShape *dividedObject = (wxDividedShape *)m_shape;
wxNode *node = dividedObject->GetRegions().Nth(regionId); wxNode *node = dividedObject->GetRegions().Item(regionId);
if (!node) if (!node)
return; return;
wxShapeRegion *thisRegion = (wxShapeRegion *)node->Data(); wxShapeRegion *thisRegion = (wxShapeRegion *)node->GetData();
wxShapeRegion *nextRegion = NULL; // Region below this one wxShapeRegion *nextRegion = NULL; // Region below this one
dc.SetLogicalFunction(wxCOPY); dc.SetLogicalFunction(wxCOPY);
@@ -657,10 +657,10 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int
double thisRegionBottom = 0.0; double thisRegionBottom = 0.0;
double nextRegionBottom = 0.0; double nextRegionBottom = 0.0;
node = dividedObject->GetRegions().First(); node = dividedObject->GetRegions().GetFirst();
while (node) while (node)
{ {
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
double proportion = region->m_regionProportionY; double proportion = region->m_regionProportionY;
double yy = currentY + (dividedObject->GetHeight()*proportion); double yy = currentY + (dividedObject->GetHeight()*proportion);
@@ -670,8 +670,8 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int
{ {
thisRegionTop = currentY; thisRegionTop = currentY;
thisRegionBottom = actualY; thisRegionBottom = actualY;
if (node->Next()) if (node->GetNext())
nextRegion = (wxShapeRegion *)node->Next()->Data(); nextRegion = (wxShapeRegion *)node->GetNext()->GetData();
} }
if (region == nextRegion) if (region == nextRegion)
{ {
@@ -679,7 +679,7 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int
} }
currentY = actualY; currentY = actualY;
node = node->Next(); node = node->GetNext();
} }
if (!nextRegion) if (!nextRegion)
return; return;
@@ -700,17 +700,17 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int
// Now reformat text // Now reformat text
int i = 0; int i = 0;
node = dividedObject->GetRegions().First(); node = dividedObject->GetRegions().GetFirst();
while (node) while (node)
{ {
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
if (region->GetText()) if (region->GetText())
{ {
wxChar *s = copystring(region->GetText()); wxChar *s = copystring(region->GetText());
dividedObject->FormatText(dc, s, i); dividedObject->FormatText(dc, s, i);
delete[] s; delete[] s;
} }
node = node->Next(); node = node->GetNext();
i++; i++;
} }
dividedObject->SetRegionSizes(); dividedObject->SetRegionSizes();

View File

@@ -148,15 +148,15 @@ void wxDrawnShape::Rotate(double x, double y, double theta)
// Rotate attachment points // Rotate attachment points
double sinTheta = (double)sin(actualTheta); double sinTheta = (double)sin(actualTheta);
double cosTheta = (double)cos(actualTheta); double cosTheta = (double)cos(actualTheta);
wxNode *node = m_attachmentPoints.First(); wxNode *node = m_attachmentPoints.GetFirst();
while (node) while (node)
{ {
wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data(); wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
double x1 = point->m_x; double x1 = point->m_x;
double y1 = point->m_y; double y1 = point->m_y;
point->m_x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta; 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; point->m_y = x1*sinTheta + y1*cosTheta + y*(1.0 - cosTheta) + x*sinTheta;
node = node->Next(); node = node->GetNext();
} }
m_rotation = theta; 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) 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); 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)) if (op->OnDrawOutline(dc, x, y, w, h, m_width, m_height))
return; return;
@@ -224,9 +224,9 @@ bool wxDrawnShape::GetPerimeterPoint(double x1, double y1,
{ {
if (m_metafiles[m_currentAngle].GetOutlineOp() != -1) 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); 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())) if (op->GetPerimeterPoint(x1, y1, x2, y2, x3, y3, GetX(), GetY(), GetAttachmentMode()))
return TRUE; return TRUE;
@@ -437,10 +437,10 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset)
} }
else else
{ {
wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex); wxNode *node = m_image->m_gdiObjects.Item(m_gdiIndex);
if (node) if (node)
{ {
wxPen *pen = (wxPen *)node->Data(); wxPen *pen = (wxPen *)node->GetData();
if (pen) if (pen)
dc.SetPen(* pen); dc.SetPen(* pen);
} }
@@ -470,10 +470,10 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset)
} }
else else
{ {
wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex); wxNode *node = m_image->m_gdiObjects.Item(m_gdiIndex);
if (node) if (node)
{ {
wxBrush *brush = (wxBrush *)node->Data(); wxBrush *brush = (wxBrush *)node->GetData();
if (brush) if (brush)
dc.SetBrush(* brush); dc.SetBrush(* brush);
} }
@@ -482,10 +482,10 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset)
} }
case DRAWOP_SET_FONT: case DRAWOP_SET_FONT:
{ {
wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex); wxNode *node = m_image->m_gdiObjects.Item(m_gdiIndex);
if (node) if (node)
{ {
wxFont *font = (wxFont *)node->Data(); wxFont *font = (wxFont *)node->GetData();
if (font) if (font)
dc.SetFont(* font); dc.SetFont(* font);
} }
@@ -563,20 +563,20 @@ void wxOpSetGDI::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
case DRAWOP_SET_BRUSH: case DRAWOP_SET_BRUSH:
case DRAWOP_SET_FONT: case DRAWOP_SET_FONT:
{ {
m_gdiIndex = (int)expr->Nth(1)->IntegerValue(); m_gdiIndex = (int)expr->Item(1)->IntegerValue();
break; break;
} }
case DRAWOP_SET_TEXT_COLOUR: case DRAWOP_SET_TEXT_COLOUR:
case DRAWOP_SET_BK_COLOUR: case DRAWOP_SET_BK_COLOUR:
{ {
m_r = (unsigned char)expr->Nth(1)->IntegerValue(); m_r = (unsigned char)expr->Item(1)->IntegerValue();
m_g = (unsigned char)expr->Nth(2)->IntegerValue(); m_g = (unsigned char)expr->Item(2)->IntegerValue();
m_b = (unsigned char)expr->Nth(3)->IntegerValue(); m_b = (unsigned char)expr->Item(3)->IntegerValue();
break; break;
} }
case DRAWOP_SET_BK_MODE: case DRAWOP_SET_BK_MODE:
{ {
m_mode = (int)expr->Nth(1)->IntegerValue(); m_mode = (int)expr->Item(1)->IntegerValue();
break; break;
} }
default: default:
@@ -665,10 +665,10 @@ void wxOpSetClipping::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
{ {
case DRAWOP_SET_CLIPPING_RECT: case DRAWOP_SET_CLIPPING_RECT:
{ {
m_x1 = expr->Nth(1)->RealValue(); m_x1 = expr->Item(1)->RealValue();
m_y1 = expr->Nth(2)->RealValue(); m_y1 = expr->Item(2)->RealValue();
m_x2 = expr->Nth(3)->RealValue(); m_x2 = expr->Item(3)->RealValue();
m_y2 = expr->Nth(4)->RealValue(); m_y2 = expr->Item(4)->RealValue();
break; break;
} }
default: default:
@@ -950,44 +950,44 @@ void wxOpDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
case DRAWOP_DRAW_RECT: case DRAWOP_DRAW_RECT:
case DRAWOP_DRAW_ELLIPSE: case DRAWOP_DRAW_ELLIPSE:
{ {
m_x1 = expr->Nth(1)->RealValue(); m_x1 = expr->Item(1)->RealValue();
m_y1 = expr->Nth(2)->RealValue(); m_y1 = expr->Item(2)->RealValue();
m_x2 = expr->Nth(3)->RealValue(); m_x2 = expr->Item(3)->RealValue();
m_y2 = expr->Nth(4)->RealValue(); m_y2 = expr->Item(4)->RealValue();
break; break;
} }
case DRAWOP_DRAW_ROUNDED_RECT: case DRAWOP_DRAW_ROUNDED_RECT:
{ {
m_x1 = expr->Nth(1)->RealValue(); m_x1 = expr->Item(1)->RealValue();
m_y1 = expr->Nth(2)->RealValue(); m_y1 = expr->Item(2)->RealValue();
m_x2 = expr->Nth(3)->RealValue(); m_x2 = expr->Item(3)->RealValue();
m_y2 = expr->Nth(4)->RealValue(); m_y2 = expr->Item(4)->RealValue();
m_radius = expr->Nth(5)->RealValue(); m_radius = expr->Item(5)->RealValue();
break; break;
} }
case DRAWOP_DRAW_POINT: case DRAWOP_DRAW_POINT:
{ {
m_x1 = expr->Nth(1)->RealValue(); m_x1 = expr->Item(1)->RealValue();
m_y1 = expr->Nth(2)->RealValue(); m_y1 = expr->Item(2)->RealValue();
break; break;
} }
case DRAWOP_DRAW_TEXT: case DRAWOP_DRAW_TEXT:
{ {
m_x1 = expr->Nth(1)->RealValue(); m_x1 = expr->Item(1)->RealValue();
m_y1 = expr->Nth(2)->RealValue(); m_y1 = expr->Item(2)->RealValue();
wxString str(expr->Nth(3)->StringValue()); wxString str(expr->Item(3)->StringValue());
m_textString = copystring(str); m_textString = copystring(str);
break; break;
} }
case DRAWOP_DRAW_ARC: case DRAWOP_DRAW_ARC:
case DRAWOP_DRAW_ELLIPTIC_ARC: case DRAWOP_DRAW_ELLIPTIC_ARC:
{ {
m_x1 = expr->Nth(1)->RealValue(); m_x1 = expr->Item(1)->RealValue();
m_y1 = expr->Nth(2)->RealValue(); m_y1 = expr->Item(2)->RealValue();
m_x2 = expr->Nth(3)->RealValue(); m_x2 = expr->Item(3)->RealValue();
m_y2 = expr->Nth(4)->RealValue(); m_y2 = expr->Item(4)->RealValue();
m_x3 = expr->Nth(5)->RealValue(); m_x3 = expr->Item(5)->RealValue();
m_y3 = expr->Nth(6)->RealValue(); m_y3 = expr->Item(6)->RealValue();
break; break;
} }
default: default:
@@ -1156,7 +1156,7 @@ wxExpr *wxOpPolyDraw::WriteExpr(wxPseudoMetaFile *image)
void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) 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 buf1[5];
char buf2[5]; char buf2[5];
@@ -1164,7 +1164,7 @@ void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
m_points = new wxRealPoint[m_noPoints]; m_points = new wxRealPoint[m_noPoints];
int i = 0; int i = 0;
int bufPtr = 0; int bufPtr = 0;
wxString hexString = expr->Nth(2)->StringValue(); wxString hexString = expr->Item(2)->StringValue();
while (i < m_noPoints) while (i < m_noPoints)
{ {
buf1[0] = hexString[(size_t)bufPtr]; buf1[0] = hexString[(size_t)bufPtr];
@@ -1390,12 +1390,12 @@ wxPseudoMetaFile::~wxPseudoMetaFile()
void wxPseudoMetaFile::Clear() void wxPseudoMetaFile::Clear()
{ {
wxNode *node = m_ops.First(); wxNode *node = m_ops.GetFirst();
while (node) while (node)
{ {
wxDrawOp *op = (wxDrawOp *)node->Data(); wxDrawOp *op = (wxDrawOp *)node->GetData();
delete op; delete op;
node = node->Next(); node = node->GetNext();
} }
m_ops.Clear(); m_ops.Clear();
m_gdiObjects.Clear(); m_gdiObjects.Clear();
@@ -1406,23 +1406,23 @@ void wxPseudoMetaFile::Clear()
void wxPseudoMetaFile::Draw(wxDC& dc, double xoffset, double yoffset) void wxPseudoMetaFile::Draw(wxDC& dc, double xoffset, double yoffset)
{ {
wxNode *node = m_ops.First(); wxNode *node = m_ops.GetFirst();
while (node) while (node)
{ {
wxDrawOp *op = (wxDrawOp *)node->Data(); wxDrawOp *op = (wxDrawOp *)node->GetData();
op->Do(dc, xoffset, yoffset); op->Do(dc, xoffset, yoffset);
node = node->Next(); node = node->GetNext();
} }
} }
void wxPseudoMetaFile::Scale(double sx, double sy) void wxPseudoMetaFile::Scale(double sx, double sy)
{ {
wxNode *node = m_ops.First(); wxNode *node = m_ops.GetFirst();
while (node) while (node)
{ {
wxDrawOp *op = (wxDrawOp *)node->Data(); wxDrawOp *op = (wxDrawOp *)node->GetData();
op->Scale(sx, sy); op->Scale(sx, sy);
node = node->Next(); node = node->GetNext();
} }
m_width *= sx; m_width *= sx;
m_height *= sy; m_height *= sy;
@@ -1430,12 +1430,12 @@ void wxPseudoMetaFile::Scale(double sx, double sy)
void wxPseudoMetaFile::Translate(double x, double y) void wxPseudoMetaFile::Translate(double x, double y)
{ {
wxNode *node = m_ops.First(); wxNode *node = m_ops.GetFirst();
while (node) while (node)
{ {
wxDrawOp *op = (wxDrawOp *)node->Data(); wxDrawOp *op = (wxDrawOp *)node->GetData();
op->Translate(x, y); 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 cosTheta = (double)cos(theta1);
double sinTheta = (double)sin(theta1); double sinTheta = (double)sin(theta1);
wxNode *node = m_ops.First(); wxNode *node = m_ops.GetFirst();
while (node) while (node)
{ {
wxDrawOp *op = (wxDrawOp *)node->Data(); wxDrawOp *op = (wxDrawOp *)node->GetData();
op->Rotate(x, y, theta, sinTheta, cosTheta); op->Rotate(x, y, theta, sinTheta, cosTheta);
node = node->Next(); node = node->GetNext();
} }
m_currentRotation = theta; m_currentRotation = theta;
} }
@@ -1480,11 +1480,11 @@ void wxPseudoMetaFile::WriteAttributes(wxExpr *clause, int whichAngle)
// Write GDI objects // Write GDI objects
char buf[50]; char buf[50];
int i = 1; int i = 1;
wxNode *node = m_gdiObjects.First(); wxNode *node = m_gdiObjects.GetFirst();
while (node) while (node)
{ {
sprintf(buf, "gdi%d_%d", whichAngle, i); sprintf(buf, "gdi%d_%d", whichAngle, i);
wxObject *obj = (wxObject *)node->Data(); wxObject *obj = (wxObject *)node->GetData();
wxExpr *expr = NULL; wxExpr *expr = NULL;
if (obj) if (obj)
{ {
@@ -1533,48 +1533,48 @@ void wxPseudoMetaFile::WriteAttributes(wxExpr *clause, int whichAngle)
clause->AddAttributeValue(buf, expr); clause->AddAttributeValue(buf, expr);
i ++; i ++;
} }
node = node->Next(); node = node->GetNext();
} }
// Write drawing operations // Write drawing operations
i = 1; i = 1;
node = m_ops.First(); node = m_ops.GetFirst();
while (node) while (node)
{ {
sprintf(buf, "op%d_%d", whichAngle, i); sprintf(buf, "op%d_%d", whichAngle, i);
wxDrawOp *op = (wxDrawOp *)node->Data(); wxDrawOp *op = (wxDrawOp *)node->GetData();
wxExpr *expr = op->WriteExpr(this); wxExpr *expr = op->WriteExpr(this);
if (expr) if (expr)
{ {
clause->AddAttributeValue(buf, expr); clause->AddAttributeValue(buf, expr);
i ++; i ++;
} }
node = node->Next(); node = node->GetNext();
} }
// Write outline and fill GDI op lists (if any) // Write outline and fill GDI op lists (if any)
if (m_outlineColours.Number() > 0) if (m_outlineColours.GetCount() > 0)
{ {
wxExpr *outlineExpr = new wxExpr(wxExprList); wxExpr *outlineExpr = new wxExpr(wxExprList);
node = m_outlineColours.First(); node = m_outlineColours.GetFirst();
while (node) while (node)
{ {
outlineExpr->Append(new wxExpr((long)node->Data())); outlineExpr->Append(new wxExpr((long)node->GetData()));
node = node->Next(); node = node->GetNext();
} }
wxString outlineObjectsStr; wxString outlineObjectsStr;
outlineObjectsStr.Printf(wxT("outline_objects%d"), whichAngle); outlineObjectsStr.Printf(wxT("outline_objects%d"), whichAngle);
clause->AddAttributeValue(outlineObjectsStr, outlineExpr); clause->AddAttributeValue(outlineObjectsStr, outlineExpr);
} }
if (m_fillColours.Number() > 0) if (m_fillColours.GetCount() > 0)
{ {
wxExpr *fillExpr = new wxExpr(wxExprList); wxExpr *fillExpr = new wxExpr(wxExprList);
node = m_fillColours.First(); node = m_fillColours.GetFirst();
while (node) while (node)
{ {
fillExpr->Append(new wxExpr((long)node->Data())); fillExpr->Append(new wxExpr((long)node->GetData()));
node = node->Next(); node = node->GetNext();
} }
wxString fillObjectsStr; wxString fillObjectsStr;
fillObjectsStr.Printf(wxT("fill_objects%d"), whichAngle); fillObjectsStr.Printf(wxT("fill_objects%d"), whichAngle);
@@ -1621,16 +1621,16 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle)
} }
else else
{ {
wxExpr *idExpr = expr->Nth(0); wxExpr *idExpr = expr->Item(0);
switch (idExpr->IntegerValue()) switch (idExpr->IntegerValue())
{ {
case gyTYPE_PEN: case gyTYPE_PEN:
{ {
int penWidth = (int)expr->Nth(1)->IntegerValue(); int penWidth = (int)expr->Item(1)->IntegerValue();
int penStyle = (int)expr->Nth(2)->IntegerValue(); int penStyle = (int)expr->Item(2)->IntegerValue();
int penRed = (int)expr->Nth(3)->IntegerValue(); int penRed = (int)expr->Item(3)->IntegerValue();
int penGreen = (int)expr->Nth(4)->IntegerValue(); int penGreen = (int)expr->Item(4)->IntegerValue();
int penBlue = (int)expr->Nth(5)->IntegerValue(); int penBlue = (int)expr->Item(5)->IntegerValue();
wxColour col(penRed, penGreen, penBlue); wxColour col(penRed, penGreen, penBlue);
wxPen *p = wxThePenList->FindOrCreatePen(col, penWidth, penStyle); wxPen *p = wxThePenList->FindOrCreatePen(col, penWidth, penStyle);
if (!p) if (!p)
@@ -1640,10 +1640,10 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle)
} }
case gyTYPE_BRUSH: case gyTYPE_BRUSH:
{ {
int brushStyle = (int)expr->Nth(1)->IntegerValue(); int brushStyle = (int)expr->Item(1)->IntegerValue();
int brushRed = (int)expr->Nth(2)->IntegerValue(); int brushRed = (int)expr->Item(2)->IntegerValue();
int brushGreen = (int)expr->Nth(3)->IntegerValue(); int brushGreen = (int)expr->Item(3)->IntegerValue();
int brushBlue = (int)expr->Nth(4)->IntegerValue(); int brushBlue = (int)expr->Item(4)->IntegerValue();
wxColour col(brushRed, brushGreen, brushBlue); wxColour col(brushRed, brushGreen, brushBlue);
wxBrush *b = wxTheBrushList->FindOrCreateBrush(col, brushStyle); wxBrush *b = wxTheBrushList->FindOrCreateBrush(col, brushStyle);
if (!b) if (!b)
@@ -1653,11 +1653,11 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle)
} }
case gyTYPE_FONT: case gyTYPE_FONT:
{ {
int fontPointSize = (int)expr->Nth(1)->IntegerValue(); int fontPointSize = (int)expr->Item(1)->IntegerValue();
int fontFamily = (int)expr->Nth(2)->IntegerValue(); int fontFamily = (int)expr->Item(2)->IntegerValue();
int fontStyle = (int)expr->Nth(3)->IntegerValue(); int fontStyle = (int)expr->Item(3)->IntegerValue();
int fontWeight = (int)expr->Nth(4)->IntegerValue(); int fontWeight = (int)expr->Item(4)->IntegerValue();
int fontUnderlined = (int)expr->Nth(5)->IntegerValue(); int fontUnderlined = (int)expr->Item(5)->IntegerValue();
m_gdiObjects.Append(wxTheFontList->FindOrCreateFont(fontPointSize, m_gdiObjects.Append(wxTheFontList->FindOrCreateFont(fontPointSize,
fontFamily, fontStyle, fontWeight, (fontUnderlined != 0))); fontFamily, fontStyle, fontWeight, (fontUnderlined != 0)));
break; break;
@@ -1687,7 +1687,7 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle)
} }
else else
{ {
wxExpr *idExpr = expr->Nth(0); wxExpr *idExpr = expr->Item(0);
int opId = (int)idExpr->IntegerValue(); int opId = (int)idExpr->IntegerValue();
switch (opId) switch (opId)
{ {
@@ -1787,35 +1787,35 @@ void wxPseudoMetaFile::Copy(wxPseudoMetaFile& copy)
copy.m_outlineOp = m_outlineOp; copy.m_outlineOp = m_outlineOp;
// Copy the GDI objects // Copy the GDI objects
wxNode *node = m_gdiObjects.First(); wxNode *node = m_gdiObjects.GetFirst();
while (node) while (node)
{ {
wxObject *obj = (wxObject *)node->Data(); wxObject *obj = (wxObject *)node->GetData();
copy.m_gdiObjects.Append(obj); copy.m_gdiObjects.Append(obj);
node = node->Next(); node = node->GetNext();
} }
// Copy the operations // Copy the operations
node = m_ops.First(); node = m_ops.GetFirst();
while (node) while (node)
{ {
wxDrawOp *op = (wxDrawOp *)node->Data(); wxDrawOp *op = (wxDrawOp *)node->GetData();
copy.m_ops.Append(op->Copy(&copy)); copy.m_ops.Append(op->Copy(&copy));
node = node->Next(); node = node->GetNext();
} }
// Copy the outline/fill operations // Copy the outline/fill operations
node = m_outlineColours.First(); node = m_outlineColours.GetFirst();
while (node) while (node)
{ {
copy.m_outlineColours.Append((wxObject *)node->Data()); copy.m_outlineColours.Append((wxObject *)node->GetData());
node = node->Next(); node = node->GetNext();
} }
node = m_fillColours.First(); node = m_fillColours.GetFirst();
while (node) while (node)
{ {
copy.m_fillColours.Append((wxObject *)node->Data()); copy.m_fillColours.Append((wxObject *)node->GetData());
node = node->Next(); node = node->GetNext();
} }
} }
@@ -1828,7 +1828,7 @@ void wxPseudoMetaFile::Copy(wxPseudoMetaFile& copy)
bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth, double *rheight) bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth, double *rheight)
{ {
if (!wxFileExists(filename)) if (!wxFileExists(filename))
return NULL; return FALSE;
wxXMetaFile *metaFile = new wxXMetaFile; wxXMetaFile *metaFile = new wxXMetaFile;
@@ -1842,10 +1842,10 @@ bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth
double lastY = 0.0; double lastY = 0.0;
// Convert from metafile records to wxDrawnShape records // Convert from metafile records to wxDrawnShape records
wxNode *node = metaFile->metaRecords.First(); wxNode *node = metaFile->metaRecords.GetFirst();
while (node) while (node)
{ {
wxMetaRecord *record = (wxMetaRecord *)node->Data(); wxMetaRecord *record = (wxMetaRecord *)node->GetData();
switch (record->metaFunction) switch (record->metaFunction)
{ {
case META_SETBKCOLOR: 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 // The pen, brush etc. has already been created when the metafile
// was read in, so we don't create it - we set it. // 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) if (recNode)
{ {
wxMetaRecord *gdiRec = (wxMetaRecord *)recNode->Data(); wxMetaRecord *gdiRec = (wxMetaRecord *)recNode->GetData();
if (gdiRec && (gdiRec->param1 != 0)) if (gdiRec && (gdiRec->param1 != 0))
{ {
wxObject *obj = (wxObject *)gdiRec->param1; wxObject *obj = (wxObject *)gdiRec->param1;
@@ -2135,7 +2135,7 @@ bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth
break; break;
} }
} }
node = node->Next(); node = node->GetNext();
} }
double actualWidth = (double)fabs(metaFile->right - metaFile->left); double actualWidth = (double)fabs(metaFile->right - metaFile->left);
double actualHeight = (double)fabs(metaFile->bottom - metaFile->top); 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 minX = (double) 99999.9;
double minY = (double) 99999.9; double minY = (double) 99999.9;
wxNode *node = m_ops.First(); wxNode *node = m_ops.GetFirst();
while (node) while (node)
{ {
wxDrawOp *op = (wxDrawOp *)node->Data(); wxDrawOp *op = (wxDrawOp *)node->GetData();
switch (op->GetOp()) switch (op->GetOp())
{ {
case DRAWOP_DRAW_LINE: case DRAWOP_DRAW_LINE:
@@ -2262,7 +2262,7 @@ void wxPseudoMetaFile::GetBounds(double *boundMinX, double *boundMinY, double *b
default: default:
break; break;
} }
node = node->Next(); node = node->GetNext();
} }
*boundMinX = minX; *boundMinX = minX;
@@ -2400,7 +2400,7 @@ void wxPseudoMetaFile::DrawPolygon(int n, wxPoint pts[], int flags)
m_ops.Append(theOp); m_ops.Append(theOp);
if (flags & oglMETAFLAGS_OUTLINE) if (flags & oglMETAFLAGS_OUTLINE)
m_outlineOp = (m_ops.Number() - 1); m_outlineOp = (m_ops.GetCount() - 1);
} }
void wxPseudoMetaFile::DrawSpline(int n, wxPoint pts[]) void wxPseudoMetaFile::DrawSpline(int n, wxPoint pts[])
@@ -2433,7 +2433,7 @@ void wxPseudoMetaFile::DestroyClippingRect()
void wxPseudoMetaFile::SetPen(wxPen* pen, bool isOutline) void wxPseudoMetaFile::SetPen(wxPen* pen, bool isOutline)
{ {
m_gdiObjects.Append(pen); m_gdiObjects.Append(pen);
int n = m_gdiObjects.Number(); int n = m_gdiObjects.GetCount();
wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_PEN, this, n - 1); 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) void wxPseudoMetaFile::SetBrush(wxBrush* brush, bool isFill)
{ {
m_gdiObjects.Append(brush); m_gdiObjects.Append(brush);
int n = m_gdiObjects.Number(); int n = m_gdiObjects.GetCount();
wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_BRUSH, this, n - 1); 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) void wxPseudoMetaFile::SetFont(wxFont* font)
{ {
m_gdiObjects.Append(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); wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_FONT, this, n - 1);

View File

@@ -131,10 +131,10 @@ wxNode *wxLineShape::InsertLineControlPoint(wxDC* dc)
if (dc) if (dc)
Erase(*dc); Erase(*dc);
wxNode *last = m_lineControlPoints->Last(); wxNode *last = m_lineControlPoints->GetLast();
wxNode *second_last = last->Previous(); wxNode *second_last = last->GetPrevious();
wxRealPoint *last_point = (wxRealPoint *)last->Data(); wxRealPoint *last_point = (wxRealPoint *)last->GetData();
wxRealPoint *second_last_point = (wxRealPoint *)second_last->Data(); wxRealPoint *second_last_point = (wxRealPoint *)second_last->GetData();
// Choose a point half way between the last and penultimate points // Choose a point half way between the last and penultimate points
double line_x = ((last_point->x + second_last_point->x)/2); double line_x = ((last_point->x + second_last_point->x)/2);
@@ -147,13 +147,13 @@ wxNode *wxLineShape::InsertLineControlPoint(wxDC* dc)
bool wxLineShape::DeleteLineControlPoint() bool wxLineShape::DeleteLineControlPoint()
{ {
if (m_lineControlPoints->Number() < 3) if (m_lineControlPoints->GetCount() < 3)
return FALSE; return FALSE;
wxNode *last = m_lineControlPoints->Last(); wxNode *last = m_lineControlPoints->GetLast();
wxNode *second_last = last->Previous(); 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_point;
delete second_last; delete second_last;
@@ -165,19 +165,19 @@ void wxLineShape::Initialise()
if (m_lineControlPoints) if (m_lineControlPoints)
{ {
// Just move the first and last control points // Just move the first and last control points
wxNode *first = m_lineControlPoints->First(); wxNode *first = m_lineControlPoints->GetFirst();
wxRealPoint *first_point = (wxRealPoint *)first->Data(); wxRealPoint *first_point = (wxRealPoint *)first->GetData();
wxNode *last = m_lineControlPoints->Last(); wxNode *last = m_lineControlPoints->GetLast();
wxRealPoint *last_point = (wxRealPoint *)last->Data(); wxRealPoint *last_point = (wxRealPoint *)last->GetData();
// If any of the line points are at -999, we must // If any of the line points are at -999, we must
// initialize them by placing them half way between the first // initialize them by placing them half way between the first
// and the last. // and the last.
wxNode *node = first->Next(); wxNode *node = first->GetNext();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
if (point->x == -999) if (point->x == -999)
{ {
double x1, y1, x2, y2; double x1, y1, x2, y2;
@@ -194,7 +194,7 @@ void wxLineShape::Initialise()
point->x = ((x2 - x1)/2 + x1); point->x = ((x2 - x1)/2 + x1);
point->y = ((y2 - y1)/2 + y1); 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; double w, h;
ClearText(i); ClearText(i);
if (m_regions.Number() < 1) if (m_regions.GetCount() < 1)
return; return;
wxNode *node = m_regions.Nth(i); wxNode *node = m_regions.Item(i);
if (!node) if (!node)
return; return;
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
region->SetText(s); region->SetText(s);
dc.SetFont(* region->GetFont()); 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()); wxStringList *string_list = oglFormatText(dc, s, (w-5), (h-5), region->GetFormatMode());
node = string_list->First(); node = (wxNode*)string_list->GetFirst();
while (node) while (node)
{ {
wxChar *s = (wxChar *)node->Data(); wxChar *s = (wxChar *)node->GetData();
wxShapeTextLine *line = new wxShapeTextLine(0.0, 0.0, s); wxShapeTextLine *line = new wxShapeTextLine(0.0, 0.0, s);
region->GetFormattedText().Append((wxObject *)line); region->GetFormattedText().Append((wxObject *)line);
node = node->Next(); node = node->GetNext();
} }
delete string_list; delete string_list;
double actualW = w; double actualW = w;
@@ -280,7 +280,7 @@ void wxLineShape::DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y
double yp = yy + y; double yp = yy + y;
// First, clear a rectangle for the text IF there is any // 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.SetPen(GetBackgroundPen());
dc.SetBrush(GetBackgroundBrush()); dc.SetBrush(GetBackgroundBrush());
@@ -316,7 +316,7 @@ void wxLineShape::EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double
double xp = xx + x; double xp = xx + x;
double yp = yy + y; double yp = yy + y;
if (region->GetFormattedText().Number() > 0) if (region->GetFormattedText().GetCount() > 0)
{ {
dc.SetPen(GetBackgroundPen()); dc.SetPen(GetBackgroundPen());
dc.SetBrush(GetBackgroundBrush()); dc.SetBrush(GetBackgroundBrush());
@@ -335,14 +335,14 @@ void wxLineShape::GetLabelPosition(int position, double *x, double *y)
case 0: case 0:
{ {
// Want to take the middle section for the label // 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); int half_way = (int)(n/2);
// Find middle of this line // Find middle of this line
wxNode *node = m_lineControlPoints->Nth(half_way - 1); wxNode *node = m_lineControlPoints->Item(half_way - 1);
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxNode *next_node = node->Next(); wxNode *next_node = node->GetNext();
wxRealPoint *next_point = (wxRealPoint *)next_node->Data(); wxRealPoint *next_point = (wxRealPoint *)next_node->GetData();
double dx = (next_point->x - point->x); double dx = (next_point->x - point->x);
double dy = (next_point->y - point->y); double dy = (next_point->y - point->y);
@@ -352,16 +352,16 @@ void wxLineShape::GetLabelPosition(int position, double *x, double *y)
} }
case 1: case 1:
{ {
wxNode *node = m_lineControlPoints->First(); wxNode *node = m_lineControlPoints->GetFirst();
*x = ((wxRealPoint *)node->Data())->x; *x = ((wxRealPoint *)node->GetData())->x;
*y = ((wxRealPoint *)node->Data())->y; *y = ((wxRealPoint *)node->GetData())->y;
break; break;
} }
case 2: case 2:
{ {
wxNode *node = m_lineControlPoints->Last(); wxNode *node = m_lineControlPoints->GetLast();
*x = ((wxRealPoint *)node->Data())->x; *x = ((wxRealPoint *)node->GetData())->x;
*y = ((wxRealPoint *)node->Data())->y; *y = ((wxRealPoint *)node->GetData())->y;
break; break;
} }
default: default:
@@ -390,29 +390,29 @@ void GraphicsStraightenLine(wxRealPoint *point1, wxRealPoint *point2)
void wxLineShape::Straighten(wxDC *dc) void wxLineShape::Straighten(wxDC *dc)
{ {
if (!m_lineControlPoints || m_lineControlPoints->Number() < 3) if (!m_lineControlPoints || m_lineControlPoints->GetCount() < 3)
return; return;
if (dc) if (dc)
Erase(* dc); Erase(* dc);
wxNode *first_point_node = m_lineControlPoints->First(); wxNode *first_point_node = m_lineControlPoints->GetFirst();
wxNode *last_point_node = m_lineControlPoints->Last(); wxNode *last_point_node = m_lineControlPoints->GetLast();
wxNode *second_last_point_node = last_point_node->Previous(); wxNode *second_last_point_node = last_point_node->GetPrevious();
wxRealPoint *last_point = (wxRealPoint *)last_point_node->Data(); wxRealPoint *last_point = (wxRealPoint *)last_point_node->GetData();
wxRealPoint *second_last_point = (wxRealPoint *)second_last_point_node->Data(); wxRealPoint *second_last_point = (wxRealPoint *)second_last_point_node->GetData();
GraphicsStraightenLine(last_point, second_last_point); GraphicsStraightenLine(last_point, second_last_point);
wxNode *node = first_point_node; wxNode *node = first_point_node;
while (node && (node != second_last_point_node)) while (node && (node != second_last_point_node))
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxRealPoint *next_point = (wxRealPoint *)(node->Next()->Data()); wxRealPoint *next_point = (wxRealPoint *)(node->GetNext()->GetData());
GraphicsStraightenLine(point, next_point); GraphicsStraightenLine(point, next_point);
node = node->Next(); node = node->GetNext();
} }
if (dc) if (dc)
@@ -433,10 +433,10 @@ void wxLineShape::Unlink()
void wxLineShape::SetEnds(double x1, double y1, double x2, double y2) void wxLineShape::SetEnds(double x1, double y1, double x2, double y2)
{ {
// Find centre point // Find centre point
wxNode *first_point_node = m_lineControlPoints->First(); wxNode *first_point_node = m_lineControlPoints->GetFirst();
wxNode *last_point_node = m_lineControlPoints->Last(); wxNode *last_point_node = m_lineControlPoints->GetLast();
wxRealPoint *first_point = (wxRealPoint *)first_point_node->Data(); wxRealPoint *first_point = (wxRealPoint *)first_point_node->GetData();
wxRealPoint *last_point = (wxRealPoint *)last_point_node->Data(); wxRealPoint *last_point = (wxRealPoint *)last_point_node->GetData();
first_point->x = x1; first_point->x = x1;
first_point->y = y1; first_point->y = y1;
@@ -450,10 +450,10 @@ void wxLineShape::SetEnds(double x1, double y1, double x2, double y2)
// Get absolute positions of ends // Get absolute positions of ends
void wxLineShape::GetEnds(double *x1, double *y1, double *x2, double *y2) void wxLineShape::GetEnds(double *x1, double *y1, double *x2, double *y2)
{ {
wxNode *first_point_node = m_lineControlPoints->First(); wxNode *first_point_node = m_lineControlPoints->GetFirst();
wxNode *last_point_node = m_lineControlPoints->Last(); wxNode *last_point_node = m_lineControlPoints->GetLast();
wxRealPoint *first_point = (wxRealPoint *)first_point_node->Data(); wxRealPoint *first_point = (wxRealPoint *)first_point_node->GetData();
wxRealPoint *last_point = (wxRealPoint *)last_point_node->Data(); wxRealPoint *last_point = (wxRealPoint *)last_point_node->GetData();
*x1 = first_point->x; *y1 = first_point->y; *x1 = first_point->x; *y1 = first_point->y;
*x2 = last_point->x; *y2 = last_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; bool inLabelRegion = FALSE;
for (int i = 0; i < 3; i ++) for (int i = 0; i < 3; i ++)
{ {
wxNode *regionNode = m_regions.Nth(i); wxNode *regionNode = m_regions.Item(i);
if (regionNode) if (regionNode)
{ {
wxShapeRegion *region = (wxShapeRegion *)regionNode->Data(); wxShapeRegion *region = (wxShapeRegion *)regionNode->GetData();
if (region->m_formattedText.Number() > 0) if (region->m_formattedText.GetCount() > 0)
{ {
double xp, yp, cx, cy, cw, ch; double xp, yp, cx, cy, cw, ch;
GetLabelPosition(i, &xp, &yp); 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 *point1 = (wxRealPoint *)node->GetData();
wxRealPoint *point2 = (wxRealPoint *)node->Next()->Data(); wxRealPoint *point2 = (wxRealPoint *)node->GetNext()->GetData();
// Allow for inaccurate mousing or vert/horiz lines // Allow for inaccurate mousing or vert/horiz lines
int extra = 4; int extra = 4;
@@ -526,7 +526,7 @@ bool wxLineShape::HitTest(double x, double y, int *attachment, double *distance)
return TRUE; return TRUE;
} }
node = node->Next(); node = node->GetNext();
} }
return FALSE; return FALSE;
} }
@@ -538,10 +538,10 @@ void wxLineShape::DrawArrows(wxDC& dc)
double endArrowPos = 0.0; double endArrowPos = 0.0;
double middleArrowPos = 0.0; double middleArrowPos = 0.0;
wxNode *node = m_arcArrows.First(); wxNode *node = m_arcArrows.GetFirst();
while (node) while (node)
{ {
wxArrowHead *arrow = (wxArrowHead *)node->Data(); wxArrowHead *arrow = (wxArrowHead *)node->GetData();
switch (arrow->GetArrowEnd()) switch (arrow->GetArrowEnd())
{ {
case ARROW_POSITION_START: case ARROW_POSITION_START:
@@ -580,21 +580,21 @@ void wxLineShape::DrawArrows(wxDC& dc)
break; break;
} }
} }
node = node->Next(); node = node->GetNext();
} }
} }
void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool proportionalOffset) void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool proportionalOffset)
{ {
wxNode *first_line_node = m_lineControlPoints->First(); wxNode *first_line_node = m_lineControlPoints->GetFirst();
wxRealPoint *first_line_point = (wxRealPoint *)first_line_node->Data(); wxRealPoint *first_line_point = (wxRealPoint *)first_line_node->GetData();
wxNode *second_line_node = first_line_node->Next(); wxNode *second_line_node = first_line_node->GetNext();
wxRealPoint *second_line_point = (wxRealPoint *)second_line_node->Data(); wxRealPoint *second_line_point = (wxRealPoint *)second_line_node->GetData();
wxNode *last_line_node = m_lineControlPoints->Last(); wxNode *last_line_node = m_lineControlPoints->GetLast();
wxRealPoint *last_line_point = (wxRealPoint *)last_line_node->Data(); wxRealPoint *last_line_point = (wxRealPoint *)last_line_node->GetData();
wxNode *second_last_line_node = last_line_node->Previous(); wxNode *second_last_line_node = last_line_node->GetPrevious();
wxRealPoint *second_last_line_point = (wxRealPoint *)second_last_line_node->Data(); wxRealPoint *second_last_line_point = (wxRealPoint *)second_last_line_node->GetData();
// Position where we want to start drawing // Position where we want to start drawing
double positionOnLineX, positionOnLineY; double positionOnLineX, positionOnLineY;
@@ -859,11 +859,11 @@ void wxLineShape::OnErase(wxDC& dc)
// Undraw text regions // Undraw text regions
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
wxNode *node = m_regions.Nth(i); wxNode *node = m_regions.Item(i);
if (node) if (node)
{ {
double x, y; double x, y;
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
GetLabelPosition(i, &x, &y); GetLabelPosition(i, &x, &y);
EraseRegion(dc, region, x, y); EraseRegion(dc, region, x, y);
} }
@@ -899,17 +899,17 @@ void wxLineShape::GetBoundingBoxMin(double *w, double *h)
double x2 = -10000; double x2 = -10000;
double y2 = -10000; double y2 = -10000;
wxNode *node = m_lineControlPoints->First(); wxNode *node = m_lineControlPoints->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
if (point->x < x1) x1 = point->x; if (point->x < x1) x1 = point->x;
if (point->y < y1) y1 = point->y; if (point->y < y1) y1 = point->y;
if (point->x > x2) x2 = point->x; if (point->x > x2) x2 = point->x;
if (point->y > y2) y2 = point->y; if (point->y > y2) y2 = point->y;
node = node->Next(); node = node->GetNext();
} }
*w = (double)(x2 - x1); *w = (double)(x2 - x1);
*h = (double)(y2 - y1); *h = (double)(y2 - y1);
@@ -924,7 +924,7 @@ void wxLineShape::FindNth(wxShape *image, int *nth, int *no_arcs, bool incoming)
{ {
int n = -1; int n = -1;
int num = 0; int num = 0;
wxNode *node = image->GetLines().First(); wxNode *node = image->GetLines().GetFirst();
int this_attachment; int this_attachment;
if (image == m_to) if (image == m_to)
this_attachment = m_attachmentTo; 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 // Find number of lines going into/out of this particular attachment point
while (node) while (node)
{ {
wxLineShape *line = (wxLineShape *)node->Data(); wxLineShape *line = (wxLineShape *)node->GetData();
if (line->m_from == image) if (line->m_from == image)
{ {
@@ -958,7 +958,7 @@ void wxLineShape::FindNth(wxShape *image, int *nth, int *no_arcs, bool incoming)
num ++; num ++;
} }
node = node->Next(); node = node->GetNext();
} }
*nth = n; *nth = n;
*no_arcs = num; *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)) if (m_lineControlPoints && !(x_offset == 0.0 && y_offset == 0.0))
{ {
wxNode *node = m_lineControlPoints->First(); wxNode *node = m_lineControlPoints->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
point->x += x_offset; point->x += x_offset;
point->y += y_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); m_labelObjects[i]->Erase(dc);
double xp, yp, xr, yr; double xp, yp, xr, yr;
GetLabelPosition(i, &xp, &yp); GetLabelPosition(i, &xp, &yp);
wxNode *node = m_regions.Nth(i); wxNode *node = m_regions.Item(i);
if (node) if (node)
{ {
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
region->GetPosition(&xr, &yr); region->GetPosition(&xr, &yr);
} }
else else
@@ -1029,7 +1029,7 @@ void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints)
if (!m_from || !m_to) if (!m_from || !m_to)
return; return;
if (m_lineControlPoints->Number() > 2) if (m_lineControlPoints->GetCount() > 2)
Initialise(); Initialise();
// Do each end - nothing in the middle. User has to move other points // 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); FindLineEndPoints(&end_x, &end_y, &other_end_x, &other_end_y);
wxNode *first = m_lineControlPoints->First(); wxNode *first = m_lineControlPoints->GetFirst();
wxRealPoint *first_point = (wxRealPoint *)first->Data(); wxRealPoint *first_point = (wxRealPoint *)first->GetData();
wxNode *last = m_lineControlPoints->Last(); wxNode *last = m_lineControlPoints->GetLast();
wxRealPoint *last_point = (wxRealPoint *)last->Data(); wxRealPoint *last_point = (wxRealPoint *)last->GetData();
/* This is redundant, surely? Done by SetEnds. /* This is redundant, surely? Done by SetEnds.
first_point->x = end_x; first_point->y = end_y; 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. // 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)) 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) 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->x += x_offset;
point->y += y_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 end_x, end_y;
double other_end_x, other_end_y; double other_end_x, other_end_y;
wxNode *first = m_lineControlPoints->First(); wxNode *first = m_lineControlPoints->GetFirst();
wxRealPoint *first_point = (wxRealPoint *)first->Data(); wxRealPoint *first_point = (wxRealPoint *)first->GetData();
wxNode *last = m_lineControlPoints->Last(); wxNode *last = m_lineControlPoints->GetLast();
wxRealPoint *last_point = (wxRealPoint *)last->Data(); wxRealPoint *last_point = (wxRealPoint *)last->GetData();
wxNode *second = first->Next(); wxNode *second = first->GetNext();
wxRealPoint *second_point = (wxRealPoint *)second->Data(); wxRealPoint *second_point = (wxRealPoint *)second->GetData();
wxNode *second_last = last->Previous(); wxNode *second_last = last->GetPrevious();
wxRealPoint *second_last_point = (wxRealPoint *)second_last->Data(); 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) if (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE)
{ {
@@ -1181,12 +1181,12 @@ void wxLineShape::OnDraw(wxDC& dc)
if (m_brush) if (m_brush)
dc.SetBrush(* m_brush); dc.SetBrush(* m_brush);
int n = m_lineControlPoints->Number(); int n = m_lineControlPoints->GetCount();
wxPoint *points = new wxPoint[n]; wxPoint *points = new wxPoint[n];
int i; int i;
for (i = 0; i < n; 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].x = WXROUND(point->x);
points[i].y = WXROUND(point->y); points[i].y = WXROUND(point->y);
} }
@@ -1284,10 +1284,10 @@ void wxLineShape::OnDrawContents(wxDC& dc)
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
wxNode *node = m_regions.Nth(i); wxNode *node = m_regions.Item(i);
if (node) if (node)
{ {
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
double x, y; double x, y;
GetLabelPosition(i, &x, &y); GetLabelPosition(i, &x, &y);
DrawRegion(dc, region, x, y); DrawRegion(dc, region, x, y);
@@ -1309,10 +1309,10 @@ void wxLineShape::MakeControlPoints()
{ {
if (m_canvas && m_lineControlPoints) if (m_canvas && m_lineControlPoints)
{ {
wxNode *first = m_lineControlPoints->First(); wxNode *first = m_lineControlPoints->GetFirst();
wxNode *last = m_lineControlPoints->Last(); wxNode *last = m_lineControlPoints->GetLast();
wxRealPoint *first_point = (wxRealPoint *)first->Data(); wxRealPoint *first_point = (wxRealPoint *)first->GetData();
wxRealPoint *last_point = (wxRealPoint *)last->Data(); wxRealPoint *last_point = (wxRealPoint *)last->GetData();
wxLineControlPoint *control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, wxLineControlPoint *control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
first_point->x, first_point->y, first_point->x, first_point->y,
@@ -1322,10 +1322,10 @@ void wxLineShape::MakeControlPoints()
m_controlPoints.Append(control); m_controlPoints.Append(control);
wxNode *node = first->Next(); wxNode *node = first->GetNext();
while (node != last) while (node != last)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
point->x, point->y, point->x, point->y,
@@ -1335,7 +1335,7 @@ void wxLineShape::MakeControlPoints()
m_canvas->AddShape(control); m_canvas->AddShape(control);
m_controlPoints.Append(control); m_controlPoints.Append(control);
node = node->Next(); node = node->GetNext();
} }
control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
last_point->x, last_point->y, last_point->x, last_point->y,
@@ -1350,19 +1350,19 @@ void wxLineShape::MakeControlPoints()
void wxLineShape::ResetControlPoints() 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 *node = m_controlPoints.GetFirst();
wxNode *control_node = m_lineControlPoints->First(); wxNode *control_node = m_lineControlPoints->GetFirst();
while (node && control_node) while (node && control_node)
{ {
wxRealPoint *point = (wxRealPoint *)control_node->Data(); wxRealPoint *point = (wxRealPoint *)control_node->GetData();
wxLineControlPoint *control = (wxLineControlPoint *)node->Data(); wxLineControlPoint *control = (wxLineControlPoint *)node->GetData();
control->SetX(point->x); control->SetX(point->x);
control->SetY(point->y); control->SetY(point->y);
node = node->Next(); node = node->GetNext();
control_node = control_node->Next(); control_node = control_node->GetNext();
} }
} }
} }
@@ -1393,10 +1393,10 @@ void wxLineShape::WriteAttributes(wxExpr *clause)
// Make a list of lists for the (sp)line controls // Make a list of lists for the (sp)line controls
wxExpr *list = new wxExpr(wxExprList); wxExpr *list = new wxExpr(wxExprList);
wxNode *node = m_lineControlPoints->First(); wxNode *node = m_lineControlPoints->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxExpr *point_list = new wxExpr(wxExprList); wxExpr *point_list = new wxExpr(wxExprList);
wxExpr *x_expr = new wxExpr((double) point->x); wxExpr *x_expr = new wxExpr((double) point->x);
wxExpr *y_expr = new wxExpr((double) point->y); wxExpr *y_expr = new wxExpr((double) point->y);
@@ -1404,20 +1404,20 @@ void wxLineShape::WriteAttributes(wxExpr *clause)
point_list->Append(y_expr); point_list->Append(y_expr);
list->Append(point_list); list->Append(point_list);
node = node->Next(); node = node->GetNext();
} }
clause->AddAttributeValue("controls", list); clause->AddAttributeValue("controls", list);
// Write arc arrows in new OGL format, if there are any. // Write arc arrows in new OGL format, if there are any.
// This is a list of lists. Each sublist comprises: // This is a list of lists. Each sublist comprises:
// (arrowType arrowEnd xOffset arrowSize) // (arrowType arrowEnd xOffset arrowSize)
if (m_arcArrows.Number() > 0) if (m_arcArrows.GetCount() > 0)
{ {
wxExpr *arrow_list = new wxExpr(wxExprList); wxExpr *arrow_list = new wxExpr(wxExprList);
node = m_arcArrows.First(); node = m_arcArrows.GetFirst();
while (node) while (node)
{ {
wxArrowHead *head = (wxArrowHead *)node->Data(); wxArrowHead *head = (wxArrowHead *)node->GetData();
wxExpr *head_list = new wxExpr(wxExprList); wxExpr *head_list = new wxExpr(wxExprList);
head_list->Append(new wxExpr((long)head->_GetType())); head_list->Append(new wxExpr((long)head->_GetType()));
head_list->Append(new wxExpr((long)head->GetArrowEnd())); head_list->Append(new wxExpr((long)head->GetArrowEnd()));
@@ -1432,7 +1432,7 @@ void wxLineShape::WriteAttributes(wxExpr *clause)
arrow_list->Append(head_list); arrow_list->Append(head_list);
node = node->Next(); node = node->GetNext();
} }
clause->AddAttributeValue("arrows", arrow_list); clause->AddAttributeValue("arrows", arrow_list);
} }
@@ -1454,20 +1454,20 @@ void wxLineShape::ReadAttributes(wxExpr *clause)
clause->AssignAttributeValue(wxT("align_end"), &m_alignmentEnd); clause->AssignAttributeValue(wxT("align_end"), &m_alignmentEnd);
// Compatibility: check for no regions. // Compatibility: check for no regions.
if (m_regions.Number() == 0) if (m_regions.GetCount() == 0)
{ {
wxShapeRegion *newRegion = new wxShapeRegion; wxShapeRegion *newRegion = new wxShapeRegion;
newRegion->SetName("Middle"); newRegion->SetName("Middle");
newRegion->SetSize(150, 50); newRegion->SetSize(150, 50);
m_regions.Append((wxObject *)newRegion); m_regions.Append((wxObject *)newRegion);
if (m_text.Number() > 0) if (m_text.GetCount() > 0)
{ {
newRegion->ClearText(); newRegion->ClearText();
wxNode *node = m_text.First(); wxNode *node = m_text.GetFirst();
while (node) while (node)
{ {
wxShapeTextLine *textLine = (wxShapeTextLine *)node->Data(); wxShapeTextLine *textLine = (wxShapeTextLine *)node->GetData();
wxNode *next = node->Next(); wxNode *next = node->GetNext();
newRegion->GetFormattedText().Append((wxObject *)textLine); newRegion->GetFormattedText().Append((wxObject *)textLine);
delete node; delete node;
node = next; node = next;
@@ -1541,16 +1541,16 @@ void wxLineShape::ReadAttributes(wxExpr *clause)
wxString arrowName; wxString arrowName;
long arrowId = -1; long arrowId = -1;
wxExpr *type_expr = node->Nth(0); wxExpr *type_expr = node->Item(0);
wxExpr *end_expr = node->Nth(1); wxExpr *end_expr = node->Item(1);
wxExpr *dist_expr = node->Nth(2); wxExpr *dist_expr = node->Item(2);
wxExpr *size_expr = node->Nth(3); wxExpr *size_expr = node->Item(3);
wxExpr *name_expr = node->Nth(4); wxExpr *name_expr = node->Item(4);
wxExpr *id_expr = node->Nth(5); wxExpr *id_expr = node->Item(5);
// New members of wxArrowHead // New members of wxArrowHead
wxExpr *yOffsetExpr = node->Nth(6); wxExpr *yOffsetExpr = node->Item(6);
wxExpr *spacingExpr = node->Nth(7); wxExpr *spacingExpr = node->Item(7);
if (type_expr) if (type_expr)
arrowType = (int)type_expr->IntegerValue(); arrowType = (int)type_expr->IntegerValue();
@@ -1600,11 +1600,11 @@ void wxLineShape::Copy(wxShape& copy)
lineCopy.m_maintainStraightLines = m_maintainStraightLines; lineCopy.m_maintainStraightLines = m_maintainStraightLines;
lineCopy.m_lineOrientations.Clear(); lineCopy.m_lineOrientations.Clear();
wxNode *node = m_lineOrientations.First(); wxNode *node = m_lineOrientations.GetFirst();
while (node) while (node)
{ {
lineCopy.m_lineOrientations.Append(node->Data()); lineCopy.m_lineOrientations.Append(node->GetData());
node = node->Next(); node = node->GetNext();
} }
if (lineCopy.m_lineControlPoints) if (lineCopy.m_lineControlPoints)
@@ -1615,23 +1615,23 @@ void wxLineShape::Copy(wxShape& copy)
lineCopy.m_lineControlPoints = new wxList; lineCopy.m_lineControlPoints = new wxList;
node = m_lineControlPoints->First(); node = m_lineControlPoints->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
wxRealPoint *new_point = new wxRealPoint(point->x, point->y); wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
lineCopy.m_lineControlPoints->Append((wxObject*) new_point); lineCopy.m_lineControlPoints->Append((wxObject*) new_point);
node = node->Next(); node = node->GetNext();
} }
// Copy arrows // Copy arrows
lineCopy.ClearArrowsAtPosition(-1); lineCopy.ClearArrowsAtPosition(-1);
node = m_arcArrows.First(); node = m_arcArrows.GetFirst();
while (node) while (node)
{ {
wxArrowHead *arrow = (wxArrowHead *)node->Data(); wxArrowHead *arrow = (wxArrowHead *)node->GetData();
lineCopy.m_arcArrows.Append(new wxArrowHead(*arrow)); 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++) for (int i = 0; i < 3; i++)
{ {
wxNode *node = m_regions.Nth(i); wxNode *node = m_regions.Item(i);
if (node) if (node)
{ {
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->GetData();
if (region->m_formattedText.Number() > 0) if (region->m_formattedText.GetCount() > 0)
{ {
double w, h, x, y, xx, yy; double w, h, x, y, xx, yy;
region->GetSize(&w, &h); region->GetSize(&w, &h);
@@ -1874,8 +1874,8 @@ void wxLineShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, in
// Needed? // Needed?
#if 0 #if 0
int i = 0; int i = 0;
for (i = 0; i < lineShape->GetLineControlPoints()->Number(); i++) for (i = 0; i < lineShape->GetLineControlPoints()->GetCount(); i++)
if (((wxRealPoint *)(lineShape->GetLineControlPoints()->Nth(i)->Data())) == lpt->m_point) if (((wxRealPoint *)(lineShape->GetLineControlPoints()->Item(i)->GetData())) == lpt->m_point)
break; break;
// N.B. in OnMoveControlPoint, an event handler in Hardy could have deselected // 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; int i = 0;
for (i = 0; i < lineShape->GetLineControlPoints()->Number(); i++) for (i = 0; i < lineShape->GetLineControlPoints()->GetCount(); i++)
if (((wxRealPoint *)(lineShape->GetLineControlPoints()->Nth(i)->Data())) == m_point) if (((wxRealPoint *)(lineShape->GetLineControlPoints()->Item(i)->GetData())) == m_point)
break; break;
lineShape->OnMoveControlPoint(i+1, x, y); lineShape->OnMoveControlPoint(i+1, x, y);
if (!m_canvas->GetQuickEditMode()) m_canvas->Redraw(dc); 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) bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end)
{ {
wxNode *refNode = referenceList.First(); wxNode *refNode = referenceList.GetFirst();
wxNode *currNode = m_arcArrows.First(); wxNode *currNode = m_arcArrows.GetFirst();
wxString targetName(arrow->GetName()); wxString targetName(arrow->GetName());
if (!refNode) return FALSE; if (!refNode) return FALSE;
// First check whether we need to insert in front of list, // First check whether we need to insert in front of list,
// because this arrowhead is the first in the reference // because this arrowhead is the first in the reference
// list and should therefore be first in the current list. // list and should therefore be first in the current list.
wxArrowHead *refArrow = (wxArrowHead *)refNode->Data(); wxArrowHead *refArrow = (wxArrowHead *)refNode->GetData();
if (refArrow->GetName() == targetName) if (refArrow->GetName() == targetName)
{ {
m_arcArrows.Insert(arrow); m_arcArrows.Insert(arrow);
@@ -2040,16 +2040,16 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int
while (refNode && currNode) while (refNode && currNode)
{ {
wxArrowHead *currArrow = (wxArrowHead *)currNode->Data(); wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData();
refArrow = (wxArrowHead *)refNode->Data(); refArrow = (wxArrowHead *)refNode->GetData();
// Matching: advance current arrow pointer // Matching: advance current arrow pointer
if ((currArrow->GetArrowEnd() == end) && if ((currArrow->GetArrowEnd() == end) &&
(currArrow->GetName() == refArrow->GetName())) (currArrow->GetName() == refArrow->GetName()))
{ {
currNode = currNode->Next(); // Could be NULL now currNode = currNode->GetNext(); // Could be NULL now
if (currNode) if (currNode)
currArrow = (wxArrowHead *)currNode->Data(); currArrow = (wxArrowHead *)currNode->GetData();
} }
// Check if we're at the correct position in the // 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); m_arcArrows.Append(arrow);
return TRUE; return TRUE;
} }
refNode = refNode->Next(); refNode = refNode->GetNext();
} }
m_arcArrows.Append(arrow); m_arcArrows.Append(arrow);
return TRUE; return TRUE;
@@ -2070,11 +2070,11 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int
void wxLineShape::ClearArrowsAtPosition(int end) void wxLineShape::ClearArrowsAtPosition(int end)
{ {
wxNode *node = m_arcArrows.First(); wxNode *node = m_arcArrows.GetFirst();
while (node) while (node)
{ {
wxArrowHead *arrow = (wxArrowHead *)node->Data(); wxArrowHead *arrow = (wxArrowHead *)node->GetData();
wxNode *next = node->Next(); wxNode *next = node->GetNext();
switch (end) switch (end)
{ {
case -1: case -1:
@@ -2117,17 +2117,17 @@ void wxLineShape::ClearArrowsAtPosition(int end)
bool wxLineShape::ClearArrow(const wxString& name) bool wxLineShape::ClearArrow(const wxString& name)
{ {
wxNode *node = m_arcArrows.First(); wxNode *node = m_arcArrows.GetFirst();
while (node) while (node)
{ {
wxArrowHead *arrow = (wxArrowHead *)node->Data(); wxArrowHead *arrow = (wxArrowHead *)node->GetData();
if (arrow->GetName() == name) if (arrow->GetName() == name)
{ {
delete arrow; delete arrow;
delete node; delete node;
return TRUE; return TRUE;
} }
node = node->Next(); node = node->GetNext();
} }
return FALSE; return FALSE;
} }
@@ -2139,27 +2139,27 @@ bool wxLineShape::ClearArrow(const wxString& name)
wxArrowHead *wxLineShape::FindArrowHead(int position, const wxString& name) wxArrowHead *wxLineShape::FindArrowHead(int position, const wxString& name)
{ {
wxNode *node = m_arcArrows.First(); wxNode *node = m_arcArrows.GetFirst();
while (node) while (node)
{ {
wxArrowHead *arrow = (wxArrowHead *)node->Data(); wxArrowHead *arrow = (wxArrowHead *)node->GetData();
if (((position == -1) || (position == arrow->GetArrowEnd())) && if (((position == -1) || (position == arrow->GetArrowEnd())) &&
(arrow->GetName() == name)) (arrow->GetName() == name))
return arrow; return arrow;
node = node->Next(); node = node->GetNext();
} }
return NULL; return NULL;
} }
wxArrowHead *wxLineShape::FindArrowHead(long arrowId) wxArrowHead *wxLineShape::FindArrowHead(long arrowId)
{ {
wxNode *node = m_arcArrows.First(); wxNode *node = m_arcArrows.GetFirst();
while (node) while (node)
{ {
wxArrowHead *arrow = (wxArrowHead *)node->Data(); wxArrowHead *arrow = (wxArrowHead *)node->GetData();
if (arrowId == arrow->GetId()) if (arrowId == arrow->GetId())
return arrow; return arrow;
node = node->Next(); node = node->GetNext();
} }
return NULL; return NULL;
} }
@@ -2171,10 +2171,10 @@ wxArrowHead *wxLineShape::FindArrowHead(long arrowId)
bool wxLineShape::DeleteArrowHead(int position, const wxString& name) bool wxLineShape::DeleteArrowHead(int position, const wxString& name)
{ {
wxNode *node = m_arcArrows.First(); wxNode *node = m_arcArrows.GetFirst();
while (node) while (node)
{ {
wxArrowHead *arrow = (wxArrowHead *)node->Data(); wxArrowHead *arrow = (wxArrowHead *)node->GetData();
if (((position == -1) || (position == arrow->GetArrowEnd())) && if (((position == -1) || (position == arrow->GetArrowEnd())) &&
(arrow->GetName() == name)) (arrow->GetName() == name))
{ {
@@ -2182,7 +2182,7 @@ bool wxLineShape::DeleteArrowHead(int position, const wxString& name)
delete node; delete node;
return TRUE; return TRUE;
} }
node = node->Next(); node = node->GetNext();
} }
return FALSE; return FALSE;
} }
@@ -2190,17 +2190,17 @@ bool wxLineShape::DeleteArrowHead(int position, const wxString& name)
// Overloaded DeleteArrowHead: pass arrowhead id. // Overloaded DeleteArrowHead: pass arrowhead id.
bool wxLineShape::DeleteArrowHead(long id) bool wxLineShape::DeleteArrowHead(long id)
{ {
wxNode *node = m_arcArrows.First(); wxNode *node = m_arcArrows.GetFirst();
while (node) while (node)
{ {
wxArrowHead *arrow = (wxArrowHead *)node->Data(); wxArrowHead *arrow = (wxArrowHead *)node->GetData();
if (arrow->GetId() == id) if (arrow->GetId() == id)
{ {
delete arrow; delete arrow;
delete node; delete node;
return TRUE; return TRUE;
} }
node = node->Next(); node = node->GetNext();
} }
return FALSE; return FALSE;
} }
@@ -2214,15 +2214,15 @@ bool wxLineShape::DeleteArrowHead(long id)
double wxLineShape::FindMinimumWidth() double wxLineShape::FindMinimumWidth()
{ {
double minWidth = 0.0; double minWidth = 0.0;
wxNode *node = m_arcArrows.First(); wxNode *node = m_arcArrows.GetFirst();
while (node) while (node)
{ {
wxArrowHead *arrowHead = (wxArrowHead *)node->Data(); wxArrowHead *arrowHead = (wxArrowHead *)node->GetData();
minWidth += arrowHead->GetSize(); minWidth += arrowHead->GetSize();
if (node->Next()) if (node->GetNext())
minWidth += arrowHead->GetSpacing(); minWidth += arrowHead->GetSpacing();
node = node->Next(); node = node->GetNext();
} }
// We have ABSOLUTE minimum now. So // We have ABSOLUTE minimum now. So
// scale it to give it reasonable aesthetics // scale it to give it reasonable aesthetics
@@ -2319,7 +2319,7 @@ int wxLineShape::GetAlignmentType(bool isEnd)
wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject) wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject)
{ {
int n = m_lineControlPoints->Number(); int n = m_lineControlPoints->GetCount();
int nn = 0; int nn = 0;
if (m_to == nodeObject) if (m_to == nodeObject)
{ {
@@ -2328,10 +2328,10 @@ wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject)
nn = n - 2; nn = n - 2;
} }
else nn = 1; else nn = 1;
wxNode *node = m_lineControlPoints->Nth(nn); wxNode *node = m_lineControlPoints->Item(nn);
if (node) if (node)
{ {
return (wxRealPoint *)node->Data(); return (wxRealPoint *)node->GetData();
} }
else else
return FALSE; return FALSE;
@@ -2471,14 +2471,14 @@ bool wxLineShape::OnLabelMovePre(wxDC& dc, wxLabelShape* labelShape, double x, d
// Find position in line's region list // Find position in line's region list
int i = 0; int i = 0;
wxNode *node = GetRegions().First(); wxNode *node = GetRegions().GetFirst();
while (node) while (node)
{ {
if (labelShape->m_shapeRegion == (wxShapeRegion *)node->Data()) if (labelShape->m_shapeRegion == (wxShapeRegion *)node->GetData())
node = NULL; node = NULL;
else else
{ {
node = node->Next(); node = node->GetNext();
i ++; i ++;
} }
} }

View File

@@ -479,7 +479,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
metaRecords.Append(rec); metaRecords.Append(rec);
gdiObjects.Append(rec); gdiObjects.Append(rec);
AddMetaRecordHandle(rec); AddMetaRecordHandle(rec);
rec->param2 = (long)(gdiObjects.Number() - 1); rec->param2 = (long)(gdiObjects.GetCount() - 1);
break; break;
} }
// case META_STRETCHDIB: // case META_STRETCHDIB:
@@ -504,7 +504,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
metaRecords.Append(rec); metaRecords.Append(rec);
gdiObjects.Append(rec); gdiObjects.Append(rec);
AddMetaRecordHandle(rec); AddMetaRecordHandle(rec);
rec->param2 = (long)(gdiObjects.Number() - 1); rec->param2 = (long)(gdiObjects.GetCount() - 1);
break; break;
} }
case META_CREATEBRUSH: case META_CREATEBRUSH:
@@ -514,7 +514,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
metaRecords.Append(rec); metaRecords.Append(rec);
gdiObjects.Append(rec); gdiObjects.Append(rec);
AddMetaRecordHandle(rec); AddMetaRecordHandle(rec);
rec->param2 = (long)(gdiObjects.Number() - 1); rec->param2 = (long)(gdiObjects.GetCount() - 1);
break; break;
} }
case META_CREATEPATTERNBRUSH: case META_CREATEPATTERNBRUSH:
@@ -524,7 +524,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
metaRecords.Append(rec); metaRecords.Append(rec);
gdiObjects.Append(rec); gdiObjects.Append(rec);
AddMetaRecordHandle(rec); AddMetaRecordHandle(rec);
rec->param2 = (long)(gdiObjects.Number() - 1); rec->param2 = (long)(gdiObjects.GetCount() - 1);
break; break;
} }
case META_CREATEPENINDIRECT: case META_CREATEPENINDIRECT:
@@ -550,7 +550,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
gdiObjects.Append(rec); gdiObjects.Append(rec);
AddMetaRecordHandle(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!!! // For some reason, the size of this record is sometimes 9 words!!!
// instead of the usual 8. So read 2 characters extra. // instead of the usual 8. So read 2 characters extra.
@@ -622,7 +622,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
metaRecords.Append(rec); metaRecords.Append(rec);
gdiObjects.Append(rec); gdiObjects.Append(rec);
AddMetaRecordHandle(rec); AddMetaRecordHandle(rec);
rec->param2 = (long)(gdiObjects.Number() - 1); rec->param2 = (long)(gdiObjects.GetCount() - 1);
break; break;
} }
case META_CREATEBRUSHINDIRECT: case META_CREATEBRUSHINDIRECT:
@@ -679,7 +679,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
metaRecords.Append(rec); metaRecords.Append(rec);
gdiObjects.Append(rec); gdiObjects.Append(rec);
AddMetaRecordHandle(rec); AddMetaRecordHandle(rec);
rec->param2 = (long)(gdiObjects.Number() - 1); rec->param2 = (long)(gdiObjects.GetCount() - 1);
break; break;
} }
case META_CREATEBITMAPINDIRECT: case META_CREATEBITMAPINDIRECT:
@@ -690,7 +690,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
metaRecords.Append(rec); metaRecords.Append(rec);
gdiObjects.Append(rec); gdiObjects.Append(rec);
AddMetaRecordHandle(rec); AddMetaRecordHandle(rec);
rec->param2 = (long)(gdiObjects.Number() - 1); rec->param2 = (long)(gdiObjects.GetCount() - 1);
break; break;
} }
case META_CREATEBITMAP: case META_CREATEBITMAP:
@@ -701,7 +701,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
metaRecords.Append(rec); metaRecords.Append(rec);
gdiObjects.Append(rec); gdiObjects.Append(rec);
AddMetaRecordHandle(rec); AddMetaRecordHandle(rec);
rec->param2 = (long)(gdiObjects.Number() - 1); rec->param2 = (long)(gdiObjects.GetCount() - 1);
break; break;
} }
case META_CREATEREGION: case META_CREATEREGION:
@@ -712,7 +712,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
metaRecords.Append(rec); metaRecords.Append(rec);
gdiObjects.Append(rec); gdiObjects.Append(rec);
AddMetaRecordHandle(rec); AddMetaRecordHandle(rec);
rec->param2 = (long)(gdiObjects.Number() - 1); rec->param2 = (long)(gdiObjects.GetCount() - 1);
break; break;
} }
default: default:
@@ -728,12 +728,12 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
wxXMetaFile::~wxXMetaFile(void) wxXMetaFile::~wxXMetaFile(void)
{ {
wxNode *node = metaRecords.First(); wxNode *node = metaRecords.GetFirst();
while (node) while (node)
{ {
wxMetaRecord *rec = (wxMetaRecord *)node->Data(); wxMetaRecord *rec = (wxMetaRecord *)node->GetData();
delete rec; delete rec;
wxNode *next = node->Next(); wxNode *next = node->GetNext();
delete node; delete node;
node = next; node = next;
} }
@@ -746,10 +746,10 @@ bool wxXMetaFile::SetClipboard(int width, int height)
bool wxXMetaFile::Play(wxDC *dc) bool wxXMetaFile::Play(wxDC *dc)
{ {
wxNode *node = metaRecords.First(); wxNode *node = metaRecords.GetFirst();
while (node) while (node)
{ {
wxMetaRecord *rec = (wxMetaRecord *)node->Data(); wxMetaRecord *rec = (wxMetaRecord *)node->GetData();
int rdFunction = rec->metaFunction; int rdFunction = rec->metaFunction;
switch (rdFunction) switch (rdFunction)
@@ -1080,7 +1080,7 @@ bool wxXMetaFile::Play(wxDC *dc)
break; break;
} }
} }
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
} }

View File

@@ -172,7 +172,7 @@ void oglCentreText(wxDC& dc, wxList *text_list,
double m_xpos, double m_ypos, double width, double height, double m_xpos, double m_ypos, double width, double height,
int formatMode) int formatMode)
{ {
int n = text_list->Number(); int n = text_list->GetCount();
if (!text_list || (n == 0)) if (!text_list || (n == 0))
return; return;
@@ -186,17 +186,17 @@ void oglCentreText(wxDC& dc, wxList *text_list,
// Store text extents for speed // Store text extents for speed
double *widths = new double[n]; double *widths = new double[n];
wxNode *current = text_list->First(); wxNode *current = text_list->GetFirst();
int i = 0; int i = 0;
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.GetTextExtent(line->GetText(), &current_width, &char_height); dc.GetTextExtent(line->GetText(), &current_width, &char_height);
widths[i] = current_width; widths[i] = current_width;
if (current_width > max_width) if (current_width > max_width)
max_width = current_width; max_width = current_width;
current = current->Next(); current = current->GetNext();
i ++; i ++;
} }
@@ -229,12 +229,12 @@ void oglCentreText(wxDC& dc, wxList *text_list,
xOffset = 0.0; xOffset = 0.0;
} }
current = text_list->First(); current = text_list->GetFirst();
i = 0; i = 0;
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
double x; double x;
if ((formatMode & FORMAT_CENTRE_HORIZ) && (widths[i] < width)) 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); double y = (double)(i*char_height + yoffset);
line->SetX( x - xOffset ); line->SetY( y - yOffset ); line->SetX( x - xOffset ); line->SetY( y - yOffset );
current = current->Next(); current = current->GetNext();
i ++; i ++;
} }
@@ -255,7 +255,7 @@ void oglCentreText(wxDC& dc, wxList *text_list,
void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, void oglCentreTextNoClipping(wxDC& dc, wxList *text_list,
double m_xpos, double m_ypos, double width, double height) 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)) if (!text_list || (n == 0))
return; return;
@@ -269,17 +269,17 @@ void oglCentreTextNoClipping(wxDC& dc, wxList *text_list,
// Store text extents for speed // Store text extents for speed
double *widths = new double[n]; double *widths = new double[n];
wxNode *current = text_list->First(); wxNode *current = text_list->GetFirst();
int i = 0; int i = 0;
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.GetTextExtent(line->GetText(), &current_width, &char_height); dc.GetTextExtent(line->GetText(), &current_width, &char_height);
widths[i] = current_width; widths[i] = current_width;
if (current_width > max_width) if (current_width > max_width)
max_width = current_width; max_width = current_width;
current = current->Next(); current = current->GetNext();
i ++; i ++;
} }
@@ -289,18 +289,18 @@ void oglCentreTextNoClipping(wxDC& dc, wxList *text_list,
double xoffset = (double)(m_xpos - width/2.0); double xoffset = (double)(m_xpos - width/2.0);
current = text_list->First(); current = text_list->GetFirst();
i = 0; i = 0;
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
double x = (double)((width - widths[i])/2.0 + xoffset); double x = (double)((width - widths[i])/2.0 + xoffset);
double y = (double)(i*char_height + yoffset); double y = (double)(i*char_height + yoffset);
line->SetX( x - m_xpos ); line->SetY( y - m_ypos ); line->SetX( x - m_xpos ); line->SetY( y - m_ypos );
current = current->Next(); current = current->GetNext();
i ++; i ++;
} }
delete widths; delete widths;
@@ -310,7 +310,7 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list,
double m_xpos, double m_ypos, double width, double height, double m_xpos, double m_ypos, double width, double height,
double *actual_width, double *actual_height) double *actual_width, double *actual_height)
{ {
int n = text_list->Number(); int n = text_list->GetCount();
if (!text_list || (n == 0)) if (!text_list || (n == 0))
{ {
@@ -325,16 +325,16 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list,
long max_width = 0; long max_width = 0;
long current_width = 0; long current_width = 0;
wxNode *current = text_list->First(); wxNode *current = text_list->GetFirst();
int i = 0; int i = 0;
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.GetTextExtent(line->GetText(), &current_width, &char_height); dc.GetTextExtent(line->GetText(), &current_width, &char_height);
if (current_width > max_width) if (current_width > max_width)
max_width = current_width; max_width = current_width;
current = current->Next(); current = current->GetNext();
i ++; i ++;
} }
@@ -411,14 +411,14 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double
wxStringList *string_list = new wxStringList; wxStringList *string_list = new wxStringList;
wxString buffer; wxString buffer;
wxNode *node = word_list.First(); wxNode *node = (wxNode*)word_list.GetFirst();
long x, y; long x, y;
while (node) while (node)
{ {
wxString oldBuffer(buffer); wxString oldBuffer(buffer);
wxChar *s = (wxChar *)node->Data(); wxChar *s = (wxChar *)node->GetData();
if (!s) if (!s)
{ {
// FORCE NEW LINE // 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) if (buffer.Length() != 0)
string_list->Add(buffer); 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)(m_xpos - width/2.0), (long)(m_ypos - height/2.0),
(long)width, (long)height); (long)width, (long)height);
wxNode *current = text_list->First(); wxNode *current = text_list->GetFirst();
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.DrawText(line->GetText(), WXROUND(xoffset + line->GetX()), WXROUND(yoffset + line->GetY())); dc.DrawText(line->GetText(), WXROUND(xoffset + line->GetX()), WXROUND(yoffset + line->GetY()));
current = current->Next(); current = current->GetNext();
} }
dc.DestroyClippingRegion(); dc.DestroyClippingRegion();
@@ -496,17 +496,17 @@ void oglFindPolylineCentroid(wxList *points, double *x, double *y)
double xcount = 0; double xcount = 0;
double ycount = 0; double ycount = 0;
wxNode *node = points->First(); wxNode *node = points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
xcount += point->x; xcount += point->x;
ycount += point->y; ycount += point->y;
node = node->Next(); node = node->GetNext();
} }
*x = (xcount/points->Number()); *x = (xcount/points->GetCount());
*y = (ycount/points->Number()); *y = (ycount/points->GetCount());
} }
/* /*
@@ -774,12 +774,12 @@ void UpdateListBox(wxListBox *item, wxList *list)
if (!list) if (!list)
return; return;
wxNode *node = list->First(); wxNode *node = list->GetFirst();
while (node) while (node)
{ {
wxChar *s = (wxChar *)node->Data(); wxChar *s = (wxChar *)node->GetData();
item->Append(s); item->Append(s);
node = node->Next(); node = node->GetNext();
} }
} }

View File

@@ -87,15 +87,15 @@ void wxDiagram::Redraw(wxDC& dc)
{ {
if (GetCanvas()) if (GetCanvas())
GetCanvas()->SetCursor(* wxHOURGLASS_CURSOR); GetCanvas()->SetCursor(* wxHOURGLASS_CURSOR);
wxNode *current = m_shapeList->First(); wxNode *current = m_shapeList->GetFirst();
while (current) while (current)
{ {
wxShape *object = (wxShape *)current->Data(); wxShape *object = (wxShape *)current->GetData();
if (!object->GetParent()) if (!object->GetParent())
object->Draw(dc); object->Draw(dc);
current = current->Next(); current = current->GetNext();
} }
if (GetCanvas()) if (GetCanvas())
GetCanvas()->SetCursor(* wxSTANDARD_CURSOR); GetCanvas()->SetCursor(* wxSTANDARD_CURSOR);
@@ -118,8 +118,8 @@ void wxDiagram::AddShape(wxShape *object, wxShape *addAfter)
{ {
if (nodeAfter) if (nodeAfter)
{ {
if (nodeAfter->Next()) if (nodeAfter->GetNext())
m_shapeList->Insert(nodeAfter->Next(), object); m_shapeList->Insert(nodeAfter->GetNext(), object);
else else
m_shapeList->Append(object); m_shapeList->Append(object);
} }
@@ -148,31 +148,31 @@ void wxDiagram::RemoveAllShapes()
void wxDiagram::DeleteAllShapes() void wxDiagram::DeleteAllShapes()
{ {
wxNode *node = m_shapeList->First(); wxNode *node = m_shapeList->GetFirst();
while (node) while (node)
{ {
wxShape *shape = (wxShape *)node->Data(); wxShape *shape = (wxShape *)node->GetData();
if (!shape->GetParent()) if (!shape->GetParent())
{ {
RemoveShape(shape); RemoveShape(shape);
delete shape; delete shape;
node = m_shapeList->First(); node = m_shapeList->GetFirst();
} }
else else
node = node->Next(); node = node->GetNext();
} }
} }
void wxDiagram::ShowAll(bool show) void wxDiagram::ShowAll(bool show)
{ {
wxNode *current = m_shapeList->First(); wxNode *current = m_shapeList->GetFirst();
while (current) while (current)
{ {
wxShape *object = (wxShape *)current->Data(); wxShape *object = (wxShape *)current->GetData();
object->Show(show); 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. // Make sure all text that should be centred, is centred.
void wxDiagram::RecentreAll(wxDC& dc) void wxDiagram::RecentreAll(wxDC& dc)
{ {
wxNode *object_node = m_shapeList->First(); wxNode *object_node = m_shapeList->GetFirst();
while (object_node) while (object_node)
{ {
wxShape *obj = (wxShape *)object_node->Data(); wxShape *obj = (wxShape *)object_node->GetData();
obj->Recentre(dc); 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); database->Append(header);
wxNode *node = m_shapeList->First(); wxNode *node = m_shapeList->GetFirst();
while (node) while (node)
{ {
wxShape *shape = (wxShape *)node->Data(); wxShape *shape = (wxShape *)node->GetData();
if (!shape->IsKindOf(CLASSINFO(wxControlPoint))) if (!shape->IsKindOf(CLASSINFO(wxControlPoint)))
{ {
@@ -314,7 +314,7 @@ bool wxDiagram::LoadFile(const wxString& filename)
wxNode *node = database.First(); wxNode *node = database.First();
while (node) while (node)
{ {
wxExpr *clause = (wxExpr *)node->Data(); wxExpr *clause = (wxExpr *)node->GetData();
long id = -1; long id = -1;
clause->GetAttributeValue("id", id); clause->GetAttributeValue("id", id);
wxRegisterId(id); wxRegisterId(id);
@@ -453,7 +453,7 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database)
if (divisionExpr) if (divisionExpr)
{ {
int i = 0; int i = 0;
wxExpr *idExpr = divisionExpr->Nth(i); wxExpr *idExpr = divisionExpr->Item(i);
while (idExpr) while (idExpr)
{ {
long divisionId = idExpr->IntegerValue(); long divisionId = idExpr->IntegerValue();
@@ -510,7 +510,7 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database)
} }
} }
i ++; 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(); wxNode *node = shape.GetChildren().First();
while (node) while (node)
{ {
wxShape *childShape = (wxShape *)node->Data(); wxShape *childShape = (wxShape *)node->GetData();
wxExpr *childExpr = new wxExpr("shape"); wxExpr *childExpr = new wxExpr("shape");
OnShapeSave(db, *childShape, *childExpr); OnShapeSave(db, *childShape, *childExpr);
node = node->Next(); node = node->Next();
@@ -576,13 +576,13 @@ void wxDiagram::SetCanvas(wxShapeCanvas *can)
// Find a shape by its id // Find a shape by its id
wxShape* wxDiagram::FindShape(long id) const wxShape* wxDiagram::FindShape(long id) const
{ {
wxNode* node = GetShapeList()->First(); wxNode* node = GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
if (shape->GetId() == id) if (shape->GetId() == id)
return shape; return shape;
node = node->Next(); node = node->GetNext();
} }
return NULL; return NULL;
} }
@@ -602,27 +602,27 @@ wxLineCrossings::~wxLineCrossings()
void wxLineCrossings::FindCrossings(wxDiagram& diagram) void wxLineCrossings::FindCrossings(wxDiagram& diagram)
{ {
ClearCrossings(); ClearCrossings();
wxNode* node1 = diagram.GetShapeList()->First(); wxNode* node1 = diagram.GetShapeList()->GetFirst();
while (node1) while (node1)
{ {
wxShape* shape1 = (wxShape*) node1->Data(); wxShape* shape1 = (wxShape*) node1->GetData();
if (shape1->IsKindOf(CLASSINFO(wxLineShape))) if (shape1->IsKindOf(CLASSINFO(wxLineShape)))
{ {
wxLineShape* lineShape1 = (wxLineShape*) shape1; wxLineShape* lineShape1 = (wxLineShape*) shape1;
// Iterate through the segments // Iterate through the segments
wxList* pts1 = lineShape1->GetLineControlPoints(); wxList* pts1 = lineShape1->GetLineControlPoints();
int i; 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_a = (wxRealPoint*) (pts1->Item(i)->GetData());
wxRealPoint* pt1_b = (wxRealPoint*) (pts1->Nth(i+1)->Data()); wxRealPoint* pt1_b = (wxRealPoint*) (pts1->Item(i+1)->GetData());
// Now we iterate through the segments again // Now we iterate through the segments again
wxNode* node2 = diagram.GetShapeList()->First(); wxNode* node2 = diagram.GetShapeList()->GetFirst();
while (node2) while (node2)
{ {
wxShape* shape2 = (wxShape*) node2->Data(); wxShape* shape2 = (wxShape*) node2->GetData();
// Assume that the same line doesn't cross itself // Assume that the same line doesn't cross itself
if (shape2->IsKindOf(CLASSINFO(wxLineShape)) && (shape1 != shape2)) if (shape2->IsKindOf(CLASSINFO(wxLineShape)) && (shape1 != shape2))
@@ -631,10 +631,10 @@ void wxLineCrossings::FindCrossings(wxDiagram& diagram)
// Iterate through the segments // Iterate through the segments
wxList* pts2 = lineShape2->GetLineControlPoints(); wxList* pts2 = lineShape2->GetLineControlPoints();
int j; 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_a = (wxRealPoint*) (pts2->Item(j)->GetData());
wxRealPoint* pt2_b = (wxRealPoint*) (pts2->Nth(j+1)->Data()); wxRealPoint* pt2_b = (wxRealPoint*) (pts2->Item(j+1)->GetData());
// Now let's see if these two segments cross. // Now let's see if these two segments cross.
double ratio1, ratio2; 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; long arcWidth = 8;
wxNode* node = m_crossings.First(); wxNode* node = m_crossings.GetFirst();
while (node) 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), // dc.DrawEllipse((long) (crossing->m_intersect.x - (arcWidth/2.0) + 0.5), (long) (crossing->m_intersect.y - (arcWidth/2.0) + 0.5),
// arcWidth, arcWidth); // arcWidth, arcWidth);
@@ -731,18 +731,18 @@ void wxLineCrossings::DrawCrossings(wxDiagram& diagram, wxDC& dc)
dc.SetPen(*wxWHITE_PEN); dc.SetPen(*wxWHITE_PEN);
dc.DrawLine( (long) arcX1, (long) arcY1, (long) arcX2, (long) arcY2 ); dc.DrawLine( (long) arcX1, (long) arcY1, (long) arcX2, (long) arcY2 );
node = node->Next(); node = node->GetNext();
} }
} }
void wxLineCrossings::ClearCrossings() void wxLineCrossings::ClearCrossings()
{ {
wxNode* node = m_crossings.First(); wxNode* node = m_crossings.GetFirst();
while (node) while (node)
{ {
wxLineCrossing* crossing = (wxLineCrossing*) node->Data(); wxLineCrossing* crossing = (wxLineCrossing*) node->GetData();
delete crossing; delete crossing;
node = node->Next(); node = node->GetNext();
} }
m_crossings.Clear(); m_crossings.Clear();
} }

View File

@@ -205,7 +205,7 @@ void oglCentreText(wxDC& dc, wxList *text_list,
double m_xpos, double m_ypos, double width, double height, double m_xpos, double m_ypos, double width, double height,
int formatMode) int formatMode)
{ {
int n = text_list->Number(); int n = text_list->GetCount();
if (!text_list || (n == 0)) if (!text_list || (n == 0))
return; return;
@@ -219,11 +219,11 @@ void oglCentreText(wxDC& dc, wxList *text_list,
// Store text extents for speed // Store text extents for speed
double *widths = new double[n]; double *widths = new double[n];
wxNode *current = text_list->First(); wxNode *current = text_list->GetFirst();
int i = 0; int i = 0;
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.GetTextExtent(line->GetText(), &current_width, &char_height); dc.GetTextExtent(line->GetText(), &current_width, &char_height);
widths[i] = current_width; widths[i] = current_width;
@@ -262,12 +262,12 @@ void oglCentreText(wxDC& dc, wxList *text_list,
xOffset = 0.0; xOffset = 0.0;
} }
current = text_list->First(); current = text_list->GetFirst();
i = 0; i = 0;
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
double x; double x;
if ((formatMode & FORMAT_CENTRE_HORIZ) && (widths[i] < width)) 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, void oglCentreTextNoClipping(wxDC& dc, wxList *text_list,
double m_xpos, double m_ypos, double width, double height) 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)) if (!text_list || (n == 0))
return; return;
@@ -302,11 +302,11 @@ void oglCentreTextNoClipping(wxDC& dc, wxList *text_list,
// Store text extents for speed // Store text extents for speed
double *widths = new double[n]; double *widths = new double[n];
wxNode *current = text_list->First(); wxNode *current = text_list->GetFirst();
int i = 0; int i = 0;
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.GetTextExtent(line->GetText(), &current_width, &char_height); dc.GetTextExtent(line->GetText(), &current_width, &char_height);
widths[i] = current_width; widths[i] = current_width;
@@ -322,12 +322,12 @@ void oglCentreTextNoClipping(wxDC& dc, wxList *text_list,
double xoffset = (double)(m_xpos - width/2.0); double xoffset = (double)(m_xpos - width/2.0);
current = text_list->First(); current = text_list->GetFirst();
i = 0; i = 0;
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
double x = (double)((width - widths[i])/2.0 + xoffset); double x = (double)((width - widths[i])/2.0 + xoffset);
double y = (double)(i*char_height + yoffset); 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 m_xpos, double m_ypos, double width, double height,
double *actual_width, double *actual_height) double *actual_width, double *actual_height)
{ {
int n = text_list->Number(); int n = text_list->GetCount();
if (!text_list || (n == 0)) if (!text_list || (n == 0))
{ {
@@ -358,11 +358,11 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list,
long max_width = 0; long max_width = 0;
long current_width = 0; long current_width = 0;
wxNode *current = text_list->First(); wxNode *current = text_list->GetFirst();
int i = 0; int i = 0;
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.GetTextExtent(line->GetText(), &current_width, &char_height); dc.GetTextExtent(line->GetText(), &current_width, &char_height);
if (current_width > max_width) if (current_width > max_width)
@@ -452,7 +452,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double
{ {
wxString oldBuffer(buffer); wxString oldBuffer(buffer);
char *s = (char *)node->Data(); char *s = (char *)node->GetData();
if (!s) if (!s)
{ {
// FORCE NEW LINE // 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)(m_xpos - width/2.0), (long)(m_ypos - height/2.0),
(long)width, (long)height); (long)width, (long)height);
wxNode *current = text_list->First(); wxNode *current = text_list->GetFirst();
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.DrawText(line->GetText(), WXROUND(xoffset + line->GetX()), WXROUND(yoffset + line->GetY())); dc.DrawText(line->GetText(), WXROUND(xoffset + line->GetX()), WXROUND(yoffset + line->GetY()));
current = current->Next(); current = current->Next();
@@ -530,17 +530,17 @@ void oglFindPolylineCentroid(wxList *points, double *x, double *y)
double xcount = 0; double xcount = 0;
double ycount = 0; double ycount = 0;
wxNode *node = points->First(); wxNode *node = points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->GetData();
xcount += point->x; xcount += point->x;
ycount += point->y; ycount += point->y;
node = node->Next(); node = node->Next();
} }
*x = (xcount/points->Number()); *x = (xcount/points->GetCount());
*y = (ycount/points->Number()); *y = (ycount/points->GetCount());
} }
/* /*
@@ -808,10 +808,10 @@ void UpdateListBox(wxListBox *item, wxList *list)
if (!list) if (!list)
return; return;
wxNode *node = list->First(); wxNode *node = list->GetFirst();
while (node) while (node)
{ {
char *s = (char *)node->Data(); char *s = (char *)node->GetData();
item->Append(s); item->Append(s);
node = node->Next(); node = node->Next();
} }