// Created: 12/07/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#include <wx/wx.h>
#endif
-#include <wx/deprecated/setup.h>
-#include <wx/deprecated/wxexpr.h>
+#include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
#include <wx/clipbrd.h>
{
DeleteAllShapes();
- return DoCopy(diagram, this, FALSE, NULL);
+ return DoCopy(diagram, this, false, NULL);
}
// Copy contents to the diagram, with new ids.
bool wxDiagramClipboard::Paste(wxDiagram* diagram, wxDC* dc, int offsetX, int offsetY)
{
- return DoCopy(this, diagram, TRUE, dc, offsetX, offsetY);
+ return DoCopy(this, diagram, true, dc, offsetX, offsetY);
}
// Universal copy function (to or from clipboard).
// First copy all node shapes.
wxList* shapeList = diagramFrom->GetShapeList();
- wxNode* node = shapeList->GetFirst();
+ wxObjectList::compatibility_iterator node = shapeList->GetFirst();
while (node)
{
wxShape* shape = (wxShape*) node->GetData();
// 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().GetFirst();
+ wxObjectList::compatibility_iterator lineNode = shape->GetLines().GetFirst();
while (lineNode)
{
wxLineShape* lineShape = (wxLineShape*) lineNode->GetData();
OnEndCopy(diagramTo);
- return TRUE;
+ return true;
}
#ifdef __WXMSW__
// these to the Windows clipboard
bool wxDiagramClipboard::CopyToClipboard(double scale)
{
+#if wxUSE_METAFILE
// Make a metafile DC
wxMetaFileDC mfDC;
if (mfDC.Ok())
if (!newBitmap->Ok())
{
delete newBitmap;
-
+
wxChar buf[200];
wxSprintf(buf, _T("Sorry, could not allocate clipboard bitmap (%dx%d)"), (maxX+10), (maxY+10));
wxMessageBox(buf, _T("Clipboard copy problem"));
- return FALSE;
+ return false;
}
wxMemoryDC memDC;
// Close clipboard
wxCloseClipboard();
}
-
+
delete newBitmap;
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 (dc && (diagramTo != this))
{
- newShape->Select(TRUE, dc);
+ newShape->Select(true, dc);
}
- return TRUE;
+ return true;
}
/*
{
// Do nothing if copying to the clipboard
if (diagramTo == this)
- return TRUE;
+ return true;
// Deselect all objects initially.
csDiagram* diagram = (csDiagram*) diagramTo;
csDiagramDocument* doc = diagram->GetDocument();
- ((csDiagramView*)doc->GetFirstView())->SelectAll(FALSE);
+ ((csDiagramView*)doc->GetFirstView())->SelectAll(false);
m_currentCmd = new csDiagramCommand(_T("Paste"), doc);
- return TRUE;
+ return true;
}
bool csDiagramClipboard::OnEndCopy(wxDiagram* diagramTo)
{
// Do nothing if copying to the clipboard
if (diagramTo == this)
- return TRUE;
+ return true;
csDiagram* diagram = (csDiagram*) diagramTo;
csDiagramDocument* doc = diagram->GetDocument();
m_currentCmd = NULL;
}
}
- return TRUE;
+ return true;
}
// Use the command framework to add the shapes, if we're copying to a diagram and
m_currentCmd->AddState(new csCommandState(ID_CS_ADD_SHAPE_SELECT, newShape, NULL));
}
- return TRUE;
+ return true;
}