// First copy all node shapes.
wxList* shapeList = diagramFrom->GetShapeList();
- wxNode* node = shapeList->First();
+ wxNode* node = shapeList->GetFirst();
while (node)
{
- wxShape* shape = (wxShape*) node->Data();
+ wxShape* shape = (wxShape*) node->GetData();
if (((diagramFrom == this) || shape->Selected()) && !shape->IsKindOf(CLASSINFO(wxLineShape)))
{
wxShape* newShape = shape->CreateNewCopy();
OnAddShape(diagramTo, newShape, dc);
}
- node = node->Next();
+ node = node->GetNext();
}
- node = shapeList->First();
+ node = shapeList->GetFirst();
while (node)
{
- wxShape* shape = (wxShape*) node->Data();
+ wxShape* shape = (wxShape*) node->GetData();
if (((diagramFrom == this) || shape->Selected()) && shape->IsKindOf(CLASSINFO(wxLineShape)))
{
wxLineShape* lineShape = (wxLineShape*) shape;
}
}
- node = node->Next();
+ node = node->GetNext();
}
// Now make sure line ordering is correct
- node = shapeList->First();
+ node = shapeList->GetFirst();
while (node)
{
- wxShape* shape = (wxShape*) node->Data();
+ wxShape* shape = (wxShape*) node->GetData();
if (((diagramFrom == this) || shape->Selected()) && !shape->IsKindOf(CLASSINFO(wxLineShape)))
{
wxShape* newShape = (wxShape*) mapping.Get((long) shape);
// Make a list of all the new lines, in the same order as the old lines.
// Then apply the list of new lines to the shape.
wxList newLines;
- wxNode* lineNode = shape->GetLines().First();
+ wxNode* lineNode = shape->GetLines().GetFirst();
while (lineNode)
{
- wxLineShape* lineShape = (wxLineShape*) lineNode->Data();
+ wxLineShape* lineShape = (wxLineShape*) lineNode->GetData();
if ((diagramFrom == this) || (lineShape->GetTo()->Selected() && lineShape->GetFrom()->Selected()))
{
wxLineShape* newLineShape = (wxLineShape*) mapping.Get((long) lineShape);
newLines.Append(newLineShape);
}
- lineNode = lineNode->Next();
+ lineNode = lineNode->GetNext();
}
- if (newLines.Number() > 0)
+ if (newLines.GetCount() > 0)
newShape->ApplyAttachmentOrdering(newLines);
}
- node = node->Next();
+ node = node->GetNext();
}
OnEndCopy(diagramTo);
// these to the Windows clipboard
bool wxDiagramClipboard::CopyToClipboard(double scale)
{
+#if wxUSE_METAFILE
// Make a metafile DC
wxMetaFileDC mfDC;
if (mfDC.Ok())
// Draw on metafile DC
Redraw(mfDC);
- /* int printWidth = */ mfDC.MaxX() - mfDC.MinX();
- /* int printHeight = */ mfDC.MaxY() - mfDC.MinY();
+ // int printWidth = mfDC.MaxX() - mfDC.MinX();
+ // int printHeight = mfDC.MaxY() - mfDC.MinY();
int maxX = (int)mfDC.MaxX();
int maxY = (int)mfDC.MaxY();
wxMetaFile *mf = mfDC.Close();
{
delete newBitmap;
- char buf[200];
- sprintf(buf, "Sorry, could not allocate clipboard bitmap (%dx%d)", (maxX+10), (maxY+10));
+ wxChar buf[200];
+ wxSprintf(buf, _T("Sorry, could not allocate clipboard bitmap (%dx%d)"), (maxX+10), (maxY+10));
wxMessageBox(buf, _T("Clipboard copy problem"));
return FALSE;
}
delete mf;
}
- return TRUE;
+ return true;
+#else
+ wxMessageBox("wxUSE_METAFILE in build required to use Clipboard", _T("Clipboard copy problem"));
+ return false;
+#endif
}
#endif
// __WXMSW__
if (m_currentCmd)
{
- if (m_currentCmd->GetStates().Number() == 0)
+ if (m_currentCmd->GetStates().GetCount() == 0)
{
delete m_currentCmd;
}