virtual wxFont *GetFont(int regionId = 0) const;
virtual void SetTextColour(const wxString& colour, int regionId = 0);
virtual wxString GetTextColour(int regionId = 0) const;
- virtual inline int GetNumberOfTextRegions() const { return m_regions.Number(); }
+ virtual inline int GetNumberOfTextRegions() const { return m_regions.GetCount(); }
virtual void SetRegionName(const wxString& name, int regionId = 0);
// Get the name representing the region for this image alone.
inline wxList& GetOps() const { return (wxList&) m_ops; }
// Is this a valid (non-empty) metafile?
- inline bool IsValid() const { return (m_ops.Number() > 0); }
+ inline bool IsValid() const { return (m_ops.GetCount() > 0); }
public:
/// Set of functions for drawing into a pseudo metafile.
inline void SetMouseTolerance(int tol) { m_mouseTolerance = tol; }
inline int GetMouseTolerance() const { return m_mouseTolerance; }
inline wxList *GetShapeList() const { return m_shapeList; }
- inline int GetCount() const { return m_shapeList->Number(); }
+ inline int GetCount() const { return m_shapeList->GetCount(); }
// Make sure all text that should be centred, is centred.
void RecentreAll(wxDC& dc);
void wxSplitterScrolledWindow::OnSize(wxSizeEvent& event)
{
wxSize sz = GetClientSize();
- if (GetChildren().First())
+ if (GetChildren().GetFirst())
{
- ((wxWindow*) GetChildren().First()->Data())->SetSize(0, 0, sz.x, sz.y);
+ ((wxWindow*) GetChildren().GetFirst()->GetData())->SetSize(0, 0, sz.x, sz.y);
}
}
}
// Find targets in splitter window and send the event to them
- wxNode* node = GetChildren().First();
+ wxWindowListNode* node = GetChildren().GetFirst();
while (node)
{
- wxWindow* child = (wxWindow*) node->Data();
+ wxWindow* child = (wxWindow*) node->GetData();
if (child->IsKindOf(CLASSINFO(wxSplitterWindow)))
{
wxSplitterWindow* splitter = (wxSplitterWindow*) child;
splitter->GetWindow2()->ProcessEvent(event);
break;
}
- node = node->Next();
+ node = node->GetNext();
}
#ifdef __WXMAC__
m_highlighted = hi;
if (recurse)
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->SetHighlight(hi, recurse);
- node = node->Next();
+ node = node->GetNext();
}
}
}
m_sensitivity = sens;
if (recursive)
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *obj = (wxShape *)node->Data();
+ wxShape *obj = (wxShape *)node->GetData();
obj->SetSensitivityFilter(sens, TRUE);
- node = node->Next();
+ node = node->GetNext();
}
}
}
if (recursive)
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *obj = (wxShape *)node->Data();
+ wxShape *obj = (wxShape *)node->GetData();
obj->SetDraggable(drag, TRUE);
- node = node->Next();
+ node = node->GetNext();
}
}
}
void wxShape::SetDrawHandles(bool drawH)
{
m_drawHandles = drawH;
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *obj = (wxShape *)node->Data();
+ wxShape *obj = (wxShape *)node->GetData();
obj->SetDrawHandles(drawH);
- node = node->Next();
+ node = node->GetNext();
}
}
void wxShape::SetCanvas(wxShapeCanvas *theCanvas)
{
m_canvas = theCanvas;
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->SetCanvas(theCanvas);
- node = node->Next();
+ node = node->GetNext();
}
}
void wxShape::AddToCanvas(wxShapeCanvas *theCanvas, wxShape *addAfter)
{
theCanvas->AddShape(this, addAfter);
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
wxShape *lastImage = this;
while (node)
{
- wxShape *object = (wxShape *)node->Data();
+ wxShape *object = (wxShape *)node->GetData();
object->AddToCanvas(theCanvas, lastImage);
lastImage = object;
- node = node->Next();
+ node = node->GetNext();
}
}
void wxShape::InsertInCanvas(wxShapeCanvas *theCanvas)
{
theCanvas->InsertShape(this);
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
wxShape *lastImage = this;
while (node)
{
- wxShape *object = (wxShape *)node->Data();
+ wxShape *object = (wxShape *)node->GetData();
object->AddToCanvas(theCanvas, lastImage);
lastImage = object;
- node = node->Next();
+ node = node->GetNext();
}
}
if (Selected())
Select(FALSE);
theCanvas->RemoveShape(this);
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *object = (wxShape *)node->Data();
+ wxShape *object = (wxShape *)node->GetData();
object->RemoveFromCanvas(theCanvas);
- node = node->Next();
+ node = node->GetNext();
}
}
void wxShape::ClearAttachments()
{
- wxNode *node = m_attachmentPoints.First();
+ wxNode *node = m_attachmentPoints.GetFirst();
while (node)
{
- wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
delete point;
- node = node->Next();
+ node = node->GetNext();
}
m_attachmentPoints.Clear();
}
m_text.Clear();
m_text.DeleteContents(FALSE);
}
- wxNode *node = m_regions.Nth(regionId);
+ wxNode *node = m_regions.Item(regionId);
if (!node)
return;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
region->ClearText();
}
void wxShape::ClearRegions()
{
- wxNode *node = m_regions.First();
+ wxNode *node = m_regions.GetFirst();
while (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
- wxNode *next = node->Next();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
+ wxNode *next = node->GetNext();
delete region;
delete node;
node = next;
void wxShape::SetDefaultRegionSize()
{
- wxNode *node = m_regions.First();
+ wxNode *node = m_regions.GetFirst();
if (!node) return;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
double w, h;
GetBoundingBoxMin(&w, &h);
region->SetSize(w, h);
double w, h;
ClearText(i);
- if (m_regions.Number() < 1)
+ if (m_regions.GetCount() < 1)
return;
- wxNode *node = m_regions.Nth(i);
+ wxNode *node = m_regions.Item(i);
if (!node)
return;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
// region->SetText(s); // don't set the formatted text yet, it will be done below
region->m_regionText = s;
dc.SetFont(* region->GetFont());
region->GetSize(&w, &h);
wxStringList *stringList = oglFormatText(dc, s, (w-5), (h-5), region->GetFormatMode());
- node = stringList->First();
+ node = (wxNode*)stringList->GetFirst();
while (node)
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = (wxChar *)node->GetData();
wxShapeTextLine *line = new wxShapeTextLine(0.0, 0.0, s);
region->GetFormattedText().Append((wxObject *)line);
- node = node->Next();
+ node = node->GetNext();
}
delete stringList;
double actualW = w;
// Don't try to resize an object with more than one image (this case should be dealt
// with by overriden handlers)
if ((region->GetFormatMode() & FORMAT_SIZE_TO_CONTENTS) &&
- (region->GetFormattedText().Number() > 0) &&
- (m_regions.Number() == 1) && !GraphicsInSizeToContents)
+ (region->GetFormattedText().GetCount() > 0) &&
+ (m_regions.GetCount() == 1) && !GraphicsInSizeToContents)
{
oglGetCentredTextExtent(dc, &(region->GetFormattedText()), m_xpos, m_ypos, w, h, &actualW, &actualH);
if ((actualW+m_textMarginX != w ) || (actualH+m_textMarginY != h))
double w, h;
GetBoundingBoxMin(&w, &h);
- int noRegions = m_regions.Number();
+ int noRegions = m_regions.GetCount();
for (int i = 0; i < noRegions; i++)
{
- wxNode *node = m_regions.Nth(i);
+ wxNode *node = m_regions.Item(i);
if (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, w, h, region->GetFormatMode());
}
}
void wxShape::SetFont(wxFont *the_font, int regionId)
{
m_font = the_font;
- wxNode *node = m_regions.Nth(regionId);
+ wxNode *node = m_regions.Item(regionId);
if (!node)
return;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
region->SetFont(the_font);
}
wxFont *wxShape::GetFont(int n) const
{
- wxNode *node = m_regions.Nth(n);
+ wxNode *node = m_regions.Item(n);
if (!node)
return NULL;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
return region->GetFont();
}
void wxShape::SetFormatMode(int mode, int regionId)
{
- wxNode *node = m_regions.Nth(regionId);
+ wxNode *node = m_regions.Item(regionId);
if (!node)
return;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
region->SetFormatMode(mode);
}
int wxShape::GetFormatMode(int regionId) const
{
- wxNode *node = m_regions.Nth(regionId);
+ wxNode *node = m_regions.Item(regionId);
if (!node)
return 0;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
return region->GetFormatMode();
}
m_textColour = wxcolour;
m_textColourName = the_colour;
- wxNode *node = m_regions.Nth(regionId);
+ wxNode *node = m_regions.Item(regionId);
if (!node)
return;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
region->SetColour(the_colour);
}
wxString wxShape::GetTextColour(int regionId) const
{
- wxNode *node = m_regions.Nth(regionId);
+ wxNode *node = m_regions.Item(regionId);
if (!node)
return wxEmptyString;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
return region->GetColour();
}
void wxShape::SetRegionName(const wxString& name, int regionId)
{
- wxNode *node = m_regions.Nth(regionId);
+ wxNode *node = m_regions.Item(regionId);
if (!node)
return;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
region->SetName(name);
}
wxString wxShape::GetRegionName(int regionId)
{
- wxNode *node = m_regions.Nth(regionId);
+ wxNode *node = m_regions.Item(regionId);
if (!node)
return wxEmptyString;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
return region->GetName();
}
int wxShape::GetRegionId(const wxString& name)
{
- wxNode *node = m_regions.First();
+ wxNode *node = m_regions.GetFirst();
int i = 0;
while (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
if (region->GetName() == name)
return i;
- node = node->Next();
+ node = node->GetNext();
i ++;
}
return -1;
buff << i;
SetRegionName(buff, i);
}
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
int j = 0;
while (node)
{
buff.Empty();
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
if (parentName.Length() > 0)
buff << parentName << wxT(".") << j;
else
buff << j;
child->NameRegions(buff);
- node = node->Next();
+ node = node->GetNext();
j ++;
}
}
return this;
}
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
wxShape *actualImage = child->FindRegion(name, regionId);
if (actualImage)
return actualImage;
- node = node->Next();
+ node = node->GetNext();
}
return NULL;
}
list.Add(name);
}
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->FindRegionNames(list);
- node = node->Next();
+ node = node->GetNext();
}
}
{
// if (m_id == 0)
m_id = wxNewId();
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->AssignNewIds();
- node = node->Next();
+ node = node->GetNext();
}
}
// Want to set the ends of all attached links
// to point to/from this object
- wxNode *current = m_lines.First();
+ wxNode *current = m_lines.GetFirst();
while (current)
{
- wxLineShape *line = (wxLineShape *)current->Data();
+ wxLineShape *line = (wxLineShape *)current->GetData();
line->GetEventHandler()->OnMoveLink(dc);
- current = current->Next();
+ current = current->GetNext();
}
}
{
double bound_x, bound_y;
GetBoundingBoxMin(&bound_x, &bound_y);
- if (m_regions.Number() < 1) return;
+ if (m_regions.GetCount() < 1) return;
if (m_pen) dc.SetPen(* m_pen);
- wxShapeRegion *region = (wxShapeRegion *)m_regions.First()->Data();
+ wxShapeRegion *region = (wxShapeRegion *)m_regions.GetFirst()->GetData();
if (region->GetFont()) dc.SetFont(* region->GetFont());
dc.SetTextForeground(* (region->GetActualColourObject()));
return;
// Erase links
- wxNode *current = m_lines.First();
+ wxNode *current = m_lines.GetFirst();
while (current)
{
- wxLineShape *line = (wxLineShape *)current->Data();
+ wxLineShape *line = (wxLineShape *)current->GetData();
line->GetEventHandler()->OnErase(dc);
- current = current->Next();
+ current = current->GetNext();
}
GetEventHandler()->OnEraseContents(dc);
}
if (!m_visible)
return;
- wxNode *current = m_lines.First();
+ wxNode *current = m_lines.GetFirst();
while (current)
{
- wxLineShape *line = (wxLineShape *)current->Data();
+ wxLineShape *line = (wxLineShape *)current->GetData();
if (attachment == -1 || ((line->GetTo() == this && line->GetAttachmentTo() == attachment) ||
(line->GetFrom() == this && line->GetAttachmentFrom() == attachment)))
line->GetEventHandler()->OnErase(dc);
- current = current->Next();
+ current = current->GetNext();
}
if (recurse)
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->EraseLinks(dc, attachment, recurse);
- node = node->Next();
+ node = node->GetNext();
}
}
}
if (!m_visible)
return;
- wxNode *current = m_lines.First();
+ wxNode *current = m_lines.GetFirst();
while (current)
{
- wxLineShape *line = (wxLineShape *)current->Data();
+ wxLineShape *line = (wxLineShape *)current->GetData();
if (attachment == -1 ||
(line->GetTo() == this && line->GetAttachmentTo() == attachment) ||
(line->GetFrom() == this && line->GetAttachmentFrom() == attachment))
line->Draw(dc);
- current = current->Next();
+ current = current->GetNext();
}
if (recurse)
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->DrawLinks(dc, attachment, recurse);
- node = node->Next();
+ node = node->GetNext();
}
}
}
wxList newOrdering;
// First, add all links to the new list.
- wxNode *node = m_lines.First();
+ wxNode *node = m_lines.GetFirst();
while (node)
{
- newOrdering.Append(node->Data());
- node = node->Next();
+ newOrdering.Append(node->GetData());
+ node = node->GetNext();
}
// Delete the line object from the list of links; we're going to move
double old_x = (double) -99999.9;
double old_y = (double) -99999.9;
- node = newOrdering.First();
+ node = newOrdering.GetFirst();
bool found = FALSE;
while (!found && node)
{
- wxLineShape *line = (wxLineShape *)node->Data();
+ wxLineShape *line = (wxLineShape *)node->GetData();
if ((line->GetTo() == this && oldAttachment == line->GetAttachmentTo()) ||
(line->GetFrom() == this && oldAttachment == line->GetAttachmentFrom()))
{
old_x = xp;
old_y = yp;
}
- node = node->Next();
+ node = node->GetNext();
}
if (!found)
// This is a temporary store of all the lines.
wxList linesStore;
- wxNode *node = m_lines.First();
+ wxNode *node = m_lines.GetFirst();
while (node)
{
- wxLineShape *line = (wxLineShape *)node->Data();
+ wxLineShape *line = (wxLineShape *)node->GetData();
linesStore.Append(line);
- node = node->Next();;
+ node = node->GetNext();;
}
m_lines.Clear();
- node = linesToSort.First();
+ node = linesToSort.GetFirst();
while (node)
{
- wxLineShape *line = (wxLineShape *)node->Data();
+ wxLineShape *line = (wxLineShape *)node->GetData();
if (linesStore.Member(line))
{
// Done this one
linesStore.DeleteObject(line);
m_lines.Append(line);
}
- node = node->Next();
+ node = node->GetNext();
}
// Now add any lines that haven't been listed in linesToSort.
- node = linesStore.First();
+ node = linesStore.GetFirst();
while (node)
{
- wxLineShape *line = (wxLineShape *)node->Data();
+ wxLineShape *line = (wxLineShape *)node->GetData();
m_lines.Append(line);
- node = node->Next();
+ node = node->GetNext();
}
}
// point. We'll tick them off as we've processed them.
wxList linesAtThisAttachment;
- wxNode *node = m_lines.First();
+ wxNode *node = m_lines.GetFirst();
while (node)
{
- wxLineShape *line = (wxLineShape *)node->Data();
- wxNode *next = node->Next();
+ wxLineShape *line = (wxLineShape *)node->GetData();
+ wxNode *next = node->GetNext();
if ((line->GetTo() == this && line->GetAttachmentTo() == attachment) ||
(line->GetFrom() == this && line->GetAttachmentFrom() == attachment))
{
delete node;
node = next;
}
- else node = node->Next();
+ else node = node->GetNext();
}
- node = linesToSort.First();
+ node = linesToSort.GetFirst();
while (node)
{
- wxLineShape *line = (wxLineShape *)node->Data();
+ wxLineShape *line = (wxLineShape *)node->GetData();
if (linesAtThisAttachment.Member(line))
{
// Done this one
linesAtThisAttachment.DeleteObject(line);
m_lines.Append(line);
}
- node = node->Next();
+ node = node->GetNext();
}
// Now add any lines that haven't been listed in linesToSort.
- node = linesAtThisAttachment.First();
+ node = linesAtThisAttachment.GetFirst();
while (node)
{
- wxLineShape *line = (wxLineShape *)node->Data();
+ wxLineShape *line = (wxLineShape *)node->GetData();
m_lines.Append(line);
- node = node->Next();
+ node = node->GetNext();
}
}
void wxShape::Show(bool show)
{
m_visible = show;
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *image = (wxShape *)node->Data();
+ wxShape *image = (wxShape *)node->GetData();
image->Show(show);
- node = node->Next();
+ node = node->GetNext();
}
}
void wxShape::AddText(const wxString& string)
{
- wxNode *node = m_regions.First();
+ wxNode *node = m_regions.GetFirst();
if (!node)
return;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
region->ClearText();
wxShapeTextLine *new_line =
new wxShapeTextLine(0.0, 0.0, string);
scaleY = 1.0;
else scaleY = h/height;
- wxNode *node = m_attachmentPoints.First();
+ wxNode *node = m_attachmentPoints.GetFirst();
while (node)
{
- wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
point->m_x = (double)(point->m_x * scaleX);
point->m_y = (double)(point->m_y * scaleY);
- node = node->Next();
+ node = node->GetNext();
}
}
{
// Don't preserve old ordering if we have new ordering instructions
m_lines.DeleteObject(line);
- if (positionFrom < m_lines.Number())
+ if (positionFrom < m_lines.GetCount())
{
- wxNode* node = m_lines.Nth(positionFrom);
+ wxNode* node = m_lines.Item(positionFrom);
m_lines.Insert(node, line);
}
else
{
// Don't preserve old ordering if we have new ordering instructions
other->m_lines.DeleteObject(line);
- if (positionTo < other->m_lines.Number())
+ if (positionTo < other->m_lines.GetCount())
{
- wxNode* node = other->m_lines.Nth(positionTo);
+ wxNode* node = other->m_lines.Item(positionTo);
other->m_lines.Insert(node, line);
}
else
m_lines.Append(line);
else
{
- if (positionFrom < m_lines.Number())
+ if (positionFrom < m_lines.GetCount())
{
- wxNode* node = m_lines.Nth(positionFrom);
+ wxNode* node = m_lines.Item(positionFrom);
m_lines.Insert(node, line);
}
else
other->m_lines.Append(line);
else
{
- if (positionTo < other->m_lines.Number())
+ if (positionTo < other->m_lines.GetCount())
{
- wxNode* node = other->m_lines.Nth(positionTo);
+ wxNode* node = other->m_lines.Item(positionTo);
other->m_lines.Insert(node, line);
}
else
// Output line ids
- int n_lines = m_lines.Number();
+ int n_lines = m_lines.GetCount();
if (n_lines > 0)
{
wxExpr *list = new wxExpr(wxExprList);
- wxNode *node = m_lines.First();
+ wxNode *node = m_lines.GetFirst();
while (node)
{
- wxShape *line = (wxShape *)node->Data();
+ wxShape *line = (wxShape *)node->GetData();
wxExpr *id_expr = new wxExpr(line->GetId());
list->Append(id_expr);
- node = node->Next();
+ node = node->GetNext();
}
clause->AddAttributeValue("arcs", list);
}
}
// Write user-defined attachment points, if any
- if (m_attachmentPoints.Number() > 0)
+ if (m_attachmentPoints.GetCount() > 0)
{
wxExpr *attachmentList = new wxExpr(wxExprList);
- wxNode *node = m_attachmentPoints.First();
+ wxNode *node = m_attachmentPoints.GetFirst();
while (node)
{
- wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
wxExpr *pointExpr = new wxExpr(wxExprList);
pointExpr->Append(new wxExpr((long)point->m_id));
pointExpr->Append(new wxExpr(point->m_x));
pointExpr->Append(new wxExpr(point->m_y));
attachmentList->Append(pointExpr);
- node = node->Next();
+ node = node->GetNext();
}
clause->AddAttributeValue("user_attachments", attachmentList);
}
int regionNo = 1;
char regionNameBuf[20];
char textNameBuf[20];
- wxNode *node = m_regions.First();
+ wxNode *node = m_regions.GetFirst();
while (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
sprintf(regionNameBuf, "region%d", regionNo);
sprintf(textNameBuf, "text%d", regionNo);
// text1 = ((x y string) (x y string) ...)
wxExpr *textExpr = new wxExpr(wxExprList);
- wxNode *textNode = region->m_formattedText.First();
+ wxNode *textNode = region->m_formattedText.GetFirst();
while (textNode)
{
- wxShapeTextLine *line = (wxShapeTextLine *)textNode->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)textNode->GetData();
wxExpr *list2 = new wxExpr(wxExprList);
list2->Append(new wxExpr(line->GetX()));
list2->Append(new wxExpr(line->GetY()));
list2->Append(new wxExpr(wxExprString, line->GetText()));
textExpr->Append(list2);
- textNode = textNode->Next();
+ textNode = textNode->GetNext();
}
// Now add both attributes to the clause
clause->AddAttributeValue(regionNameBuf, regionExpr);
clause->AddAttributeValue(textNameBuf, textExpr);
- node = node->Next();
+ node = node->GetNext();
regionNo ++;
}
}
wxExpr *pointExpr = attachmentList->GetFirst();
while (pointExpr)
{
- wxExpr *idExpr = pointExpr->Nth(0);
- wxExpr *xExpr = pointExpr->Nth(1);
- wxExpr *yExpr = pointExpr->Nth(2);
+ wxExpr *idExpr = pointExpr->Item(0);
+ wxExpr *xExpr = pointExpr->Item(1);
+ wxExpr *yExpr = pointExpr->Item(2);
if (idExpr && xExpr && yExpr)
{
wxAttachmentPoint *point = new wxAttachmentPoint;
if (regionExpr->Type() == wxExprList)
{
- wxExpr *nameExpr = regionExpr->Nth(0);
- wxExpr *textExpr = regionExpr->Nth(1);
- wxExpr *xExpr = regionExpr->Nth(2);
- wxExpr *yExpr = regionExpr->Nth(3);
- wxExpr *widthExpr = regionExpr->Nth(4);
- wxExpr *heightExpr = regionExpr->Nth(5);
- wxExpr *minWidthExpr = regionExpr->Nth(6);
- wxExpr *minHeightExpr = regionExpr->Nth(7);
- wxExpr *propXExpr = regionExpr->Nth(8);
- wxExpr *propYExpr = regionExpr->Nth(9);
- wxExpr *formatExpr = regionExpr->Nth(10);
- wxExpr *sizeExpr = regionExpr->Nth(11);
- wxExpr *familyExpr = regionExpr->Nth(12);
- wxExpr *styleExpr = regionExpr->Nth(13);
- wxExpr *weightExpr = regionExpr->Nth(14);
- wxExpr *colourExpr = regionExpr->Nth(15);
- wxExpr *penColourExpr = regionExpr->Nth(16);
- wxExpr *penStyleExpr = regionExpr->Nth(17);
+ wxExpr *nameExpr = regionExpr->Item(0);
+ wxExpr *textExpr = regionExpr->Item(1);
+ wxExpr *xExpr = regionExpr->Item(2);
+ wxExpr *yExpr = regionExpr->Item(3);
+ wxExpr *widthExpr = regionExpr->Item(4);
+ wxExpr *heightExpr = regionExpr->Item(5);
+ wxExpr *minWidthExpr = regionExpr->Item(6);
+ wxExpr *minHeightExpr = regionExpr->Item(7);
+ wxExpr *propXExpr = regionExpr->Item(8);
+ wxExpr *propYExpr = regionExpr->Item(9);
+ wxExpr *formatExpr = regionExpr->Item(10);
+ wxExpr *sizeExpr = regionExpr->Item(11);
+ wxExpr *familyExpr = regionExpr->Item(12);
+ wxExpr *styleExpr = regionExpr->Item(13);
+ wxExpr *weightExpr = regionExpr->Item(14);
+ wxExpr *colourExpr = regionExpr->Item(15);
+ wxExpr *penColourExpr = regionExpr->Item(16);
+ wxExpr *penStyleExpr = regionExpr->Item(17);
regionName = nameExpr->StringValue();
regionText = textExpr->StringValue();
// Compatibility: check for no regions (old file).
// Lines and divided rectangles must deal with this compatibility
// theirselves. Composites _may_ not have any regions anyway.
- if ((m_regions.Number() == 0) &&
+ if ((m_regions.GetCount() == 0) &&
!this->IsKindOf(CLASSINFO(wxLineShape)) && !this->IsKindOf(CLASSINFO(wxDividedShape)) &&
!this->IsKindOf(CLASSINFO(wxCompositeShape)))
{
wxShapeRegion *newRegion = new wxShapeRegion;
newRegion->SetName("0");
m_regions.Append((wxObject *)newRegion);
- if (m_text.Number() > 0)
+ if (m_text.GetCount() > 0)
{
newRegion->ClearText();
- wxNode *node = m_text.First();
+ wxNode *node = m_text.GetFirst();
while (node)
{
- wxShapeTextLine *textLine = (wxShapeTextLine *)node->Data();
- wxNode *next = node->Next();
+ wxShapeTextLine *textLine = (wxShapeTextLine *)node->GetData();
+ wxNode *next = node->GetNext();
newRegion->GetFormattedText().Append((wxObject *)textLine);
delete node;
node = next;
// Copy text regions
copy.ClearRegions();
- wxNode *node = m_regions.First();
+ wxNode *node = m_regions.GetFirst();
while (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
wxShapeRegion *newRegion = new wxShapeRegion(*region);
copy.m_regions.Append(newRegion);
- node = node->Next();
+ node = node->GetNext();
}
// Copy attachments
copy.ClearAttachments();
- node = m_attachmentPoints.First();
+ node = m_attachmentPoints.GetFirst();
while (node)
{
- wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
wxAttachmentPoint *newPoint = new wxAttachmentPoint;
newPoint->m_id = point->m_id;
newPoint->m_x = point->m_x;
newPoint->m_y = point->m_y;
copy.m_attachmentPoints.Append((wxObject *)newPoint);
- node = node->Next();
+ node = node->GetNext();
}
// Copy lines
copy.m_lines.Clear();
- node = m_lines.First();
+ node = m_lines.GetFirst();
while (node)
{
- wxLineShape* line = (wxLineShape*) node->Data();
+ wxLineShape* line = (wxLineShape*) node->GetData();
copy.m_lines.Append(line);
- node = node->Next();
+ node = node->GetNext();
}
}
void wxShape::MakeMandatoryControlPoints()
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->MakeMandatoryControlPoints();
- node = node->Next();
+ node = node->GetNext();
}
}
void wxShape::ResetMandatoryControlPoints()
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->ResetMandatoryControlPoints();
- node = node->Next();
+ node = node->GetNext();
}
}
{
ResetMandatoryControlPoints();
- if (m_controlPoints.Number() < 1)
+ if (m_controlPoints.GetCount() < 1)
return;
double maxX, maxY, minX, minY;
double left = (double)(- (widthMin / 2.0));
double right = (double)(widthMin / 2.0 + (maxX - minX));
- wxNode *node = m_controlPoints.First();
- wxControlPoint *control = (wxControlPoint *)node->Data();
+ wxNode *node = m_controlPoints.GetFirst();
+ wxControlPoint *control = (wxControlPoint *)node->GetData();
control->m_xoffset = left; control->m_yoffset = top;
- node = node->Next(); control = (wxControlPoint *)node->Data();
+ node = node->GetNext(); control = (wxControlPoint *)node->GetData();
control->m_xoffset = 0; control->m_yoffset = top;
- node = node->Next(); control = (wxControlPoint *)node->Data();
+ node = node->GetNext(); control = (wxControlPoint *)node->GetData();
control->m_xoffset = right; control->m_yoffset = top;
- node = node->Next(); control = (wxControlPoint *)node->Data();
+ node = node->GetNext(); control = (wxControlPoint *)node->GetData();
control->m_xoffset = right; control->m_yoffset = 0;
- node = node->Next(); control = (wxControlPoint *)node->Data();
+ node = node->GetNext(); control = (wxControlPoint *)node->GetData();
control->m_xoffset = right; control->m_yoffset = bottom;
- node = node->Next(); control = (wxControlPoint *)node->Data();
+ node = node->GetNext(); control = (wxControlPoint *)node->GetData();
control->m_xoffset = 0; control->m_yoffset = bottom;
- node = node->Next(); control = (wxControlPoint *)node->Data();
+ node = node->GetNext(); control = (wxControlPoint *)node->GetData();
control->m_xoffset = left; control->m_yoffset = bottom;
- node = node->Next(); control = (wxControlPoint *)node->Data();
+ node = node->GetNext(); control = (wxControlPoint *)node->GetData();
control->m_xoffset = left; control->m_yoffset = 0;
}
void wxShape::DeleteControlPoints(wxDC *dc)
{
- wxNode *node = m_controlPoints.First();
+ wxNode *node = m_controlPoints.GetFirst();
while (node)
{
- wxControlPoint *control = (wxControlPoint *)node->Data();
+ wxControlPoint *control = (wxControlPoint *)node->GetData();
if (dc)
control->GetEventHandler()->OnErase(*dc);
m_canvas->RemoveShape(control);
delete control;
delete node;
- node = m_controlPoints.First();
+ node = m_controlPoints.GetFirst();
}
// Children of divisions are contained objects,
// so stop here
if (!IsKindOf(CLASSINFO(wxDivisionShape)))
{
- node = m_children.First();
+ node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->DeleteControlPoints(dc);
- node = node->Next();
+ node = node->GetNext();
}
}
}
dc.SetBrush(* wxBLACK_BRUSH);
dc.SetPen(* wxBLACK_PEN);
- wxNode *node = m_controlPoints.First();
+ wxNode *node = m_controlPoints.GetFirst();
while (node)
{
- wxControlPoint *control = (wxControlPoint *)node->Data();
+ wxControlPoint *control = (wxControlPoint *)node->GetData();
control->Draw(dc);
- node = node->Next();
+ node = node->GetNext();
}
// Children of divisions are contained objects,
// so stop here.
// (critical when drawing)
if (!IsKindOf(CLASSINFO(wxDivisionShape)))
{
- node = m_children.First();
+ node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->GetEventHandler()->OnDrawControlPoints(dc);
- node = node->Next();
+ node = node->GetNext();
}
}
}
void wxShape::OnEraseControlPoints(wxDC& dc)
{
- wxNode *node = m_controlPoints.First();
+ wxNode *node = m_controlPoints.GetFirst();
while (node)
{
- wxControlPoint *control = (wxControlPoint *)node->Data();
+ wxControlPoint *control = (wxControlPoint *)node->GetData();
control->Erase(dc);
- node = node->Next();
+ node = node->GetNext();
}
if (!IsKindOf(CLASSINFO(wxDivisionShape)))
{
- node = m_children.First();
+ node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->GetEventHandler()->OnEraseControlPoints(dc);
- node = node->Next();
+ node = node->GetNext();
}
}
}
// so stop here
if (!IsKindOf(CLASSINFO(wxDivisionShape)))
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->MakeMandatoryControlPoints();
- node = node->Next();
+ node = node->GetNext();
}
}
if (dc)
DeleteControlPoints(dc);
if (!IsKindOf(CLASSINFO(wxDivisionShape)))
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
child->DeleteControlPoints(dc);
- node = node->Next();
+ node = node->GetNext();
}
}
}
// Should return the MAXIMUM attachment point id here,
// so higher-level functions can iterate through all attachments,
// even if they're not contiguous.
- if (m_attachmentPoints.Number() == 0)
+ if (m_attachmentPoints.GetCount() == 0)
return 4;
else
{
int maxN = 3;
- wxNode *node = m_attachmentPoints.First();
+ wxNode *node = m_attachmentPoints.GetFirst();
while (node)
{
- wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
if (point->m_id > maxN)
maxN = point->m_id;
- node = node->Next();
+ node = node->GetNext();
}
return maxN+1;;
}
bool wxShape::AttachmentIsValid(int attachment) const
{
- if (m_attachmentPoints.Number() == 0)
+ if (m_attachmentPoints.GetCount() == 0)
{
return ((attachment >= 0) && (attachment < 4)) ;
}
- wxNode *node = m_attachmentPoints.First();
+ wxNode *node = m_attachmentPoints.GetFirst();
while (node)
{
- wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
if (point->m_id == attachment)
return TRUE;
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
}
}
else if (m_attachmentMode == ATTACHMENT_MODE_EDGE)
{
- if (m_attachmentPoints.Number() > 0)
+ if (m_attachmentPoints.GetCount() > 0)
{
- wxNode *node = m_attachmentPoints.First();
+ wxNode *node = m_attachmentPoints.GetFirst();
while (node)
{
- wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
if (point->m_id == attachment)
{
*x = (double)(m_xpos + point->m_x);
*y = (double)(m_ypos + point->m_y);
return TRUE;
}
- node = node->Next();
+ node = node->GetNext();
}
*x = m_xpos; *y = m_ypos;
return FALSE;
{
if (image == this)
return TRUE;
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
bool ans = child->HasDescendant(image);
if (ans)
return TRUE;
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
}
// Clears points from a list of wxRealPoints, and clears list
void wxShape::ClearPointList(wxList& list)
{
- wxNode* node = list.First();
+ wxNode* node = list.GetFirst();
while (node)
{
- wxRealPoint* pt = (wxRealPoint*) node->Data();
+ wxRealPoint* pt = (wxRealPoint*) node->GetData();
delete pt;
- node = node->Next();
+ node = node->GetNext();
}
list.Clear();
}
int wxShape::GetLinePosition(wxLineShape* line)
{
int i = 0;
- for (i = 0; i < m_lines.Number(); i++)
- if ((wxLineShape*) (m_lines.Nth(i)->Data()) == line)
+ for (i = 0; i < m_lines.GetCount(); i++)
+ if ((wxLineShape*) (m_lines.Item(i)->GetData()) == line)
return i;
return 0;
int wxShape::GetAttachmentLineCount(int attachment) const
{
int count = 0;
- wxNode* node = m_lines.First();
+ wxNode* node = m_lines.GetFirst();
while (node)
{
- wxLineShape* lineShape = (wxLineShape*) node->Data();
+ wxLineShape* lineShape = (wxLineShape*) node->GetData();
if ((lineShape->GetFrom() == this) && (lineShape->GetAttachmentFrom() == attachment))
count ++;
else if ((lineShape->GetTo() == this) && (lineShape->GetAttachmentTo() == attachment))
count ++;
- node = node->Next();
+ node = node->GetNext();
}
return count;
}
// Duplicate the list of points
m_points = new wxList;
- wxNode *node = the_points->First();
+ wxNode *node = the_points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
m_points->Append((wxObject*) new_point);
- node = node->Next();
+ node = node->GetNext();
}
CalculateBoundingBox();
m_originalWidth = m_boundWidth;
{
if (m_points)
{
- wxNode *node = m_points->First();
+ wxNode *node = m_points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
delete point;
delete node;
- node = m_points->First();
+ node = m_points->GetFirst();
}
delete m_points;
m_points = NULL;
}
if (m_originalPoints)
{
- wxNode *node = m_originalPoints->First();
+ wxNode *node = m_originalPoints->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
delete point;
delete node;
- node = m_originalPoints->First();
+ node = m_originalPoints->GetFirst();
}
delete m_originalPoints;
m_originalPoints = NULL;
double top = 10000;
double bottom = -10000;
- wxNode *node = m_points->First();
+ wxNode *node = m_points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
if (point->x < left) left = point->x;
if (point->x > right) right = point->x;
if (point->y < top) top = point->y;
if (point->y > bottom) bottom = point->y;
- node = node->Next();
+ node = node->GetNext();
}
m_boundWidth = right - left;
m_boundHeight = bottom - top;
double top = 10000;
double bottom = -10000;
- wxNode *node = m_points->First();
+ wxNode *node = m_points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
if (point->x < left) left = point->x;
if (point->x > right) right = point->x;
if (point->y < top) top = point->y;
if (point->y > bottom) bottom = point->y;
- node = node->Next();
+ node = node->GetNext();
}
double bwidth = right - left;
double bheight = bottom - top;
double newCentreX = (double)(left + (bwidth/2.0));
double newCentreY = (double)(top + (bheight/2.0));
- node = m_points->First();
+ node = m_points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
point->x -= newCentreX;
point->y -= newCentreY;
- node = node->Next();
+ node = node->GetNext();
}
m_xpos += newCentreX;
m_ypos += newCentreY;
endPointsY[3] = y;
// Store polygon points in an array
- int np = m_points->Number();
+ int np = m_points->GetCount();
double *xpoints = new double[np];
double *ypoints = new double[np];
- wxNode *node = m_points->First();
+ wxNode *node = m_points->GetFirst();
int i = 0;
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
xpoints[i] = point->x + m_xpos;
ypoints[i] = point->y + m_ypos;
- node = node->Next();
+ node = node->GetNext();
i ++;
}
double x_proportion = (double)(fabs(new_width/m_originalWidth));
double y_proportion = (double)(fabs(new_height/m_originalHeight));
- wxNode *node = m_points->First();
- wxNode *original_node = m_originalPoints->First();
+ wxNode *node = m_points->GetFirst();
+ wxNode *original_node = m_originalPoints->GetFirst();
while (node && original_node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
- wxRealPoint *original_point = (wxRealPoint *)original_node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
+ wxRealPoint *original_point = (wxRealPoint *)original_node->GetData();
point->x = (original_point->x * x_proportion);
point->y = (original_point->y * y_proportion);
- node = node->Next();
- original_node = original_node->Next();
+ node = node->GetNext();
+ original_node = original_node->GetNext();
}
// CalculateBoundingBox();
void wxPolygonShape::UpdateOriginalPoints()
{
if (!m_originalPoints) m_originalPoints = new wxList;
- wxNode *original_node = m_originalPoints->First();
+ wxNode *original_node = m_originalPoints->GetFirst();
while (original_node)
{
- wxNode *next_node = original_node->Next();
- wxRealPoint *original_point = (wxRealPoint *)original_node->Data();
+ wxNode *next_node = original_node->GetNext();
+ wxRealPoint *original_point = (wxRealPoint *)original_node->GetData();
delete original_point;
delete original_node;
original_node = next_node;
}
- wxNode *node = m_points->First();
+ wxNode *node = m_points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
wxRealPoint *original_point = new wxRealPoint(point->x, point->y);
m_originalPoints->Append((wxObject*) original_point);
- node = node->Next();
+ node = node->GetNext();
}
CalculateBoundingBox();
m_originalWidth = m_boundWidth;
void wxPolygonShape::AddPolygonPoint(int pos)
{
- wxNode *node = m_points->Nth(pos);
- if (!node) node = m_points->First();
- wxRealPoint *firstPoint = (wxRealPoint *)node->Data();
+ wxNode *node = m_points->Item(pos);
+ if (!node) node = m_points->GetFirst();
+ wxRealPoint *firstPoint = (wxRealPoint *)node->GetData();
- wxNode *node2 = m_points->Nth(pos + 1);
- if (!node2) node2 = m_points->First();
- wxRealPoint *secondPoint = (wxRealPoint *)node2->Data();
+ wxNode *node2 = m_points->Item(pos + 1);
+ if (!node2) node2 = m_points->GetFirst();
+ wxRealPoint *secondPoint = (wxRealPoint *)node2->GetData();
double x = (double)((secondPoint->x - firstPoint->x)/2.0 + firstPoint->x);
double y = (double)((secondPoint->y - firstPoint->y)/2.0 + firstPoint->y);
wxRealPoint *point = new wxRealPoint(x, y);
- if (pos >= (m_points->Number() - 1))
+ if (pos >= (m_points->GetCount() - 1))
m_points->Append((wxObject*) point);
else
m_points->Insert(node2, (wxObject*) point);
void wxPolygonShape::DeletePolygonPoint(int pos)
{
- wxNode *node = m_points->Nth(pos);
+ wxNode *node = m_points->Item(pos);
if (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
delete point;
delete node;
UpdateOriginalPoints();
double x2, double y2,
double *x3, double *y3)
{
- int n = m_points->Number();
+ int n = m_points->GetCount();
// First check for situation where the line is vertical,
// and we would want to connect to a point on that vertical --
{
// Look for the point we'd be connecting to. This is
// a heuristic...
- wxNode *node = m_points->First();
+ wxNode *node = m_points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
if (point->x == 0.0)
{
if ((y2 > y1) && (point->y > 0.0))
return TRUE;
}
}
- node = node->Next();
+ node = node->GetNext();
}
}
double *xpoints = new double[n];
double *ypoints = new double[n];
- wxNode *node = m_points->First();
+ wxNode *node = m_points->GetFirst();
int i = 0;
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
xpoints[i] = point->x + m_xpos;
ypoints[i] = point->y + m_ypos;
- node = node->Next();
+ node = node->GetNext();
i ++;
}
void wxPolygonShape::OnDraw(wxDC& dc)
{
- int n = m_points->Number();
+ int n = m_points->GetCount();
wxPoint *intPoints = new wxPoint[n];
int i;
for (i = 0; i < n; i++)
{
- wxRealPoint* point = (wxRealPoint*) m_points->Nth(i)->Data();
+ wxRealPoint* point = (wxRealPoint*) m_points->Item(i)->GetData();
intPoints[i].x = WXROUND(point->x);
intPoints[i].y = WXROUND(point->y);
}
double x_proportion = (double)(fabs(w/m_originalWidth));
double y_proportion = (double)(fabs(h/m_originalHeight));
- int n = m_originalPoints->Number();
+ int n = m_originalPoints->GetCount();
wxPoint *intPoints = new wxPoint[n];
int i;
for (i = 0; i < n; i++)
{
- wxRealPoint* point = (wxRealPoint*) m_originalPoints->Nth(i)->Data();
+ wxRealPoint* point = (wxRealPoint*) m_originalPoints->Item(i)->GetData();
intPoints[i].x = WXROUND(x_proportion * point->x);
intPoints[i].y = WXROUND(y_proportion * point->y);
}
// Make as many control points as there are vertices.
void wxPolygonShape::MakeControlPoints()
{
- wxNode *node = m_points->First();
+ wxNode *node = m_points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
wxPolygonControlPoint *control = new wxPolygonControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
point, point->x, point->y);
m_canvas->AddShape(control);
m_controlPoints.Append(control);
- node = node->Next();
+ node = node->GetNext();
}
}
void wxPolygonShape::ResetControlPoints()
{
- wxNode *node = m_points->First();
- wxNode *controlPointNode = m_controlPoints.First();
+ wxNode *node = m_points->GetFirst();
+ wxNode *controlPointNode = m_controlPoints.GetFirst();
while (node && controlPointNode)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
- wxPolygonControlPoint *controlPoint = (wxPolygonControlPoint *)controlPointNode->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
+ wxPolygonControlPoint *controlPoint = (wxPolygonControlPoint *)controlPointNode->GetData();
controlPoint->m_xoffset = point->x;
controlPoint->m_yoffset = point->y;
controlPoint->m_polygonVertex = point;
- node = node->Next();
- controlPointNode = controlPointNode->Next();
+ node = node->GetNext();
+ controlPointNode = controlPointNode->GetNext();
}
}
// Make a list of lists for the coordinates
wxExpr *list = new wxExpr(wxExprList);
- wxNode *node = m_points->First();
+ wxNode *node = m_points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
wxExpr *point_list = new wxExpr(wxExprList);
wxExpr *x_expr = new wxExpr((double)point->x);
wxExpr *y_expr = new wxExpr((double)point->y);
point_list->Append(y_expr);
list->Append(point_list);
- node = node->Next();
+ node = node->GetNext();
}
clause->AddAttributeValue(wxT("points"), list);
// Save the original (unscaled) points
list = new wxExpr(wxExprList);
- node = m_originalPoints->First();
+ node = m_originalPoints->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
wxExpr *point_list = new wxExpr(wxExprList);
wxExpr *x_expr = new wxExpr((double) point->x);
wxExpr *y_expr = new wxExpr((double) point->y);
point_list->Append(y_expr);
list->Append(point_list);
- node = node->Next();
+ node = node->GetNext();
}
clause->AddAttributeValue(wxT("m_originalPoints"), list);
}
polyCopy.m_points = new wxList;
polyCopy.m_originalPoints = new wxList;
- wxNode *node = m_points->First();
+ wxNode *node = m_points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
polyCopy.m_points->Append((wxObject*) new_point);
- node = node->Next();
+ node = node->GetNext();
}
- node = m_originalPoints->First();
+ node = m_originalPoints->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
polyCopy.m_originalPoints->Append((wxObject*) new_point);
- node = node->Next();
+ node = node->GetNext();
}
polyCopy.m_boundWidth = m_boundWidth;
polyCopy.m_boundHeight = m_boundHeight;
int wxPolygonShape::GetNumberOfAttachments() const
{
- int maxN = (m_points ? (m_points->Number() - 1) : 0);
- wxNode *node = m_attachmentPoints.First();
+ int maxN = (m_points ? (m_points->GetCount() - 1) : 0);
+ wxNode *node = m_attachmentPoints.GetFirst();
while (node)
{
- wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
if (point->m_id > maxN)
maxN = point->m_id;
- node = node->Next();
+ node = node->GetNext();
}
return maxN+1;;
}
bool wxPolygonShape::GetAttachmentPosition(int attachment, double *x, double *y,
int nth, int no_arcs, wxLineShape *line)
{
- if ((m_attachmentMode == ATTACHMENT_MODE_EDGE) && m_points && attachment < m_points->Number())
+ if ((m_attachmentMode == ATTACHMENT_MODE_EDGE) && m_points && attachment < m_points->GetCount())
{
- wxRealPoint *point = (wxRealPoint *)m_points->Nth(attachment)->Data();
+ wxRealPoint *point = (wxRealPoint *)m_points->Item(attachment)->GetData();
*x = point->x + m_xpos;
*y = point->y + m_ypos;
return TRUE;
if (!m_points)
return FALSE;
- if ((attachment >= 0) && (attachment < m_points->Number()))
+ if ((attachment >= 0) && (attachment < m_points->GetCount()))
return TRUE;
- wxNode *node = m_attachmentPoints.First();
+ wxNode *node = m_attachmentPoints.GetFirst();
while (node)
{
- wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
if (point->m_id == attachment)
return TRUE;
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
}
// Rotate attachment points
double sinTheta = (double)sin(actualTheta);
double cosTheta = (double)cos(actualTheta);
- wxNode *node = m_attachmentPoints.First();
+ wxNode *node = m_attachmentPoints.GetFirst();
while (node)
{
- wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
double x1 = point->m_x;
double y1 = point->m_y;
point->m_x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta;
point->m_y = x1*sinTheta + y1*cosTheta + y*(1.0 - cosTheta) + x*sinTheta;
- node = node->Next();
+ node = node->GetNext();
}
- node = m_points->First();
+ node = m_points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
double x1 = point->x;
double y1 = point->y;
point->x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta;
point->y = x1*sinTheta + y1*cosTheta + y*(1.0 - cosTheta) + x*sinTheta;
- node = node->Next();
+ node = node->GetNext();
}
- node = m_originalPoints->First();
+ node = m_originalPoints->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
double x1 = point->x;
double y1 = point->y;
point->x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta;
point->y = x1*sinTheta + y1*cosTheta + y*(1.0 - cosTheta) + x*sinTheta;
- node = node->Next();
+ node = node->GetNext();
}
m_rotation = theta;
clause->AssignAttributeValue(wxT("corner"), &m_cornerRadius);
// In case we're reading an old file, set the region's size
- if (m_regions.Number() == 1)
+ if (m_regions.GetCount() == 1)
{
- wxShapeRegion *region = (wxShapeRegion *)m_regions.First()->Data();
+ wxShapeRegion *region = (wxShapeRegion *)m_regions.GetFirst()->GetData();
region->SetSize(m_width, m_height);
}
}
clause->AssignAttributeValue(wxT("height"), &m_height);
// In case we're reading an old file, set the region's size
- if (m_regions.Number() == 1)
+ if (m_regions.GetCount() == 1)
{
- wxShapeRegion *region = (wxShapeRegion *)m_regions.First()->Data();
+ wxShapeRegion *region = (wxShapeRegion *)m_regions.GetFirst()->GetData();
region->SetSize(m_width, m_height);
}
}
*/
// Recursively redraw links if we have a composite.
- if (theObject->GetChildren().Number() > 0)
+ if (theObject->GetChildren().GetCount() > 0)
theObject->DrawLinks(dc, -1, TRUE);
double width, height;
m_penColour = region.m_penColour;
ClearText();
- wxNode *node = region.m_formattedText.First();
+ wxNode *node = region.m_formattedText.GetFirst();
while (node)
{
- wxShapeTextLine *line = (wxShapeTextLine *)node->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)node->GetData();
wxShapeTextLine *new_line =
new wxShapeTextLine(line->GetX(), line->GetY(), line->GetText());
m_formattedText.Append(new_line);
- node = node->Next();
+ node = node->GetNext();
}
}
void wxShapeRegion::ClearText()
{
- wxNode *node = m_formattedText.First();
+ wxNode *node = m_formattedText.GetFirst();
while (node)
{
- wxShapeTextLine *line = (wxShapeTextLine *)node->Data();
- wxNode *next = node->Next();
+ wxShapeTextLine *line = (wxShapeTextLine *)node->GetData();
+ wxNode *next = node->GetNext();
delete line;
delete node;
node = next;
// the other objects
// (b) to find the control points FIRST if they exist
- wxNode *current = GetDiagram()->GetShapeList()->Last();
+ wxNode *current = GetDiagram()->GetShapeList()->GetLast();
while (current)
{
- wxShape *object = (wxShape *)current->Data();
+ wxShape *object = (wxShape *)current->GetData();
double dist;
int temp_attachment;
}
}
if (current)
- current = current->Previous();
+ current = current->GetPrevious();
}
- current = GetDiagram()->GetShapeList()->Last();
+ current = GetDiagram()->GetShapeList()->GetLast();
while (current)
{
- wxShape *object = (wxShape *)current->Data();
+ wxShape *object = (wxShape *)current->GetData();
double dist;
int temp_attachment;
}
}
if (current)
- current = current->Previous();
+ current = current->GetPrevious();
}
*attachment = nearest_attachment;
wxCompositeShape::~wxCompositeShape()
{
- wxNode *node = m_constraints.First();
+ wxNode *node = m_constraints.GetFirst();
while (node)
{
- wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
+ wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
delete constraint;
- node = node->Next();
+ node = node->GetNext();
}
- node = m_children.First();
+ node = m_children.GetFirst();
while (node)
{
- wxShape *object = (wxShape *)node->Data();
- wxNode *next = node->Next();
+ wxShape *object = (wxShape *)node->GetData();
+ wxNode *next = node->GetNext();
object->Unlink();
delete object;
node = next;
void wxCompositeShape::OnDrawContents(wxDC& dc)
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *object = (wxShape *)node->Data();
+ wxShape *object = (wxShape *)node->GetData();
object->Draw(dc);
object->DrawLinks(dc);
- node = node->Next();
+ node = node->GetNext();
}
wxShape::OnDrawContents(dc);
}
{
double diffX = x - oldx;
double diffY = y - oldy;
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *object = (wxShape *)node->Data();
+ wxShape *object = (wxShape *)node->GetData();
object->Erase(dc);
object->Move(dc, object->GetX() + diffX, object->GetY() + diffY, display);
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}
void wxCompositeShape::OnErase(wxDC& dc)
{
wxRectangleShape::OnErase(dc);
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *object = (wxShape *)node->Data();
+ wxShape *object = (wxShape *)node->GetData();
object->Erase(dc);
- node = node->Next();
+ node = node->GetNext();
}
}
// the division, so we can invoke a user interface for dealing with regions.
if (keys & KEY_CTRL)
{
- wxNode *node = m_divisions.First();
+ wxNode *node = m_divisions.GetFirst();
while (node)
{
- wxDivisionShape *division = (wxDivisionShape *)node->Data();
- wxNode *next = node->Next();
+ wxDivisionShape *division = (wxDivisionShape *)node->GetData();
+ wxNode *next = node->GetNext();
int attach = 0;
double dist = 0.0;
if (division->HitTest(x, y, &attach, &dist))
if (!recursive) return;
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc);
double xBound, yBound;
while (node)
{
- wxShape *object = (wxShape *)node->Data();
+ wxShape *object = (wxShape *)node->GetData();
// Scale the position first
double newX = (double)(((object->GetX() - GetX())*xScale) + GetX());
object->SetSize(object->GetFixedWidth() ? xBound : xScale*xBound,
object->GetFixedHeight() ? yBound : yScale*yBound);
- node = node->Next();
+ node = node->GetNext();
}
SetDefaultRegionSize();
}
void wxCompositeShape::DeleteConstraintsInvolvingChild(wxShape *child)
{
- wxNode *node = m_constraints.First();
+ wxNode *node = m_constraints.GetFirst();
while (node)
{
- wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
- wxNode *nextNode = node->Next();
+ wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
+ wxNode *nextNode = node->GetNext();
if ((constraint->m_constrainingObject == child) ||
constraint->m_constrainedObjects.Member(child))
void wxCompositeShape::RemoveChildFromConstraints(wxShape *child)
{
- wxNode *node = m_constraints.First();
+ wxNode *node = m_constraints.GetFirst();
while (node)
{
- wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
- wxNode *nextNode = node->Next();
+ wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
+ wxNode *nextNode = node->GetNext();
if (constraint->m_constrainedObjects.Member(child))
constraint->m_constrainedObjects.DeleteObject(child);
oglObjectCopyMapping.Append((long)this, &compositeCopy);
// Copy the children
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *object = (wxShape *)node->Data();
+ wxShape *object = (wxShape *)node->GetData();
wxShape *newObject = object->CreateNewCopy(FALSE, FALSE);
if (newObject->GetId() == 0)
newObject->SetId(wxNewId());
oglObjectCopyMapping.Append((long)object, newObject);
- node = node->Next();
+ node = node->GetNext();
}
// Copy the constraints
- node = m_constraints.First();
+ node = m_constraints.GetFirst();
while (node)
{
- wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
+ wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
- wxShape *newConstraining = (wxShape *)(oglObjectCopyMapping.Find((long)constraint->m_constrainingObject)->Data());
+ wxShape *newConstraining = (wxShape *)(oglObjectCopyMapping.Find((long)constraint->m_constrainingObject)->GetData());
wxList newConstrainedList;
- wxNode *node2 = constraint->m_constrainedObjects.First();
+ wxNode *node2 = constraint->m_constrainedObjects.GetFirst();
while (node2)
{
- wxShape *constrainedObject = (wxShape *)node2->Data();
- wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->Data());
+ wxShape *constrainedObject = (wxShape *)node2->GetData();
+ wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->GetData());
newConstrainedList.Append(newConstrained);
- node2 = node2->Next();
+ node2 = node2->GetNext();
}
wxOGLConstraint *newConstraint = new wxOGLConstraint(constraint->m_constraintType, newConstraining,
newConstraint->SetSpacing(constraint->m_xSpacing, constraint->m_ySpacing);
compositeCopy.m_constraints.Append(newConstraint);
- node = node->Next();
+ node = node->GetNext();
}
// Now compositeCopy the division geometry
- node = m_divisions.First();
+ node = m_divisions.GetFirst();
while (node)
{
- wxDivisionShape *division = (wxDivisionShape *)node->Data();
+ wxDivisionShape *division = (wxDivisionShape *)node->GetData();
wxNode *node1 = oglObjectCopyMapping.Find((long)division);
wxNode *leftNode = NULL;
wxNode *topNode = NULL;
bottomNode = oglObjectCopyMapping.Find((long)division->GetBottomSide());
if (node1)
{
- wxDivisionShape *newDivision = (wxDivisionShape *)node1->Data();
+ wxDivisionShape *newDivision = (wxDivisionShape *)node1->GetData();
if (leftNode)
- newDivision->SetLeftSide((wxDivisionShape *)leftNode->Data());
+ newDivision->SetLeftSide((wxDivisionShape *)leftNode->GetData());
if (topNode)
- newDivision->SetTopSide((wxDivisionShape *)topNode->Data());
+ newDivision->SetTopSide((wxDivisionShape *)topNode->GetData());
if (rightNode)
- newDivision->SetRightSide((wxDivisionShape *)rightNode->Data());
+ newDivision->SetRightSide((wxDivisionShape *)rightNode->GetData());
if (bottomNode)
- newDivision->SetBottomSide((wxDivisionShape *)bottomNode->Data());
+ newDivision->SetBottomSide((wxDivisionShape *)bottomNode->GetData());
}
- node = node->Next();
+ node = node->GetNext();
}
}
wxOGLConstraint *wxCompositeShape::FindConstraint(long cId, wxCompositeShape **actualComposite)
{
- wxNode *node = m_constraints.First();
+ wxNode *node = m_constraints.GetFirst();
while (node)
{
- wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
+ wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
if (constraint->m_constraintId == cId)
{
if (actualComposite)
*actualComposite = this;
return constraint;
}
- node = node->Next();
+ node = node->GetNext();
}
// If not found, try children.
- node = m_children.First();
+ node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
if (child->IsKindOf(CLASSINFO(wxCompositeShape)))
{
wxOGLConstraint *constraint = ((wxCompositeShape *)child)->FindConstraint(cId, actualComposite);
return constraint;
}
}
- node = node->Next();
+ node = node->GetNext();
}
return NULL;
}
double minY = (double) 999999.9;
double w, h;
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *object = (wxShape *)node->Data();
+ wxShape *object = (wxShape *)node->GetData();
// Recalculate size of composite objects because may not conform
// to size it was set to - depends on the children.
if ((object->GetY() - (h/2.0)) < minY)
minY = (double)(object->GetY() - (h/2.0));
- node = node->Next();
+ node = node->GetNext();
}
m_width = maxX - minX;
m_height = maxY - minY;
CalculateSize();
bool changed = FALSE;
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *object = (wxShape *)node->Data();
+ wxShape *object = (wxShape *)node->GetData();
if (object->Constrain())
changed = TRUE;
- node = node->Next();
+ node = node->GetNext();
}
- node = m_constraints.First();
+ node = m_constraints.GetFirst();
while (node)
{
- wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
+ wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
if (constraint->Evaluate()) changed = TRUE;
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
// Output constraints as constraint1 = (...), constraint2 = (...), etc.
int constraintNo = 1;
char m_constraintNameBuf[20];
- wxNode *node = m_constraints.First();
+ wxNode *node = m_constraints.GetFirst();
while (node)
{
- wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
+ wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
sprintf(m_constraintNameBuf, "constraint%d", constraintNo);
// Each constraint is stored in the form
constraintExpr->Append(new wxExpr(constraint->m_constrainingObject->GetId()));
wxExpr *objectList = new wxExpr(wxExprList);
- wxNode *node1 = constraint->m_constrainedObjects.First();
+ wxNode *node1 = constraint->m_constrainedObjects.GetFirst();
while (node1)
{
- wxShape *obj = (wxShape *)node1->Data();
+ wxShape *obj = (wxShape *)node1->GetData();
objectList->Append(new wxExpr(obj->GetId()));
- node1 = node1->Next();
+ node1 = node1->GetNext();
}
constraintExpr->Append(objectList);
clause->AddAttributeValue(m_constraintNameBuf, constraintExpr);
- node = node->Next();
+ node = node->GetNext();
constraintNo ++;
}
// Write the ids of all the child images
wxExpr *childrenExpr = new wxExpr(wxExprList);
- node = m_children.First();
+ node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
childrenExpr->Append(new wxExpr(child->GetId()));
- node = node->Next();
+ node = node->GetNext();
}
clause->AddAttributeValue("children", childrenExpr);
// Write the ids of all the division images
- if (m_divisions.Number() > 0)
+ if (m_divisions.GetCount() > 0)
{
wxExpr *divisionsExpr = new wxExpr(wxExprList);
- node = m_divisions.First();
+ node = m_divisions.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
divisionsExpr->Append(new wxExpr(child->GetId()));
- node = node->Next();
+ node = node->GetNext();
}
clause->AddAttributeValue("divisions", divisionsExpr);
}
// Each constraint is stored in the form
// (type name id xspacing yspacing m_constrainingObjectId constrainedObjectIdList)
- wxExpr *typeExpr = constraintExpr->Nth(0);
- wxExpr *nameExpr = constraintExpr->Nth(1);
- wxExpr *idExpr = constraintExpr->Nth(2);
- wxExpr *xExpr = constraintExpr->Nth(3);
- wxExpr *yExpr = constraintExpr->Nth(4);
- wxExpr *constrainingExpr = constraintExpr->Nth(5);
- wxExpr *constrainedExpr = constraintExpr->Nth(6);
+ wxExpr *typeExpr = constraintExpr->Item(0);
+ wxExpr *nameExpr = constraintExpr->Item(1);
+ wxExpr *idExpr = constraintExpr->Item(2);
+ wxExpr *xExpr = constraintExpr->Item(3);
+ wxExpr *yExpr = constraintExpr->Item(4);
+ wxExpr *constrainingExpr = constraintExpr->Item(5);
+ wxExpr *constrainedExpr = constraintExpr->Item(6);
cType = (int)typeExpr->IntegerValue();
cXSpacing = xExpr->RealValue();
wxLogFatalError(wxT("Object graphics error: Couldn't find constraining image of composite."));
int i = 0;
- wxExpr *currentIdExpr = constrainedExpr->Nth(i);
+ wxExpr *currentIdExpr = constrainedExpr->Item(i);
while (currentIdExpr)
{
long currentId = currentIdExpr->IntegerValue();
}
i ++;
- currentIdExpr = constrainedExpr->Nth(i);
+ currentIdExpr = constrainedExpr->Item(i);
}
wxOGLConstraint *newConstraint = AddConstraint(cType, m_constrainingObject, m_constrainedObjects);
newConstraint->SetSpacing(cXSpacing, cYSpacing);
wxShape *wxCompositeShape::FindContainerImage()
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
if (!m_divisions.Member(child))
return child;
- node = node->Next();
+ node = node->GetNext();
}
return NULL;
}
{
if (m_divisions.Member(division))
return TRUE;
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *child = (wxShape *)node->Data();
+ wxShape *child = (wxShape *)node->GetData();
if (child->IsKindOf(CLASSINFO(wxCompositeShape)))
{
bool ans = ((wxCompositeShape *)child)->ContainsDivision(division);
if (ans)
return TRUE;
}
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
}
{
double diffX = x - oldx;
double diffY = y - oldy;
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxShape *object = (wxShape *)node->Data();
+ wxShape *object = (wxShape *)node->GetData();
object->Erase(dc);
object->Move(dc, object->GetX() + diffX, object->GetY() + diffY, display);
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}
// Anything adjoining the bottom of this division now adjoins the
// bottom of the new division.
- wxNode *node = compositeParent->GetDivisions().First();
+ wxNode *node = compositeParent->GetDivisions().GetFirst();
while (node)
{
- wxDivisionShape *obj = (wxDivisionShape *)node->Data();
+ wxDivisionShape *obj = (wxDivisionShape *)node->GetData();
if (obj->GetTopSide() == this)
obj->SetTopSide(newDivision);
- node = node->Next();
+ node = node->GetNext();
}
newDivision->SetTopSide(this);
newDivision->SetBottomSide(m_bottomSide);
// Anything adjoining the left of this division now adjoins the
// left of the new division.
- wxNode *node = compositeParent->GetDivisions().First();
+ wxNode *node = compositeParent->GetDivisions().GetFirst();
while (node)
{
- wxDivisionShape *obj = (wxDivisionShape *)node->Data();
+ wxDivisionShape *obj = (wxDivisionShape *)node->GetData();
if (obj->GetLeftSide() == this)
obj->SetLeftSide(newDivision);
- node = node->Next();
+ node = node->GetNext();
}
newDivision->SetTopSide(m_topSide);
newDivision->SetBottomSide(m_bottomSide);
void wxDivisionShape::ResetMandatoryControlPoints()
{
- if (m_controlPoints.Number() < 1)
+ if (m_controlPoints.GetCount() < 1)
return;
double maxX, maxY;
GetBoundingBoxMax(&maxX, &maxY);
/*
- wxNode *node = m_controlPoints.First();
+ wxNode *node = m_controlPoints.GetFirst();
while (node)
{
- wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->Data();
+ wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->GetData();
if (control->type == CONTROL_POINT_HORIZONTAL)
{
control->xoffset = (double)(-maxX/2.0); control->m_yoffset = 0.0;
{
control->xoffset = 0.0; control->m_yoffset = (double)(-maxY/2.0);
}
- node = node->Next();
+ node = node->GetNext();
}
*/
- wxNode *node = m_controlPoints.First();
+ wxNode *node = m_controlPoints.GetFirst();
if ((m_handleSide == DIVISION_SIDE_LEFT) && node)
{
- wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->Data();
+ wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->GetData();
control->m_xoffset = (double)(-maxX/2.0); control->m_yoffset = 0.0;
}
if ((m_handleSide == DIVISION_SIDE_TOP) && node)
{
- wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->Data();
+ wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->GetData();
control->m_xoffset = 0.0; control->m_yoffset = (double)(-maxY/2.0);
}
if ((m_handleSide == DIVISION_SIDE_RIGHT) && node)
{
- wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->Data();
+ wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->GetData();
control->m_xoffset = (double)(maxX/2.0); control->m_yoffset = 0.0;
}
if ((m_handleSide == DIVISION_SIDE_BOTTOM) && node)
{
- wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->Data();
+ wxDivisionControlPoint *control = (wxDivisionControlPoint *)node->GetData();
control->m_xoffset = 0.0; control->m_yoffset = (double)(maxY/2.0);
}
}
bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test)
{
wxCompositeShape *divisionParent = (wxCompositeShape *)GetParent();
- wxNode *node = divisionParent->GetDivisions().First();
+ wxNode *node = divisionParent->GetDivisions().GetFirst();
while (node)
{
- wxDivisionShape *division = (wxDivisionShape *)node->Data();
+ wxDivisionShape *division = (wxDivisionShape *)node->GetData();
switch (side)
{
case DIVISION_SIDE_LEFT:
default:
break;
}
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
if (!wxOGLConstraintTypes)
return;
- wxNode* node = wxOGLConstraintTypes->First();
+ wxNode* node = wxOGLConstraintTypes->GetFirst();
while (node)
{
- wxOGLConstraintType* ct = (wxOGLConstraintType*) node->Data();
+ wxOGLConstraintType* ct = (wxOGLConstraintType*) node->GetData();
delete ct;
- node = node->Next();
+ node = node->GetNext();
}
delete wxOGLConstraintTypes;
wxOGLConstraintTypes = NULL;
m_constraintId = 0;
m_constraintName = wxT("noname");
- wxNode *node = constrained.First();
+ wxNode *node = constrained.GetFirst();
while (node)
{
- m_constrainedObjects.Append(node->Data());
- node = node->Next();
+ m_constrainedObjects.Append(node->GetData());
+ node = node->GetNext();
}
}
{
case gyCONSTRAINT_CENTRED_VERTICALLY:
{
- int n = m_constrainedObjects.Number();
+ int n = m_constrainedObjects.GetCount();
double totalObjectHeight = 0.0;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
totalObjectHeight += height2;
- node = node->Next();
+ node = node->GetNext();
}
double startY;
double spacingY;
// Now position the objects
bool changed = FALSE;
- node = m_constrainedObjects.First();
+ node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
startY += (double)(spacingY + (height2/2.0));
changed = TRUE;
}
startY += (double)(height2/2.0);
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
case gyCONSTRAINT_CENTRED_HORIZONTALLY:
{
- int n = m_constrainedObjects.Number();
+ int n = m_constrainedObjects.GetCount();
double totalObjectWidth = 0.0;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
totalObjectWidth += width2;
- node = node->Next();
+ node = node->GetNext();
}
double startX;
double spacingX;
// Now position the objects
bool changed = FALSE;
- node = m_constrainedObjects.First();
+ node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
startX += (double)(spacingX + (width2/2.0));
changed = TRUE;
}
startX += (double)(width2/2.0);
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
case gyCONSTRAINT_CENTRED_BOTH:
{
- int n = m_constrainedObjects.Number();
+ int n = m_constrainedObjects.GetCount();
double totalObjectWidth = 0.0;
double totalObjectHeight = 0.0;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
totalObjectWidth += width2;
totalObjectHeight += height2;
- node = node->Next();
+ node = node->GetNext();
}
double startX;
double spacingX;
// Now position the objects
bool changed = FALSE;
- node = m_constrainedObjects.First();
+ node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
startX += (double)(spacingX + (width2/2.0));
startX += (double)(width2/2.0);
startY += (double)(height2/2.0);
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
{
bool changed = FALSE;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
}
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
{
bool changed = FALSE;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
}
- node = node->Next();
+ node = node->GetNext();
}
return changed;
{
bool changed = FALSE;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
}
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
{
bool changed = FALSE;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
}
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
{
bool changed = FALSE;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
}
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
{
bool changed = FALSE;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
}
- node = node->Next();
+ node = node->GetNext();
}
return changed;
{
bool changed = FALSE;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
}
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
{
bool changed = FALSE;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double width2, height2;
constrainedObject->GetBoundingBoxMax(&width2, &height2);
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
}
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
{
bool changed = FALSE;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double x3 = (double)(x - (minWidth/2.0));
if (!Equals(x3, constrainedObject->GetX()))
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
}
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
{
bool changed = FALSE;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double x3 = (double)(x + (minWidth/2.0));
if (!Equals(x3, constrainedObject->GetX()))
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
}
- node = node->Next();
+ node = node->GetNext();
}
return changed;
{
bool changed = FALSE;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double y3 = (double)(y - (minHeight/2.0));
if (!Equals(y3, constrainedObject->GetY()))
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
}
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
{
bool changed = FALSE;
- wxNode *node = m_constrainedObjects.First();
+ wxNode *node = m_constrainedObjects.GetFirst();
while (node)
{
- wxShape *constrainedObject = (wxShape *)node->Data();
+ wxShape *constrainedObject = (wxShape *)node->GetData();
double y3 = (double)(y + (minHeight/2.0));
if (!Equals(y3, constrainedObject->GetY()))
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
}
- node = node->Next();
+ node = node->GetNext();
}
return changed;
}
void wxDividedShape::OnDrawContents(wxDC& dc)
{
- double defaultProportion = (double)(GetRegions().Number() > 0 ? (1.0/((double)(GetRegions().Number()))) : 0.0);
+ double defaultProportion = (double)(GetRegions().GetCount() > 0 ? (1.0/((double)(GetRegions().GetCount()))) : 0.0);
double currentY = (double)(m_ypos - (m_height / 2.0));
double maxY = (double)(m_ypos + (m_height / 2.0));
double yMargin = 2;
dc.SetBackgroundMode(wxTRANSPARENT);
- wxNode *node = GetRegions().First();
+ wxNode *node = GetRegions().GetFirst();
while (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
dc.SetFont(* region->GetFont());
dc.SetTextForeground(* region->GetActualColourObject());
oglDrawFormattedText(dc, ®ion->m_formattedText,
(double)(centreX), (double)(centreY), (double)(m_width-2*xMargin), (double)(actualY - currentY - 2*yMargin),
region->m_formatMode);
- if ((y <= maxY) && (node->Next()))
+ if ((y <= maxY) && (node->GetNext()))
{
wxPen *regionPen = region->GetActualPen();
if (regionPen)
currentY = actualY;
- node = node->Next();
+ node = node->GetNext();
}
}
void wxDividedShape::SetRegionSizes()
{
- if (GetRegions().Number() == 0)
+ if (GetRegions().GetCount() == 0)
return;
- double defaultProportion = (double)(GetRegions().Number() > 0 ? (1.0/((double)(GetRegions().Number()))) : 0.0);
+ double defaultProportion = (double)(GetRegions().GetCount() > 0 ? (1.0/((double)(GetRegions().GetCount()))) : 0.0);
double currentY = (double)(m_ypos - (m_height / 2.0));
double maxY = (double)(m_ypos + (m_height / 2.0));
// double leftX = (double)(m_xpos - (m_width / 2.0));
// double rightX = (double)(m_xpos + (m_width / 2.0));
- wxNode *node = GetRegions().First();
+ wxNode *node = GetRegions().GetFirst();
while (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
double proportion =
region->m_regionProportionY <= 0.0 ? defaultProportion : region->m_regionProportionY;
region->SetSize(m_width, sizeY);
region->SetPosition(0.0, (double)(centreY - m_ypos));
currentY = actualY;
- node = node->Next();
+ node = node->GetNext();
}
}
bool wxDividedShape::GetAttachmentPosition(int attachment, double *x, double *y, int nth, int no_arcs,
wxLineShape *line)
{
- int totalNumberAttachments = (GetRegions().Number() * 2) + 2;
+ int totalNumberAttachments = (GetRegions().GetCount() * 2) + 2;
if ((GetAttachmentMode() == ATTACHMENT_MODE_NONE) || (attachment >= totalNumberAttachments))
{
return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs);
}
- int n = GetRegions().Number();
+ int n = GetRegions().GetCount();
bool isEnd = (line && line->IsEnd(this));
double left = (double)(m_xpos - m_width/2.0);
i = (totalNumberAttachments - attachment - 1);
isLeft = TRUE;
}
- wxNode *node = GetRegions().Nth(i);
+ wxNode *node = GetRegions().Item(i);
if (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
if (isLeft)
*x = left;
{
// There are two attachments for each region (left and right),
// plus one on the top and one on the bottom.
- int n = (GetRegions().Number() * 2) + 2;
+ int n = (GetRegions().GetCount() * 2) + 2;
int maxN = n - 1;
- wxNode *node = m_attachmentPoints.First();
+ wxNode *node = m_attachmentPoints.GetFirst();
while (node)
{
- wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
if (point->m_id > maxN)
maxN = point->m_id;
- node = node->Next();
+ node = node->GetNext();
}
return maxN + 1;
}
bool wxDividedShape::AttachmentIsValid(int attachment)
{
- int totalNumberAttachments = (GetRegions().Number() * 2) + 2;
+ int totalNumberAttachments = (GetRegions().GetCount() * 2) + 2;
if (attachment >= totalNumberAttachments)
{
return wxShape::AttachmentIsValid(attachment);
double currentY = (double)(GetY() - (m_height / 2.0));
double maxY = (double)(GetY() + (m_height / 2.0));
- wxNode *node = GetRegions().First();
+ wxNode *node = GetRegions().GetFirst();
int i = 0;
while (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
double proportion = region->m_regionProportionY;
double y = currentY + m_height*proportion;
double actualY = (double)(maxY < y ? maxY : y);
- if (node->Next())
+ if (node->GetNext())
{
wxDividedShapeControlPoint *controlPoint =
new wxDividedShapeControlPoint(m_canvas, this, i, CONTROL_POINT_SIZE, 0.0, (double)(actualY - GetY()), 0);
}
currentY = actualY;
i ++;
- node = node->Next();
+ node = node->GetNext();
}
}
void wxDividedShape::ResetControlPoints()
{
// May only have the region handles, (n - 1) of them.
- if (m_controlPoints.Number() > (GetRegions().Number() - 1))
+ if (m_controlPoints.GetCount() > (GetRegions().GetCount() - 1))
wxRectangleShape::ResetControlPoints();
ResetMandatoryControlPoints();
double currentY = (double)(GetY() - (m_height / 2.0));
double maxY = (double)(GetY() + (m_height / 2.0));
- wxNode *node = m_controlPoints.First();
+ wxNode *node = m_controlPoints.GetFirst();
int i = 0;
while (node)
{
- wxControlPoint *controlPoint = (wxControlPoint *)node->Data();
+ wxControlPoint *controlPoint = (wxControlPoint *)node->GetData();
if (controlPoint->IsKindOf(CLASSINFO(wxDividedShapeControlPoint)))
{
- wxNode *node1 = GetRegions().Nth(i);
- wxShapeRegion *region = (wxShapeRegion *)node1->Data();
+ wxNode *node1 = GetRegions().Item(i);
+ wxShapeRegion *region = (wxShapeRegion *)node1->GetData();
double proportion = region->m_regionProportionY;
currentY = actualY;
i ++;
}
- node = node->Next();
+ node = node->GetNext();
}
}
// TODO
#if 0
- if (GetRegions().Number() < 2)
+ if (GetRegions().GetCount() < 2)
return;
wxBeginBusyCursor();
GraphicsForm *form = new GraphicsForm("Divided nodes");
// Need an array to store all the style strings,
// since they need to be converted to integers
- char **styleStrings = new char *[GetRegions().Number()];
- for (int j = 0; j < GetRegions().Number(); j++)
+ char **styleStrings = new char *[GetRegions().GetCount()];
+ for (int j = 0; j < GetRegions().GetCount(); j++)
styleStrings[j] = NULL;
int i = 0;
- wxNode *node = GetRegions().First();
- while (node && node->Next())
+ wxNode *node = GetRegions().GetFirst();
+ while (node && node->GetNext())
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
char buf[50];
sprintf(buf, "Region %d", (i+1));
form->Add(wxMakeFormMessage(buf));
"Dot Dash" ,
NULL),
NULL), NULL, wxVERTICAL, 100));
- node = node->Next();
+ node = node->GetNext();
i ++;
- if (node && node->Next())
+ if (node && node->GetNext())
form->Add(wxMakeFormNewLine());
}
wxDialogBox *dialog = new wxDialogBox(m_canvas->GetParent(), "Divided object properties", 10, 10, 500, 500);
dialog->Show(TRUE);
- node = GetRegions().First();
+ node = GetRegions().GetFirst();
i = 0;
while (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
if (styleStrings[i])
{
delete[] styleStrings[i];
}
region->m_actualPenObject = NULL;
- node = node->Next();
+ node = node->GetNext();
i ++;
}
delete[] styleStrings;
GetCanvas()->PrepareDC(dc);
wxDividedShape *dividedObject = (wxDividedShape *)m_shape;
- wxNode *node = dividedObject->GetRegions().Nth(regionId);
+ wxNode *node = dividedObject->GetRegions().Item(regionId);
if (!node)
return;
- wxShapeRegion *thisRegion = (wxShapeRegion *)node->Data();
+ wxShapeRegion *thisRegion = (wxShapeRegion *)node->GetData();
wxShapeRegion *nextRegion = NULL; // Region below this one
dc.SetLogicalFunction(wxCOPY);
double thisRegionBottom = 0.0;
double nextRegionBottom = 0.0;
- node = dividedObject->GetRegions().First();
+ node = dividedObject->GetRegions().GetFirst();
while (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
double proportion = region->m_regionProportionY;
double yy = currentY + (dividedObject->GetHeight()*proportion);
{
thisRegionTop = currentY;
thisRegionBottom = actualY;
- if (node->Next())
- nextRegion = (wxShapeRegion *)node->Next()->Data();
+ if (node->GetNext())
+ nextRegion = (wxShapeRegion *)node->GetNext()->GetData();
}
if (region == nextRegion)
{
}
currentY = actualY;
- node = node->Next();
+ node = node->GetNext();
}
if (!nextRegion)
return;
// Now reformat text
int i = 0;
- node = dividedObject->GetRegions().First();
+ node = dividedObject->GetRegions().GetFirst();
while (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
if (region->GetText())
{
wxChar *s = copystring(region->GetText());
dividedObject->FormatText(dc, s, i);
delete[] s;
}
- node = node->Next();
+ node = node->GetNext();
i++;
}
dividedObject->SetRegionSizes();
// Rotate attachment points
double sinTheta = (double)sin(actualTheta);
double cosTheta = (double)cos(actualTheta);
- wxNode *node = m_attachmentPoints.First();
+ wxNode *node = m_attachmentPoints.GetFirst();
while (node)
{
- wxAttachmentPoint *point = (wxAttachmentPoint *)node->Data();
+ wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
double x1 = point->m_x;
double y1 = point->m_y;
point->m_x = x1*cosTheta - y1*sinTheta + x*(1.0 - cosTheta) + y*sinTheta;
point->m_y = x1*sinTheta + y1*cosTheta + y*(1.0 - cosTheta) + x*sinTheta;
- node = node->Next();
+ node = node->GetNext();
}
m_rotation = theta;
{
if (m_metafiles[m_currentAngle].GetOutlineOp() != -1)
{
- wxNode* node = m_metafiles[m_currentAngle].GetOps().Nth(m_metafiles[m_currentAngle].GetOutlineOp());
+ wxNode* node = m_metafiles[m_currentAngle].GetOps().Item(m_metafiles[m_currentAngle].GetOutlineOp());
wxASSERT (node != NULL);
- wxDrawOp* op = (wxDrawOp*) node->Data();
+ wxDrawOp* op = (wxDrawOp*) node->GetData();
if (op->OnDrawOutline(dc, x, y, w, h, m_width, m_height))
return;
{
if (m_metafiles[m_currentAngle].GetOutlineOp() != -1)
{
- wxNode* node = m_metafiles[m_currentAngle].GetOps().Nth(m_metafiles[m_currentAngle].GetOutlineOp());
+ wxNode* node = m_metafiles[m_currentAngle].GetOps().Item(m_metafiles[m_currentAngle].GetOutlineOp());
wxASSERT (node != NULL);
- wxDrawOp* op = (wxDrawOp*) node->Data();
+ wxDrawOp* op = (wxDrawOp*) node->GetData();
if (op->GetPerimeterPoint(x1, y1, x2, y2, x3, y3, GetX(), GetY(), GetAttachmentMode()))
return TRUE;
}
else
{
- wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex);
+ wxNode *node = m_image->m_gdiObjects.Item(m_gdiIndex);
if (node)
{
- wxPen *pen = (wxPen *)node->Data();
+ wxPen *pen = (wxPen *)node->GetData();
if (pen)
dc.SetPen(* pen);
}
}
else
{
- wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex);
+ wxNode *node = m_image->m_gdiObjects.Item(m_gdiIndex);
if (node)
{
- wxBrush *brush = (wxBrush *)node->Data();
+ wxBrush *brush = (wxBrush *)node->GetData();
if (brush)
dc.SetBrush(* brush);
}
}
case DRAWOP_SET_FONT:
{
- wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex);
+ wxNode *node = m_image->m_gdiObjects.Item(m_gdiIndex);
if (node)
{
- wxFont *font = (wxFont *)node->Data();
+ wxFont *font = (wxFont *)node->GetData();
if (font)
dc.SetFont(* font);
}
case DRAWOP_SET_BRUSH:
case DRAWOP_SET_FONT:
{
- m_gdiIndex = (int)expr->Nth(1)->IntegerValue();
+ m_gdiIndex = (int)expr->Item(1)->IntegerValue();
break;
}
case DRAWOP_SET_TEXT_COLOUR:
case DRAWOP_SET_BK_COLOUR:
{
- m_r = (unsigned char)expr->Nth(1)->IntegerValue();
- m_g = (unsigned char)expr->Nth(2)->IntegerValue();
- m_b = (unsigned char)expr->Nth(3)->IntegerValue();
+ m_r = (unsigned char)expr->Item(1)->IntegerValue();
+ m_g = (unsigned char)expr->Item(2)->IntegerValue();
+ m_b = (unsigned char)expr->Item(3)->IntegerValue();
break;
}
case DRAWOP_SET_BK_MODE:
{
- m_mode = (int)expr->Nth(1)->IntegerValue();
+ m_mode = (int)expr->Item(1)->IntegerValue();
break;
}
default:
{
case DRAWOP_SET_CLIPPING_RECT:
{
- m_x1 = expr->Nth(1)->RealValue();
- m_y1 = expr->Nth(2)->RealValue();
- m_x2 = expr->Nth(3)->RealValue();
- m_y2 = expr->Nth(4)->RealValue();
+ m_x1 = expr->Item(1)->RealValue();
+ m_y1 = expr->Item(2)->RealValue();
+ m_x2 = expr->Item(3)->RealValue();
+ m_y2 = expr->Item(4)->RealValue();
break;
}
default:
case DRAWOP_DRAW_RECT:
case DRAWOP_DRAW_ELLIPSE:
{
- m_x1 = expr->Nth(1)->RealValue();
- m_y1 = expr->Nth(2)->RealValue();
- m_x2 = expr->Nth(3)->RealValue();
- m_y2 = expr->Nth(4)->RealValue();
+ m_x1 = expr->Item(1)->RealValue();
+ m_y1 = expr->Item(2)->RealValue();
+ m_x2 = expr->Item(3)->RealValue();
+ m_y2 = expr->Item(4)->RealValue();
break;
}
case DRAWOP_DRAW_ROUNDED_RECT:
{
- m_x1 = expr->Nth(1)->RealValue();
- m_y1 = expr->Nth(2)->RealValue();
- m_x2 = expr->Nth(3)->RealValue();
- m_y2 = expr->Nth(4)->RealValue();
- m_radius = expr->Nth(5)->RealValue();
+ m_x1 = expr->Item(1)->RealValue();
+ m_y1 = expr->Item(2)->RealValue();
+ m_x2 = expr->Item(3)->RealValue();
+ m_y2 = expr->Item(4)->RealValue();
+ m_radius = expr->Item(5)->RealValue();
break;
}
case DRAWOP_DRAW_POINT:
{
- m_x1 = expr->Nth(1)->RealValue();
- m_y1 = expr->Nth(2)->RealValue();
+ m_x1 = expr->Item(1)->RealValue();
+ m_y1 = expr->Item(2)->RealValue();
break;
}
case DRAWOP_DRAW_TEXT:
{
- m_x1 = expr->Nth(1)->RealValue();
- m_y1 = expr->Nth(2)->RealValue();
- wxString str(expr->Nth(3)->StringValue());
+ m_x1 = expr->Item(1)->RealValue();
+ m_y1 = expr->Item(2)->RealValue();
+ wxString str(expr->Item(3)->StringValue());
m_textString = copystring(str);
break;
}
case DRAWOP_DRAW_ARC:
case DRAWOP_DRAW_ELLIPTIC_ARC:
{
- m_x1 = expr->Nth(1)->RealValue();
- m_y1 = expr->Nth(2)->RealValue();
- m_x2 = expr->Nth(3)->RealValue();
- m_y2 = expr->Nth(4)->RealValue();
- m_x3 = expr->Nth(5)->RealValue();
- m_y3 = expr->Nth(6)->RealValue();
+ m_x1 = expr->Item(1)->RealValue();
+ m_y1 = expr->Item(2)->RealValue();
+ m_x2 = expr->Item(3)->RealValue();
+ m_y2 = expr->Item(4)->RealValue();
+ m_x3 = expr->Item(5)->RealValue();
+ m_y3 = expr->Item(6)->RealValue();
break;
}
default:
void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
{
- m_noPoints = (int)expr->Nth(1)->IntegerValue();
+ m_noPoints = (int)expr->Item(1)->IntegerValue();
char buf1[5];
char buf2[5];
m_points = new wxRealPoint[m_noPoints];
int i = 0;
int bufPtr = 0;
- wxString hexString = expr->Nth(2)->StringValue();
+ wxString hexString = expr->Item(2)->StringValue();
while (i < m_noPoints)
{
buf1[0] = hexString[(size_t)bufPtr];
void wxPseudoMetaFile::Clear()
{
- wxNode *node = m_ops.First();
+ wxNode *node = m_ops.GetFirst();
while (node)
{
- wxDrawOp *op = (wxDrawOp *)node->Data();
+ wxDrawOp *op = (wxDrawOp *)node->GetData();
delete op;
- node = node->Next();
+ node = node->GetNext();
}
m_ops.Clear();
m_gdiObjects.Clear();
void wxPseudoMetaFile::Draw(wxDC& dc, double xoffset, double yoffset)
{
- wxNode *node = m_ops.First();
+ wxNode *node = m_ops.GetFirst();
while (node)
{
- wxDrawOp *op = (wxDrawOp *)node->Data();
+ wxDrawOp *op = (wxDrawOp *)node->GetData();
op->Do(dc, xoffset, yoffset);
- node = node->Next();
+ node = node->GetNext();
}
}
void wxPseudoMetaFile::Scale(double sx, double sy)
{
- wxNode *node = m_ops.First();
+ wxNode *node = m_ops.GetFirst();
while (node)
{
- wxDrawOp *op = (wxDrawOp *)node->Data();
+ wxDrawOp *op = (wxDrawOp *)node->GetData();
op->Scale(sx, sy);
- node = node->Next();
+ node = node->GetNext();
}
m_width *= sx;
m_height *= sy;
void wxPseudoMetaFile::Translate(double x, double y)
{
- wxNode *node = m_ops.First();
+ wxNode *node = m_ops.GetFirst();
while (node)
{
- wxDrawOp *op = (wxDrawOp *)node->Data();
+ wxDrawOp *op = (wxDrawOp *)node->GetData();
op->Translate(x, y);
- node = node->Next();
+ node = node->GetNext();
}
}
double cosTheta = (double)cos(theta1);
double sinTheta = (double)sin(theta1);
- wxNode *node = m_ops.First();
+ wxNode *node = m_ops.GetFirst();
while (node)
{
- wxDrawOp *op = (wxDrawOp *)node->Data();
+ wxDrawOp *op = (wxDrawOp *)node->GetData();
op->Rotate(x, y, theta, sinTheta, cosTheta);
- node = node->Next();
+ node = node->GetNext();
}
m_currentRotation = theta;
}
// Write GDI objects
char buf[50];
int i = 1;
- wxNode *node = m_gdiObjects.First();
+ wxNode *node = m_gdiObjects.GetFirst();
while (node)
{
sprintf(buf, "gdi%d_%d", whichAngle, i);
- wxObject *obj = (wxObject *)node->Data();
+ wxObject *obj = (wxObject *)node->GetData();
wxExpr *expr = NULL;
if (obj)
{
clause->AddAttributeValue(buf, expr);
i ++;
}
- node = node->Next();
+ node = node->GetNext();
}
// Write drawing operations
i = 1;
- node = m_ops.First();
+ node = m_ops.GetFirst();
while (node)
{
sprintf(buf, "op%d_%d", whichAngle, i);
- wxDrawOp *op = (wxDrawOp *)node->Data();
+ wxDrawOp *op = (wxDrawOp *)node->GetData();
wxExpr *expr = op->WriteExpr(this);
if (expr)
{
clause->AddAttributeValue(buf, expr);
i ++;
}
- node = node->Next();
+ node = node->GetNext();
}
// Write outline and fill GDI op lists (if any)
- if (m_outlineColours.Number() > 0)
+ if (m_outlineColours.GetCount() > 0)
{
wxExpr *outlineExpr = new wxExpr(wxExprList);
- node = m_outlineColours.First();
+ node = m_outlineColours.GetFirst();
while (node)
{
- outlineExpr->Append(new wxExpr((long)node->Data()));
- node = node->Next();
+ outlineExpr->Append(new wxExpr((long)node->GetData()));
+ node = node->GetNext();
}
wxString outlineObjectsStr;
outlineObjectsStr.Printf(wxT("outline_objects%d"), whichAngle);
clause->AddAttributeValue(outlineObjectsStr, outlineExpr);
}
- if (m_fillColours.Number() > 0)
+ if (m_fillColours.GetCount() > 0)
{
wxExpr *fillExpr = new wxExpr(wxExprList);
- node = m_fillColours.First();
+ node = m_fillColours.GetFirst();
while (node)
{
- fillExpr->Append(new wxExpr((long)node->Data()));
- node = node->Next();
+ fillExpr->Append(new wxExpr((long)node->GetData()));
+ node = node->GetNext();
}
wxString fillObjectsStr;
fillObjectsStr.Printf(wxT("fill_objects%d"), whichAngle);
}
else
{
- wxExpr *idExpr = expr->Nth(0);
+ wxExpr *idExpr = expr->Item(0);
switch (idExpr->IntegerValue())
{
case gyTYPE_PEN:
{
- int penWidth = (int)expr->Nth(1)->IntegerValue();
- int penStyle = (int)expr->Nth(2)->IntegerValue();
- int penRed = (int)expr->Nth(3)->IntegerValue();
- int penGreen = (int)expr->Nth(4)->IntegerValue();
- int penBlue = (int)expr->Nth(5)->IntegerValue();
+ int penWidth = (int)expr->Item(1)->IntegerValue();
+ int penStyle = (int)expr->Item(2)->IntegerValue();
+ int penRed = (int)expr->Item(3)->IntegerValue();
+ int penGreen = (int)expr->Item(4)->IntegerValue();
+ int penBlue = (int)expr->Item(5)->IntegerValue();
wxColour col(penRed, penGreen, penBlue);
wxPen *p = wxThePenList->FindOrCreatePen(col, penWidth, penStyle);
if (!p)
}
case gyTYPE_BRUSH:
{
- int brushStyle = (int)expr->Nth(1)->IntegerValue();
- int brushRed = (int)expr->Nth(2)->IntegerValue();
- int brushGreen = (int)expr->Nth(3)->IntegerValue();
- int brushBlue = (int)expr->Nth(4)->IntegerValue();
+ int brushStyle = (int)expr->Item(1)->IntegerValue();
+ int brushRed = (int)expr->Item(2)->IntegerValue();
+ int brushGreen = (int)expr->Item(3)->IntegerValue();
+ int brushBlue = (int)expr->Item(4)->IntegerValue();
wxColour col(brushRed, brushGreen, brushBlue);
wxBrush *b = wxTheBrushList->FindOrCreateBrush(col, brushStyle);
if (!b)
}
case gyTYPE_FONT:
{
- int fontPointSize = (int)expr->Nth(1)->IntegerValue();
- int fontFamily = (int)expr->Nth(2)->IntegerValue();
- int fontStyle = (int)expr->Nth(3)->IntegerValue();
- int fontWeight = (int)expr->Nth(4)->IntegerValue();
- int fontUnderlined = (int)expr->Nth(5)->IntegerValue();
+ int fontPointSize = (int)expr->Item(1)->IntegerValue();
+ int fontFamily = (int)expr->Item(2)->IntegerValue();
+ int fontStyle = (int)expr->Item(3)->IntegerValue();
+ int fontWeight = (int)expr->Item(4)->IntegerValue();
+ int fontUnderlined = (int)expr->Item(5)->IntegerValue();
m_gdiObjects.Append(wxTheFontList->FindOrCreateFont(fontPointSize,
fontFamily, fontStyle, fontWeight, (fontUnderlined != 0)));
break;
}
else
{
- wxExpr *idExpr = expr->Nth(0);
+ wxExpr *idExpr = expr->Item(0);
int opId = (int)idExpr->IntegerValue();
switch (opId)
{
copy.m_outlineOp = m_outlineOp;
// Copy the GDI objects
- wxNode *node = m_gdiObjects.First();
+ wxNode *node = m_gdiObjects.GetFirst();
while (node)
{
- wxObject *obj = (wxObject *)node->Data();
+ wxObject *obj = (wxObject *)node->GetData();
copy.m_gdiObjects.Append(obj);
- node = node->Next();
+ node = node->GetNext();
}
// Copy the operations
- node = m_ops.First();
+ node = m_ops.GetFirst();
while (node)
{
- wxDrawOp *op = (wxDrawOp *)node->Data();
+ wxDrawOp *op = (wxDrawOp *)node->GetData();
copy.m_ops.Append(op->Copy(©));
- node = node->Next();
+ node = node->GetNext();
}
// Copy the outline/fill operations
- node = m_outlineColours.First();
+ node = m_outlineColours.GetFirst();
while (node)
{
- copy.m_outlineColours.Append((wxObject *)node->Data());
- node = node->Next();
+ copy.m_outlineColours.Append((wxObject *)node->GetData());
+ node = node->GetNext();
}
- node = m_fillColours.First();
+ node = m_fillColours.GetFirst();
while (node)
{
- copy.m_fillColours.Append((wxObject *)node->Data());
- node = node->Next();
+ copy.m_fillColours.Append((wxObject *)node->GetData());
+ node = node->GetNext();
}
}
bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth, double *rheight)
{
if (!wxFileExists(filename))
- return NULL;
+ return FALSE;
wxXMetaFile *metaFile = new wxXMetaFile;
double lastY = 0.0;
// Convert from metafile records to wxDrawnShape records
- wxNode *node = metaFile->metaRecords.First();
+ wxNode *node = metaFile->metaRecords.GetFirst();
while (node)
{
- wxMetaRecord *record = (wxMetaRecord *)node->Data();
+ wxMetaRecord *record = (wxMetaRecord *)node->GetData();
switch (record->metaFunction)
{
case META_SETBKCOLOR:
{
// The pen, brush etc. has already been created when the metafile
// was read in, so we don't create it - we set it.
- wxNode *recNode = metaFile->gdiObjects.Nth((int)record->param2);
+ wxNode *recNode = metaFile->gdiObjects.Item((int)record->param2);
if (recNode)
{
- wxMetaRecord *gdiRec = (wxMetaRecord *)recNode->Data();
+ wxMetaRecord *gdiRec = (wxMetaRecord *)recNode->GetData();
if (gdiRec && (gdiRec->param1 != 0))
{
wxObject *obj = (wxObject *)gdiRec->param1;
break;
}
}
- node = node->Next();
+ node = node->GetNext();
}
double actualWidth = (double)fabs(metaFile->right - metaFile->left);
double actualHeight = (double)fabs(metaFile->bottom - metaFile->top);
double minX = (double) 99999.9;
double minY = (double) 99999.9;
- wxNode *node = m_ops.First();
+ wxNode *node = m_ops.GetFirst();
while (node)
{
- wxDrawOp *op = (wxDrawOp *)node->Data();
+ wxDrawOp *op = (wxDrawOp *)node->GetData();
switch (op->GetOp())
{
case DRAWOP_DRAW_LINE:
default:
break;
}
- node = node->Next();
+ node = node->GetNext();
}
*boundMinX = minX;
m_ops.Append(theOp);
if (flags & oglMETAFLAGS_OUTLINE)
- m_outlineOp = (m_ops.Number() - 1);
+ m_outlineOp = (m_ops.GetCount() - 1);
}
void wxPseudoMetaFile::DrawSpline(int n, wxPoint pts[])
void wxPseudoMetaFile::SetPen(wxPen* pen, bool isOutline)
{
m_gdiObjects.Append(pen);
- int n = m_gdiObjects.Number();
+ int n = m_gdiObjects.GetCount();
wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_PEN, this, n - 1);
void wxPseudoMetaFile::SetBrush(wxBrush* brush, bool isFill)
{
m_gdiObjects.Append(brush);
- int n = m_gdiObjects.Number();
+ int n = m_gdiObjects.GetCount();
wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_BRUSH, this, n - 1);
void wxPseudoMetaFile::SetFont(wxFont* font)
{
m_gdiObjects.Append(font);
- int n = m_gdiObjects.Number();
+ int n = m_gdiObjects.GetCount();
wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_FONT, this, n - 1);
if (dc)
Erase(*dc);
- wxNode *last = m_lineControlPoints->Last();
- wxNode *second_last = last->Previous();
- wxRealPoint *last_point = (wxRealPoint *)last->Data();
- wxRealPoint *second_last_point = (wxRealPoint *)second_last->Data();
+ wxNode *last = m_lineControlPoints->GetLast();
+ wxNode *second_last = last->GetPrevious();
+ wxRealPoint *last_point = (wxRealPoint *)last->GetData();
+ wxRealPoint *second_last_point = (wxRealPoint *)second_last->GetData();
// Choose a point half way between the last and penultimate points
double line_x = ((last_point->x + second_last_point->x)/2);
bool wxLineShape::DeleteLineControlPoint()
{
- if (m_lineControlPoints->Number() < 3)
+ if (m_lineControlPoints->GetCount() < 3)
return FALSE;
- wxNode *last = m_lineControlPoints->Last();
- wxNode *second_last = last->Previous();
+ wxNode *last = m_lineControlPoints->GetLast();
+ wxNode *second_last = last->GetPrevious();
- wxRealPoint *second_last_point = (wxRealPoint *)second_last->Data();
+ wxRealPoint *second_last_point = (wxRealPoint *)second_last->GetData();
delete second_last_point;
delete second_last;
if (m_lineControlPoints)
{
// Just move the first and last control points
- wxNode *first = m_lineControlPoints->First();
- wxRealPoint *first_point = (wxRealPoint *)first->Data();
+ wxNode *first = m_lineControlPoints->GetFirst();
+ wxRealPoint *first_point = (wxRealPoint *)first->GetData();
- wxNode *last = m_lineControlPoints->Last();
- wxRealPoint *last_point = (wxRealPoint *)last->Data();
+ wxNode *last = m_lineControlPoints->GetLast();
+ wxRealPoint *last_point = (wxRealPoint *)last->GetData();
// If any of the line points are at -999, we must
// initialize them by placing them half way between the first
// and the last.
- wxNode *node = first->Next();
+ wxNode *node = first->GetNext();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
if (point->x == -999)
{
double x1, y1, x2, y2;
point->x = ((x2 - x1)/2 + x1);
point->y = ((y2 - y1)/2 + y1);
}
- node = node->Next();
+ node = node->GetNext();
}
}
}
double w, h;
ClearText(i);
- if (m_regions.Number() < 1)
+ if (m_regions.GetCount() < 1)
return;
- wxNode *node = m_regions.Nth(i);
+ wxNode *node = m_regions.Item(i);
if (!node)
return;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
region->SetText(s);
dc.SetFont(* region->GetFont());
}
wxStringList *string_list = oglFormatText(dc, s, (w-5), (h-5), region->GetFormatMode());
- node = string_list->First();
+ node = (wxNode*)string_list->GetFirst();
while (node)
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = (wxChar *)node->GetData();
wxShapeTextLine *line = new wxShapeTextLine(0.0, 0.0, s);
region->GetFormattedText().Append((wxObject *)line);
- node = node->Next();
+ node = node->GetNext();
}
delete string_list;
double actualW = w;
double yp = yy + y;
// First, clear a rectangle for the text IF there is any
- if (region->GetFormattedText().Number() > 0)
+ if (region->GetFormattedText().GetCount() > 0)
{
dc.SetPen(GetBackgroundPen());
dc.SetBrush(GetBackgroundBrush());
double xp = xx + x;
double yp = yy + y;
- if (region->GetFormattedText().Number() > 0)
+ if (region->GetFormattedText().GetCount() > 0)
{
dc.SetPen(GetBackgroundPen());
dc.SetBrush(GetBackgroundBrush());
case 0:
{
// Want to take the middle section for the label
- int n = m_lineControlPoints->Number();
+ int n = m_lineControlPoints->GetCount();
int half_way = (int)(n/2);
// Find middle of this line
- wxNode *node = m_lineControlPoints->Nth(half_way - 1);
- wxRealPoint *point = (wxRealPoint *)node->Data();
- wxNode *next_node = node->Next();
- wxRealPoint *next_point = (wxRealPoint *)next_node->Data();
+ wxNode *node = m_lineControlPoints->Item(half_way - 1);
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
+ wxNode *next_node = node->GetNext();
+ wxRealPoint *next_point = (wxRealPoint *)next_node->GetData();
double dx = (next_point->x - point->x);
double dy = (next_point->y - point->y);
}
case 1:
{
- wxNode *node = m_lineControlPoints->First();
- *x = ((wxRealPoint *)node->Data())->x;
- *y = ((wxRealPoint *)node->Data())->y;
+ wxNode *node = m_lineControlPoints->GetFirst();
+ *x = ((wxRealPoint *)node->GetData())->x;
+ *y = ((wxRealPoint *)node->GetData())->y;
break;
}
case 2:
{
- wxNode *node = m_lineControlPoints->Last();
- *x = ((wxRealPoint *)node->Data())->x;
- *y = ((wxRealPoint *)node->Data())->y;
+ wxNode *node = m_lineControlPoints->GetLast();
+ *x = ((wxRealPoint *)node->GetData())->x;
+ *y = ((wxRealPoint *)node->GetData())->y;
break;
}
default:
void wxLineShape::Straighten(wxDC *dc)
{
- if (!m_lineControlPoints || m_lineControlPoints->Number() < 3)
+ if (!m_lineControlPoints || m_lineControlPoints->GetCount() < 3)
return;
if (dc)
Erase(* dc);
- wxNode *first_point_node = m_lineControlPoints->First();
- wxNode *last_point_node = m_lineControlPoints->Last();
- wxNode *second_last_point_node = last_point_node->Previous();
+ wxNode *first_point_node = m_lineControlPoints->GetFirst();
+ wxNode *last_point_node = m_lineControlPoints->GetLast();
+ wxNode *second_last_point_node = last_point_node->GetPrevious();
- wxRealPoint *last_point = (wxRealPoint *)last_point_node->Data();
- wxRealPoint *second_last_point = (wxRealPoint *)second_last_point_node->Data();
+ wxRealPoint *last_point = (wxRealPoint *)last_point_node->GetData();
+ wxRealPoint *second_last_point = (wxRealPoint *)second_last_point_node->GetData();
GraphicsStraightenLine(last_point, second_last_point);
wxNode *node = first_point_node;
while (node && (node != second_last_point_node))
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
- wxRealPoint *next_point = (wxRealPoint *)(node->Next()->Data());
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
+ wxRealPoint *next_point = (wxRealPoint *)(node->GetNext()->GetData());
GraphicsStraightenLine(point, next_point);
- node = node->Next();
+ node = node->GetNext();
}
if (dc)
void wxLineShape::SetEnds(double x1, double y1, double x2, double y2)
{
// Find centre point
- wxNode *first_point_node = m_lineControlPoints->First();
- wxNode *last_point_node = m_lineControlPoints->Last();
- wxRealPoint *first_point = (wxRealPoint *)first_point_node->Data();
- wxRealPoint *last_point = (wxRealPoint *)last_point_node->Data();
+ wxNode *first_point_node = m_lineControlPoints->GetFirst();
+ wxNode *last_point_node = m_lineControlPoints->GetLast();
+ wxRealPoint *first_point = (wxRealPoint *)first_point_node->GetData();
+ wxRealPoint *last_point = (wxRealPoint *)last_point_node->GetData();
first_point->x = x1;
first_point->y = y1;
// Get absolute positions of ends
void wxLineShape::GetEnds(double *x1, double *y1, double *x2, double *y2)
{
- wxNode *first_point_node = m_lineControlPoints->First();
- wxNode *last_point_node = m_lineControlPoints->Last();
- wxRealPoint *first_point = (wxRealPoint *)first_point_node->Data();
- wxRealPoint *last_point = (wxRealPoint *)last_point_node->Data();
+ wxNode *first_point_node = m_lineControlPoints->GetFirst();
+ wxNode *last_point_node = m_lineControlPoints->GetLast();
+ wxRealPoint *first_point = (wxRealPoint *)first_point_node->GetData();
+ wxRealPoint *last_point = (wxRealPoint *)last_point_node->GetData();
*x1 = first_point->x; *y1 = first_point->y;
*x2 = last_point->x; *y2 = last_point->y;
bool inLabelRegion = FALSE;
for (int i = 0; i < 3; i ++)
{
- wxNode *regionNode = m_regions.Nth(i);
+ wxNode *regionNode = m_regions.Item(i);
if (regionNode)
{
- wxShapeRegion *region = (wxShapeRegion *)regionNode->Data();
- if (region->m_formattedText.Number() > 0)
+ wxShapeRegion *region = (wxShapeRegion *)regionNode->GetData();
+ if (region->m_formattedText.GetCount() > 0)
{
double xp, yp, cx, cy, cw, ch;
GetLabelPosition(i, &xp, &yp);
}
}
- wxNode *node = m_lineControlPoints->First();
+ wxNode *node = m_lineControlPoints->GetFirst();
- while (node && node->Next())
+ while (node && node->GetNext())
{
- wxRealPoint *point1 = (wxRealPoint *)node->Data();
- wxRealPoint *point2 = (wxRealPoint *)node->Next()->Data();
+ wxRealPoint *point1 = (wxRealPoint *)node->GetData();
+ wxRealPoint *point2 = (wxRealPoint *)node->GetNext()->GetData();
// Allow for inaccurate mousing or vert/horiz lines
int extra = 4;
return TRUE;
}
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
}
double endArrowPos = 0.0;
double middleArrowPos = 0.0;
- wxNode *node = m_arcArrows.First();
+ wxNode *node = m_arcArrows.GetFirst();
while (node)
{
- wxArrowHead *arrow = (wxArrowHead *)node->Data();
+ wxArrowHead *arrow = (wxArrowHead *)node->GetData();
switch (arrow->GetArrowEnd())
{
case ARROW_POSITION_START:
break;
}
}
- node = node->Next();
+ node = node->GetNext();
}
}
void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool proportionalOffset)
{
- wxNode *first_line_node = m_lineControlPoints->First();
- wxRealPoint *first_line_point = (wxRealPoint *)first_line_node->Data();
- wxNode *second_line_node = first_line_node->Next();
- wxRealPoint *second_line_point = (wxRealPoint *)second_line_node->Data();
+ wxNode *first_line_node = m_lineControlPoints->GetFirst();
+ wxRealPoint *first_line_point = (wxRealPoint *)first_line_node->GetData();
+ wxNode *second_line_node = first_line_node->GetNext();
+ wxRealPoint *second_line_point = (wxRealPoint *)second_line_node->GetData();
- wxNode *last_line_node = m_lineControlPoints->Last();
- wxRealPoint *last_line_point = (wxRealPoint *)last_line_node->Data();
- wxNode *second_last_line_node = last_line_node->Previous();
- wxRealPoint *second_last_line_point = (wxRealPoint *)second_last_line_node->Data();
+ wxNode *last_line_node = m_lineControlPoints->GetLast();
+ wxRealPoint *last_line_point = (wxRealPoint *)last_line_node->GetData();
+ wxNode *second_last_line_node = last_line_node->GetPrevious();
+ wxRealPoint *second_last_line_point = (wxRealPoint *)second_last_line_node->GetData();
// Position where we want to start drawing
double positionOnLineX, positionOnLineY;
// Undraw text regions
for (int i = 0; i < 3; i++)
{
- wxNode *node = m_regions.Nth(i);
+ wxNode *node = m_regions.Item(i);
if (node)
{
double x, y;
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
GetLabelPosition(i, &x, &y);
EraseRegion(dc, region, x, y);
}
double x2 = -10000;
double y2 = -10000;
- wxNode *node = m_lineControlPoints->First();
+ wxNode *node = m_lineControlPoints->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
if (point->x < x1) x1 = point->x;
if (point->y < y1) y1 = point->y;
if (point->x > x2) x2 = point->x;
if (point->y > y2) y2 = point->y;
- node = node->Next();
+ node = node->GetNext();
}
*w = (double)(x2 - x1);
*h = (double)(y2 - y1);
{
int n = -1;
int num = 0;
- wxNode *node = image->GetLines().First();
+ wxNode *node = image->GetLines().GetFirst();
int this_attachment;
if (image == m_to)
this_attachment = m_attachmentTo;
// Find number of lines going into/out of this particular attachment point
while (node)
{
- wxLineShape *line = (wxLineShape *)node->Data();
+ wxLineShape *line = (wxLineShape *)node->GetData();
if (line->m_from == image)
{
num ++;
}
- node = node->Next();
+ node = node->GetNext();
}
*nth = n;
*no_arcs = num;
if (m_lineControlPoints && !(x_offset == 0.0 && y_offset == 0.0))
{
- wxNode *node = m_lineControlPoints->First();
+ wxNode *node = m_lineControlPoints->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
point->x += x_offset;
point->y += y_offset;
- node = node->Next();
+ node = node->GetNext();
}
}
m_labelObjects[i]->Erase(dc);
double xp, yp, xr, yr;
GetLabelPosition(i, &xp, &yp);
- wxNode *node = m_regions.Nth(i);
+ wxNode *node = m_regions.Item(i);
if (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
region->GetPosition(&xr, &yr);
}
else
if (!m_from || !m_to)
return;
- if (m_lineControlPoints->Number() > 2)
+ if (m_lineControlPoints->GetCount() > 2)
Initialise();
// Do each end - nothing in the middle. User has to move other points
FindLineEndPoints(&end_x, &end_y, &other_end_x, &other_end_y);
- wxNode *first = m_lineControlPoints->First();
- wxRealPoint *first_point = (wxRealPoint *)first->Data();
- wxNode *last = m_lineControlPoints->Last();
- wxRealPoint *last_point = (wxRealPoint *)last->Data();
+ wxNode *first = m_lineControlPoints->GetFirst();
+ wxRealPoint *first_point = (wxRealPoint *)first->GetData();
+ wxNode *last = m_lineControlPoints->GetLast();
+ wxRealPoint *last_point = (wxRealPoint *)last->GetData();
/* This is redundant, surely? Done by SetEnds.
first_point->x = end_x; first_point->y = end_y;
// Only move control points if it's a self link. And only works if attachment mode is ON.
if ((m_from == m_to) && (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE) && moveControlPoints && m_lineControlPoints && !(x_offset == 0.0 && y_offset == 0.0))
{
- wxNode *node = m_lineControlPoints->First();
+ wxNode *node = m_lineControlPoints->GetFirst();
while (node)
{
- if ((node != m_lineControlPoints->First()) && (node != m_lineControlPoints->Last()))
+ if ((node != m_lineControlPoints->GetFirst()) && (node != m_lineControlPoints->GetLast()))
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
point->x += x_offset;
point->y += y_offset;
}
- node = node->Next();
+ node = node->GetNext();
}
}
double end_x, end_y;
double other_end_x, other_end_y;
- wxNode *first = m_lineControlPoints->First();
- wxRealPoint *first_point = (wxRealPoint *)first->Data();
- wxNode *last = m_lineControlPoints->Last();
- wxRealPoint *last_point = (wxRealPoint *)last->Data();
+ wxNode *first = m_lineControlPoints->GetFirst();
+ wxRealPoint *first_point = (wxRealPoint *)first->GetData();
+ wxNode *last = m_lineControlPoints->GetLast();
+ wxRealPoint *last_point = (wxRealPoint *)last->GetData();
- wxNode *second = first->Next();
- wxRealPoint *second_point = (wxRealPoint *)second->Data();
+ wxNode *second = first->GetNext();
+ wxRealPoint *second_point = (wxRealPoint *)second->GetData();
- wxNode *second_last = last->Previous();
- wxRealPoint *second_last_point = (wxRealPoint *)second_last->Data();
+ wxNode *second_last = last->GetPrevious();
+ wxRealPoint *second_last_point = (wxRealPoint *)second_last->GetData();
- if (m_lineControlPoints->Number() > 2)
+ if (m_lineControlPoints->GetCount() > 2)
{
if (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE)
{
if (m_brush)
dc.SetBrush(* m_brush);
- int n = m_lineControlPoints->Number();
+ int n = m_lineControlPoints->GetCount();
wxPoint *points = new wxPoint[n];
int i;
for (i = 0; i < n; i++)
{
- wxRealPoint* point = (wxRealPoint*) m_lineControlPoints->Nth(i)->Data();
+ wxRealPoint* point = (wxRealPoint*) m_lineControlPoints->Item(i)->GetData();
points[i].x = WXROUND(point->x);
points[i].y = WXROUND(point->y);
}
for (int i = 0; i < 3; i++)
{
- wxNode *node = m_regions.Nth(i);
+ wxNode *node = m_regions.Item(i);
if (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
double x, y;
GetLabelPosition(i, &x, &y);
DrawRegion(dc, region, x, y);
{
if (m_canvas && m_lineControlPoints)
{
- wxNode *first = m_lineControlPoints->First();
- wxNode *last = m_lineControlPoints->Last();
- wxRealPoint *first_point = (wxRealPoint *)first->Data();
- wxRealPoint *last_point = (wxRealPoint *)last->Data();
+ wxNode *first = m_lineControlPoints->GetFirst();
+ wxNode *last = m_lineControlPoints->GetLast();
+ wxRealPoint *first_point = (wxRealPoint *)first->GetData();
+ wxRealPoint *last_point = (wxRealPoint *)last->GetData();
wxLineControlPoint *control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
first_point->x, first_point->y,
m_controlPoints.Append(control);
- wxNode *node = first->Next();
+ wxNode *node = first->GetNext();
while (node != last)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
point->x, point->y,
m_canvas->AddShape(control);
m_controlPoints.Append(control);
- node = node->Next();
+ node = node->GetNext();
}
control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
last_point->x, last_point->y,
void wxLineShape::ResetControlPoints()
{
- if (m_canvas && m_lineControlPoints && m_controlPoints.Number() > 0)
+ if (m_canvas && m_lineControlPoints && m_controlPoints.GetCount() > 0)
{
- wxNode *node = m_controlPoints.First();
- wxNode *control_node = m_lineControlPoints->First();
+ wxNode *node = m_controlPoints.GetFirst();
+ wxNode *control_node = m_lineControlPoints->GetFirst();
while (node && control_node)
{
- wxRealPoint *point = (wxRealPoint *)control_node->Data();
- wxLineControlPoint *control = (wxLineControlPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)control_node->GetData();
+ wxLineControlPoint *control = (wxLineControlPoint *)node->GetData();
control->SetX(point->x);
control->SetY(point->y);
- node = node->Next();
- control_node = control_node->Next();
+ node = node->GetNext();
+ control_node = control_node->GetNext();
}
}
}
// Make a list of lists for the (sp)line controls
wxExpr *list = new wxExpr(wxExprList);
- wxNode *node = m_lineControlPoints->First();
+ wxNode *node = m_lineControlPoints->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
wxExpr *point_list = new wxExpr(wxExprList);
wxExpr *x_expr = new wxExpr((double) point->x);
wxExpr *y_expr = new wxExpr((double) point->y);
point_list->Append(y_expr);
list->Append(point_list);
- node = node->Next();
+ node = node->GetNext();
}
clause->AddAttributeValue("controls", list);
// Write arc arrows in new OGL format, if there are any.
// This is a list of lists. Each sublist comprises:
// (arrowType arrowEnd xOffset arrowSize)
- if (m_arcArrows.Number() > 0)
+ if (m_arcArrows.GetCount() > 0)
{
wxExpr *arrow_list = new wxExpr(wxExprList);
- node = m_arcArrows.First();
+ node = m_arcArrows.GetFirst();
while (node)
{
- wxArrowHead *head = (wxArrowHead *)node->Data();
+ wxArrowHead *head = (wxArrowHead *)node->GetData();
wxExpr *head_list = new wxExpr(wxExprList);
head_list->Append(new wxExpr((long)head->_GetType()));
head_list->Append(new wxExpr((long)head->GetArrowEnd()));
arrow_list->Append(head_list);
- node = node->Next();
+ node = node->GetNext();
}
clause->AddAttributeValue("arrows", arrow_list);
}
clause->AssignAttributeValue(wxT("align_end"), &m_alignmentEnd);
// Compatibility: check for no regions.
- if (m_regions.Number() == 0)
+ if (m_regions.GetCount() == 0)
{
wxShapeRegion *newRegion = new wxShapeRegion;
newRegion->SetName("Middle");
newRegion->SetSize(150, 50);
m_regions.Append((wxObject *)newRegion);
- if (m_text.Number() > 0)
+ if (m_text.GetCount() > 0)
{
newRegion->ClearText();
- wxNode *node = m_text.First();
+ wxNode *node = m_text.GetFirst();
while (node)
{
- wxShapeTextLine *textLine = (wxShapeTextLine *)node->Data();
- wxNode *next = node->Next();
+ wxShapeTextLine *textLine = (wxShapeTextLine *)node->GetData();
+ wxNode *next = node->GetNext();
newRegion->GetFormattedText().Append((wxObject *)textLine);
delete node;
node = next;
wxString arrowName;
long arrowId = -1;
- wxExpr *type_expr = node->Nth(0);
- wxExpr *end_expr = node->Nth(1);
- wxExpr *dist_expr = node->Nth(2);
- wxExpr *size_expr = node->Nth(3);
- wxExpr *name_expr = node->Nth(4);
- wxExpr *id_expr = node->Nth(5);
+ wxExpr *type_expr = node->Item(0);
+ wxExpr *end_expr = node->Item(1);
+ wxExpr *dist_expr = node->Item(2);
+ wxExpr *size_expr = node->Item(3);
+ wxExpr *name_expr = node->Item(4);
+ wxExpr *id_expr = node->Item(5);
// New members of wxArrowHead
- wxExpr *yOffsetExpr = node->Nth(6);
- wxExpr *spacingExpr = node->Nth(7);
+ wxExpr *yOffsetExpr = node->Item(6);
+ wxExpr *spacingExpr = node->Item(7);
if (type_expr)
arrowType = (int)type_expr->IntegerValue();
lineCopy.m_maintainStraightLines = m_maintainStraightLines;
lineCopy.m_lineOrientations.Clear();
- wxNode *node = m_lineOrientations.First();
+ wxNode *node = m_lineOrientations.GetFirst();
while (node)
{
- lineCopy.m_lineOrientations.Append(node->Data());
- node = node->Next();
+ lineCopy.m_lineOrientations.Append(node->GetData());
+ node = node->GetNext();
}
if (lineCopy.m_lineControlPoints)
lineCopy.m_lineControlPoints = new wxList;
- node = m_lineControlPoints->First();
+ node = m_lineControlPoints->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
lineCopy.m_lineControlPoints->Append((wxObject*) new_point);
- node = node->Next();
+ node = node->GetNext();
}
// Copy arrows
lineCopy.ClearArrowsAtPosition(-1);
- node = m_arcArrows.First();
+ node = m_arcArrows.GetFirst();
while (node)
{
- wxArrowHead *arrow = (wxArrowHead *)node->Data();
+ wxArrowHead *arrow = (wxArrowHead *)node->GetData();
lineCopy.m_arcArrows.Append(new wxArrowHead(*arrow));
- node = node->Next();
+ node = node->GetNext();
}
}
{
for (int i = 0; i < 3; i++)
{
- wxNode *node = m_regions.Nth(i);
+ wxNode *node = m_regions.Item(i);
if (node)
{
- wxShapeRegion *region = (wxShapeRegion *)node->Data();
- if (region->m_formattedText.Number() > 0)
+ wxShapeRegion *region = (wxShapeRegion *)node->GetData();
+ if (region->m_formattedText.GetCount() > 0)
{
double w, h, x, y, xx, yy;
region->GetSize(&w, &h);
// Needed?
#if 0
int i = 0;
- for (i = 0; i < lineShape->GetLineControlPoints()->Number(); i++)
- if (((wxRealPoint *)(lineShape->GetLineControlPoints()->Nth(i)->Data())) == lpt->m_point)
+ for (i = 0; i < lineShape->GetLineControlPoints()->GetCount(); i++)
+ if (((wxRealPoint *)(lineShape->GetLineControlPoints()->Item(i)->GetData())) == lpt->m_point)
break;
// N.B. in OnMoveControlPoint, an event handler in Hardy could have deselected
}
}
int i = 0;
- for (i = 0; i < lineShape->GetLineControlPoints()->Number(); i++)
- if (((wxRealPoint *)(lineShape->GetLineControlPoints()->Nth(i)->Data())) == m_point)
+ for (i = 0; i < lineShape->GetLineControlPoints()->GetCount(); i++)
+ if (((wxRealPoint *)(lineShape->GetLineControlPoints()->Item(i)->GetData())) == m_point)
break;
lineShape->OnMoveControlPoint(i+1, x, y);
if (!m_canvas->GetQuickEditMode()) m_canvas->Redraw(dc);
*/
bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end)
{
- wxNode *refNode = referenceList.First();
- wxNode *currNode = m_arcArrows.First();
+ wxNode *refNode = referenceList.GetFirst();
+ wxNode *currNode = m_arcArrows.GetFirst();
wxString targetName(arrow->GetName());
if (!refNode) return FALSE;
// First check whether we need to insert in front of list,
// because this arrowhead is the first in the reference
// list and should therefore be first in the current list.
- wxArrowHead *refArrow = (wxArrowHead *)refNode->Data();
+ wxArrowHead *refArrow = (wxArrowHead *)refNode->GetData();
if (refArrow->GetName() == targetName)
{
m_arcArrows.Insert(arrow);
while (refNode && currNode)
{
- wxArrowHead *currArrow = (wxArrowHead *)currNode->Data();
- refArrow = (wxArrowHead *)refNode->Data();
+ wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData();
+ refArrow = (wxArrowHead *)refNode->GetData();
// Matching: advance current arrow pointer
if ((currArrow->GetArrowEnd() == end) &&
(currArrow->GetName() == refArrow->GetName()))
{
- currNode = currNode->Next(); // Could be NULL now
+ currNode = currNode->GetNext(); // Could be NULL now
if (currNode)
- currArrow = (wxArrowHead *)currNode->Data();
+ currArrow = (wxArrowHead *)currNode->GetData();
}
// Check if we're at the correct position in the
m_arcArrows.Append(arrow);
return TRUE;
}
- refNode = refNode->Next();
+ refNode = refNode->GetNext();
}
m_arcArrows.Append(arrow);
return TRUE;
void wxLineShape::ClearArrowsAtPosition(int end)
{
- wxNode *node = m_arcArrows.First();
+ wxNode *node = m_arcArrows.GetFirst();
while (node)
{
- wxArrowHead *arrow = (wxArrowHead *)node->Data();
- wxNode *next = node->Next();
+ wxArrowHead *arrow = (wxArrowHead *)node->GetData();
+ wxNode *next = node->GetNext();
switch (end)
{
case -1:
bool wxLineShape::ClearArrow(const wxString& name)
{
- wxNode *node = m_arcArrows.First();
+ wxNode *node = m_arcArrows.GetFirst();
while (node)
{
- wxArrowHead *arrow = (wxArrowHead *)node->Data();
+ wxArrowHead *arrow = (wxArrowHead *)node->GetData();
if (arrow->GetName() == name)
{
delete arrow;
delete node;
return TRUE;
}
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
}
wxArrowHead *wxLineShape::FindArrowHead(int position, const wxString& name)
{
- wxNode *node = m_arcArrows.First();
+ wxNode *node = m_arcArrows.GetFirst();
while (node)
{
- wxArrowHead *arrow = (wxArrowHead *)node->Data();
+ wxArrowHead *arrow = (wxArrowHead *)node->GetData();
if (((position == -1) || (position == arrow->GetArrowEnd())) &&
(arrow->GetName() == name))
return arrow;
- node = node->Next();
+ node = node->GetNext();
}
return NULL;
}
wxArrowHead *wxLineShape::FindArrowHead(long arrowId)
{
- wxNode *node = m_arcArrows.First();
+ wxNode *node = m_arcArrows.GetFirst();
while (node)
{
- wxArrowHead *arrow = (wxArrowHead *)node->Data();
+ wxArrowHead *arrow = (wxArrowHead *)node->GetData();
if (arrowId == arrow->GetId())
return arrow;
- node = node->Next();
+ node = node->GetNext();
}
return NULL;
}
bool wxLineShape::DeleteArrowHead(int position, const wxString& name)
{
- wxNode *node = m_arcArrows.First();
+ wxNode *node = m_arcArrows.GetFirst();
while (node)
{
- wxArrowHead *arrow = (wxArrowHead *)node->Data();
+ wxArrowHead *arrow = (wxArrowHead *)node->GetData();
if (((position == -1) || (position == arrow->GetArrowEnd())) &&
(arrow->GetName() == name))
{
delete node;
return TRUE;
}
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
}
// Overloaded DeleteArrowHead: pass arrowhead id.
bool wxLineShape::DeleteArrowHead(long id)
{
- wxNode *node = m_arcArrows.First();
+ wxNode *node = m_arcArrows.GetFirst();
while (node)
{
- wxArrowHead *arrow = (wxArrowHead *)node->Data();
+ wxArrowHead *arrow = (wxArrowHead *)node->GetData();
if (arrow->GetId() == id)
{
delete arrow;
delete node;
return TRUE;
}
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
}
double wxLineShape::FindMinimumWidth()
{
double minWidth = 0.0;
- wxNode *node = m_arcArrows.First();
+ wxNode *node = m_arcArrows.GetFirst();
while (node)
{
- wxArrowHead *arrowHead = (wxArrowHead *)node->Data();
+ wxArrowHead *arrowHead = (wxArrowHead *)node->GetData();
minWidth += arrowHead->GetSize();
- if (node->Next())
+ if (node->GetNext())
minWidth += arrowHead->GetSpacing();
- node = node->Next();
+ node = node->GetNext();
}
// We have ABSOLUTE minimum now. So
// scale it to give it reasonable aesthetics
wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject)
{
- int n = m_lineControlPoints->Number();
+ int n = m_lineControlPoints->GetCount();
int nn = 0;
if (m_to == nodeObject)
{
nn = n - 2;
}
else nn = 1;
- wxNode *node = m_lineControlPoints->Nth(nn);
+ wxNode *node = m_lineControlPoints->Item(nn);
if (node)
{
- return (wxRealPoint *)node->Data();
+ return (wxRealPoint *)node->GetData();
}
else
return FALSE;
// Find position in line's region list
int i = 0;
- wxNode *node = GetRegions().First();
+ wxNode *node = GetRegions().GetFirst();
while (node)
{
- if (labelShape->m_shapeRegion == (wxShapeRegion *)node->Data())
+ if (labelShape->m_shapeRegion == (wxShapeRegion *)node->GetData())
node = NULL;
else
{
- node = node->Next();
+ node = node->GetNext();
i ++;
}
}
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
// case META_STRETCHDIB:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEBRUSH:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEPATTERNBRUSH:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEPENINDIRECT:
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
// For some reason, the size of this record is sometimes 9 words!!!
// instead of the usual 8. So read 2 characters extra.
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEBRUSHINDIRECT:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEBITMAPINDIRECT:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEBITMAP:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
case META_CREATEREGION:
metaRecords.Append(rec);
gdiObjects.Append(rec);
AddMetaRecordHandle(rec);
- rec->param2 = (long)(gdiObjects.Number() - 1);
+ rec->param2 = (long)(gdiObjects.GetCount() - 1);
break;
}
default:
wxXMetaFile::~wxXMetaFile(void)
{
- wxNode *node = metaRecords.First();
+ wxNode *node = metaRecords.GetFirst();
while (node)
{
- wxMetaRecord *rec = (wxMetaRecord *)node->Data();
+ wxMetaRecord *rec = (wxMetaRecord *)node->GetData();
delete rec;
- wxNode *next = node->Next();
+ wxNode *next = node->GetNext();
delete node;
node = next;
}
bool wxXMetaFile::Play(wxDC *dc)
{
- wxNode *node = metaRecords.First();
+ wxNode *node = metaRecords.GetFirst();
while (node)
{
- wxMetaRecord *rec = (wxMetaRecord *)node->Data();
+ wxMetaRecord *rec = (wxMetaRecord *)node->GetData();
int rdFunction = rec->metaFunction;
switch (rdFunction)
break;
}
}
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}
double m_xpos, double m_ypos, double width, double height,
int formatMode)
{
- int n = text_list->Number();
+ int n = text_list->GetCount();
if (!text_list || (n == 0))
return;
// Store text extents for speed
double *widths = new double[n];
- wxNode *current = text_list->First();
+ wxNode *current = text_list->GetFirst();
int i = 0;
while (current)
{
- wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.GetTextExtent(line->GetText(), ¤t_width, &char_height);
widths[i] = current_width;
if (current_width > max_width)
max_width = current_width;
- current = current->Next();
+ current = current->GetNext();
i ++;
}
xOffset = 0.0;
}
- current = text_list->First();
+ current = text_list->GetFirst();
i = 0;
while (current)
{
- wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
double x;
if ((formatMode & FORMAT_CENTRE_HORIZ) && (widths[i] < width))
double y = (double)(i*char_height + yoffset);
line->SetX( x - xOffset ); line->SetY( y - yOffset );
- current = current->Next();
+ current = current->GetNext();
i ++;
}
void oglCentreTextNoClipping(wxDC& dc, wxList *text_list,
double m_xpos, double m_ypos, double width, double height)
{
- int n = text_list->Number();
+ int n = text_list->GetCount();
if (!text_list || (n == 0))
return;
// Store text extents for speed
double *widths = new double[n];
- wxNode *current = text_list->First();
+ wxNode *current = text_list->GetFirst();
int i = 0;
while (current)
{
- wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.GetTextExtent(line->GetText(), ¤t_width, &char_height);
widths[i] = current_width;
if (current_width > max_width)
max_width = current_width;
- current = current->Next();
+ current = current->GetNext();
i ++;
}
double xoffset = (double)(m_xpos - width/2.0);
- current = text_list->First();
+ current = text_list->GetFirst();
i = 0;
while (current)
{
- wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
double x = (double)((width - widths[i])/2.0 + xoffset);
double y = (double)(i*char_height + yoffset);
line->SetX( x - m_xpos ); line->SetY( y - m_ypos );
- current = current->Next();
+ current = current->GetNext();
i ++;
}
delete widths;
double m_xpos, double m_ypos, double width, double height,
double *actual_width, double *actual_height)
{
- int n = text_list->Number();
+ int n = text_list->GetCount();
if (!text_list || (n == 0))
{
long max_width = 0;
long current_width = 0;
- wxNode *current = text_list->First();
+ wxNode *current = text_list->GetFirst();
int i = 0;
while (current)
{
- wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.GetTextExtent(line->GetText(), ¤t_width, &char_height);
if (current_width > max_width)
max_width = current_width;
- current = current->Next();
+ current = current->GetNext();
i ++;
}
wxStringList *string_list = new wxStringList;
wxString buffer;
- wxNode *node = word_list.First();
+ wxNode *node = (wxNode*)word_list.GetFirst();
long x, y;
while (node)
{
wxString oldBuffer(buffer);
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = (wxChar *)node->GetData();
if (!s)
{
// FORCE NEW LINE
}
}
- node = node->Next();
+ node = node->GetNext();
}
if (buffer.Length() != 0)
string_list->Add(buffer);
(long)(m_xpos - width/2.0), (long)(m_ypos - height/2.0),
(long)width, (long)height);
- wxNode *current = text_list->First();
+ wxNode *current = text_list->GetFirst();
while (current)
{
- wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.DrawText(line->GetText(), WXROUND(xoffset + line->GetX()), WXROUND(yoffset + line->GetY()));
- current = current->Next();
+ current = current->GetNext();
}
dc.DestroyClippingRegion();
double xcount = 0;
double ycount = 0;
- wxNode *node = points->First();
+ wxNode *node = points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
xcount += point->x;
ycount += point->y;
- node = node->Next();
+ node = node->GetNext();
}
- *x = (xcount/points->Number());
- *y = (ycount/points->Number());
+ *x = (xcount/points->GetCount());
+ *y = (ycount/points->GetCount());
}
/*
if (!list)
return;
- wxNode *node = list->First();
+ wxNode *node = list->GetFirst();
while (node)
{
- wxChar *s = (wxChar *)node->Data();
+ wxChar *s = (wxChar *)node->GetData();
item->Append(s);
- node = node->Next();
+ node = node->GetNext();
}
}
{
if (GetCanvas())
GetCanvas()->SetCursor(* wxHOURGLASS_CURSOR);
- wxNode *current = m_shapeList->First();
+ wxNode *current = m_shapeList->GetFirst();
while (current)
{
- wxShape *object = (wxShape *)current->Data();
+ wxShape *object = (wxShape *)current->GetData();
if (!object->GetParent())
object->Draw(dc);
- current = current->Next();
+ current = current->GetNext();
}
if (GetCanvas())
GetCanvas()->SetCursor(* wxSTANDARD_CURSOR);
{
if (nodeAfter)
{
- if (nodeAfter->Next())
- m_shapeList->Insert(nodeAfter->Next(), object);
+ if (nodeAfter->GetNext())
+ m_shapeList->Insert(nodeAfter->GetNext(), object);
else
m_shapeList->Append(object);
}
void wxDiagram::DeleteAllShapes()
{
- wxNode *node = m_shapeList->First();
+ wxNode *node = m_shapeList->GetFirst();
while (node)
{
- wxShape *shape = (wxShape *)node->Data();
+ wxShape *shape = (wxShape *)node->GetData();
if (!shape->GetParent())
{
RemoveShape(shape);
delete shape;
- node = m_shapeList->First();
+ node = m_shapeList->GetFirst();
}
else
- node = node->Next();
+ node = node->GetNext();
}
}
void wxDiagram::ShowAll(bool show)
{
- wxNode *current = m_shapeList->First();
+ wxNode *current = m_shapeList->GetFirst();
while (current)
{
- wxShape *object = (wxShape *)current->Data();
+ wxShape *object = (wxShape *)current->GetData();
object->Show(show);
- current = current->Next();
+ current = current->GetNext();
}
}
// Make sure all text that should be centred, is centred.
void wxDiagram::RecentreAll(wxDC& dc)
{
- wxNode *object_node = m_shapeList->First();
+ wxNode *object_node = m_shapeList->GetFirst();
while (object_node)
{
- wxShape *obj = (wxShape *)object_node->Data();
+ wxShape *obj = (wxShape *)object_node->GetData();
obj->Recentre(dc);
- object_node = object_node->Next();
+ object_node = object_node->GetNext();
}
}
database->Append(header);
- wxNode *node = m_shapeList->First();
+ wxNode *node = m_shapeList->GetFirst();
while (node)
{
- wxShape *shape = (wxShape *)node->Data();
+ wxShape *shape = (wxShape *)node->GetData();
if (!shape->IsKindOf(CLASSINFO(wxControlPoint)))
{
wxNode *node = database.First();
while (node)
{
- wxExpr *clause = (wxExpr *)node->Data();
+ wxExpr *clause = (wxExpr *)node->GetData();
long id = -1;
clause->GetAttributeValue("id", id);
wxRegisterId(id);
if (divisionExpr)
{
int i = 0;
- wxExpr *idExpr = divisionExpr->Nth(i);
+ wxExpr *idExpr = divisionExpr->Item(i);
while (idExpr)
{
long divisionId = idExpr->IntegerValue();
}
}
i ++;
- idExpr = divisionExpr->Nth(i);
+ idExpr = divisionExpr->Item(i);
}
}
}
wxNode *node = shape.GetChildren().First();
while (node)
{
- wxShape *childShape = (wxShape *)node->Data();
+ wxShape *childShape = (wxShape *)node->GetData();
wxExpr *childExpr = new wxExpr("shape");
OnShapeSave(db, *childShape, *childExpr);
node = node->Next();
// Find a shape by its id
wxShape* wxDiagram::FindShape(long id) const
{
- wxNode* node = GetShapeList()->First();
+ wxNode* node = GetShapeList()->GetFirst();
while (node)
{
- wxShape* shape = (wxShape*) node->Data();
+ wxShape* shape = (wxShape*) node->GetData();
if (shape->GetId() == id)
return shape;
- node = node->Next();
+ node = node->GetNext();
}
return NULL;
}
void wxLineCrossings::FindCrossings(wxDiagram& diagram)
{
ClearCrossings();
- wxNode* node1 = diagram.GetShapeList()->First();
+ wxNode* node1 = diagram.GetShapeList()->GetFirst();
while (node1)
{
- wxShape* shape1 = (wxShape*) node1->Data();
+ wxShape* shape1 = (wxShape*) node1->GetData();
if (shape1->IsKindOf(CLASSINFO(wxLineShape)))
{
wxLineShape* lineShape1 = (wxLineShape*) shape1;
// Iterate through the segments
wxList* pts1 = lineShape1->GetLineControlPoints();
int i;
- for (i = 0; i < (pts1->Number() - 1); i++)
+ for (i = 0; i < (pts1->GetCount() - 1); i++)
{
- wxRealPoint* pt1_a = (wxRealPoint*) (pts1->Nth(i)->Data());
- wxRealPoint* pt1_b = (wxRealPoint*) (pts1->Nth(i+1)->Data());
+ wxRealPoint* pt1_a = (wxRealPoint*) (pts1->Item(i)->GetData());
+ wxRealPoint* pt1_b = (wxRealPoint*) (pts1->Item(i+1)->GetData());
// Now we iterate through the segments again
- wxNode* node2 = diagram.GetShapeList()->First();
+ wxNode* node2 = diagram.GetShapeList()->GetFirst();
while (node2)
{
- wxShape* shape2 = (wxShape*) node2->Data();
+ wxShape* shape2 = (wxShape*) node2->GetData();
// Assume that the same line doesn't cross itself
if (shape2->IsKindOf(CLASSINFO(wxLineShape)) && (shape1 != shape2))
// Iterate through the segments
wxList* pts2 = lineShape2->GetLineControlPoints();
int j;
- for (j = 0; j < (pts2->Number() - 1); j++)
+ for (j = 0; j < (pts2->GetCount() - 1); j++)
{
- wxRealPoint* pt2_a = (wxRealPoint*) (pts2->Nth(j)->Data());
- wxRealPoint* pt2_b = (wxRealPoint*) (pts2->Nth(j+1)->Data());
+ wxRealPoint* pt2_a = (wxRealPoint*) (pts2->Item(j)->GetData());
+ wxRealPoint* pt2_b = (wxRealPoint*) (pts2->Item(j+1)->GetData());
// Now let's see if these two segments cross.
double ratio1, ratio2;
}
}
}
- node2 = node2->Next();
+ node2 = node2->GetNext();
}
}
}
- node1 = node1->Next();
+ node1 = node1->GetNext();
}
}
long arcWidth = 8;
- wxNode* node = m_crossings.First();
+ wxNode* node = m_crossings.GetFirst();
while (node)
{
- wxLineCrossing* crossing = (wxLineCrossing*) node->Data();
+ wxLineCrossing* crossing = (wxLineCrossing*) node->GetData();
// dc.DrawEllipse((long) (crossing->m_intersect.x - (arcWidth/2.0) + 0.5), (long) (crossing->m_intersect.y - (arcWidth/2.0) + 0.5),
// arcWidth, arcWidth);
dc.SetPen(*wxWHITE_PEN);
dc.DrawLine( (long) arcX1, (long) arcY1, (long) arcX2, (long) arcY2 );
- node = node->Next();
+ node = node->GetNext();
}
}
void wxLineCrossings::ClearCrossings()
{
- wxNode* node = m_crossings.First();
+ wxNode* node = m_crossings.GetFirst();
while (node)
{
- wxLineCrossing* crossing = (wxLineCrossing*) node->Data();
+ wxLineCrossing* crossing = (wxLineCrossing*) node->GetData();
delete crossing;
- node = node->Next();
+ node = node->GetNext();
}
m_crossings.Clear();
}
double m_xpos, double m_ypos, double width, double height,
int formatMode)
{
- int n = text_list->Number();
+ int n = text_list->GetCount();
if (!text_list || (n == 0))
return;
// Store text extents for speed
double *widths = new double[n];
- wxNode *current = text_list->First();
+ wxNode *current = text_list->GetFirst();
int i = 0;
while (current)
{
- wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.GetTextExtent(line->GetText(), ¤t_width, &char_height);
widths[i] = current_width;
xOffset = 0.0;
}
- current = text_list->First();
+ current = text_list->GetFirst();
i = 0;
while (current)
{
- wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
double x;
if ((formatMode & FORMAT_CENTRE_HORIZ) && (widths[i] < width))
void oglCentreTextNoClipping(wxDC& dc, wxList *text_list,
double m_xpos, double m_ypos, double width, double height)
{
- int n = text_list->Number();
+ int n = text_list->GetCount();
if (!text_list || (n == 0))
return;
// Store text extents for speed
double *widths = new double[n];
- wxNode *current = text_list->First();
+ wxNode *current = text_list->GetFirst();
int i = 0;
while (current)
{
- wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.GetTextExtent(line->GetText(), ¤t_width, &char_height);
widths[i] = current_width;
double xoffset = (double)(m_xpos - width/2.0);
- current = text_list->First();
+ current = text_list->GetFirst();
i = 0;
while (current)
{
- wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
double x = (double)((width - widths[i])/2.0 + xoffset);
double y = (double)(i*char_height + yoffset);
double m_xpos, double m_ypos, double width, double height,
double *actual_width, double *actual_height)
{
- int n = text_list->Number();
+ int n = text_list->GetCount();
if (!text_list || (n == 0))
{
long max_width = 0;
long current_width = 0;
- wxNode *current = text_list->First();
+ wxNode *current = text_list->GetFirst();
int i = 0;
while (current)
{
- wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.GetTextExtent(line->GetText(), ¤t_width, &char_height);
if (current_width > max_width)
{
wxString oldBuffer(buffer);
- char *s = (char *)node->Data();
+ char *s = (char *)node->GetData();
if (!s)
{
// FORCE NEW LINE
(long)(m_xpos - width/2.0), (long)(m_ypos - height/2.0),
(long)width, (long)height);
- wxNode *current = text_list->First();
+ wxNode *current = text_list->GetFirst();
while (current)
{
- wxShapeTextLine *line = (wxShapeTextLine *)current->Data();
+ wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
dc.DrawText(line->GetText(), WXROUND(xoffset + line->GetX()), WXROUND(yoffset + line->GetY()));
current = current->Next();
double xcount = 0;
double ycount = 0;
- wxNode *node = points->First();
+ wxNode *node = points->GetFirst();
while (node)
{
- wxRealPoint *point = (wxRealPoint *)node->Data();
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
xcount += point->x;
ycount += point->y;
node = node->Next();
}
- *x = (xcount/points->Number());
- *y = (ycount/points->Number());
+ *x = (xcount/points->GetCount());
+ *y = (ycount/points->GetCount());
}
/*
if (!list)
return;
- wxNode *node = list->First();
+ wxNode *node = list->GetFirst();
while (node)
{
- char *s = (char *)node->Data();
+ char *s = (char *)node->GetData();
item->Append(s);
node = node->Next();
}