#include <wx/wxexpr.h>
#endif
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
{
wxBeginBusyCursor();
- wxExprDatabase database(PrologInteger, "id");
+ wxExprDatabase database(wxExprInteger, "id");
if (!database.Read(filename))
{
wxEndBusyCursor();
bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
{
- shape.WritePrologAttributes(&expr);
+ shape.WriteAttributes(&expr);
db.Append(&expr);
if (shape.IsKindOf(CLASSINFO(wxCompositeShape)))
bool wxDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
{
- shape.ReadPrologAttributes(&expr);
+ shape.ReadAttributes(&expr);
return TRUE;
}
m_diagramCanvas = can;
}
+// Find a shape by its id
+wxShape* wxDiagram::FindShape(long id) const
+{
+ wxNode* node = GetShapeList()->First();
+ while (node)
+ {
+ wxShape* shape = (wxShape*) node->Data();
+ if (shape->GetId() == id)
+ return shape;
+ node = node->Next();
+ }
+ return NULL;
+}