コード例 #1
0
ファイル: basic2.cpp プロジェクト: kleopatra999/pgadmin3
void wxPolygonShape::Copy(wxShape &copy)
{
	wxShape::Copy(copy);

	wxASSERT( copy.IsKindOf(CLASSINFO(wxPolygonShape)) );

	wxPolygonShape &polyCopy = (wxPolygonShape &) copy;

	polyCopy.ClearPoints();

	polyCopy.m_points = new wxList;
	polyCopy.m_originalPoints = new wxList;

	wxNode *node = m_points->GetFirst();
	while (node)
	{
		wxRealPoint *point = (wxRealPoint *)node->GetData();
		wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
		polyCopy.m_points->Append((wxObject *) new_point);
		node = node->GetNext();
	}
	node = m_originalPoints->GetFirst();
	while (node)
	{
		wxRealPoint *point = (wxRealPoint *)node->GetData();
		wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
		polyCopy.m_originalPoints->Append((wxObject *) new_point);
		node = node->GetNext();
	}
	polyCopy.m_boundWidth = m_boundWidth;
	polyCopy.m_boundHeight = m_boundHeight;
	polyCopy.m_originalWidth = m_originalWidth;
	polyCopy.m_originalHeight = m_originalHeight;
}
コード例 #2
0
ファイル: doc.cpp プロジェクト: BackupTheBerlios/wxbeos-svn
bool MyDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
{
  wxDiagram::OnShapeSave(db, shape, expr);
  MyEvtHandler *handler = (MyEvtHandler *)shape.GetEventHandler();
  expr.AddAttributeValueString(_T("label"), handler->label);
  return true;
}
コード例 #3
0
bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
{
  shape.WriteAttributes(&expr);
  db.Append(&expr);

  if (shape.IsKindOf(CLASSINFO(wxCompositeShape)))
  {
    wxNode *node = shape.GetChildren().GetFirst();
    while (node)
    {
      wxShape *childShape = (wxShape *)node->GetData();
      wxExpr *childExpr = new wxExpr(_T("shape"));
      OnShapeSave(db, *childShape, *childExpr);
      node = node->GetNext();
    }
  }

  return true;
}
コード例 #4
0
ファイル: basic2.cpp プロジェクト: kleopatra999/pgadmin3
void wxRectangleShape::Copy(wxShape &copy)
{
	wxShape::Copy(copy);

	wxASSERT( copy.IsKindOf(CLASSINFO(wxRectangleShape)) );

	wxRectangleShape &rectCopy = (wxRectangleShape &) copy;
	rectCopy.m_width = m_width;
	rectCopy.m_height = m_height;
	rectCopy.m_cornerRadius = m_cornerRadius;
}
コード例 #5
0
ファイル: basic2.cpp プロジェクト: kleopatra999/pgadmin3
void wxEllipseShape::Copy(wxShape &copy)
{
	wxShape::Copy(copy);

	wxASSERT( copy.IsKindOf(CLASSINFO(wxEllipseShape)) );

	wxEllipseShape &ellipseCopy = (wxEllipseShape &) copy;

	ellipseCopy.m_width = m_width;
	ellipseCopy.m_height = m_height;
}
コード例 #6
0
ファイル: doc.cpp プロジェクト: BackupTheBerlios/wxbeos-svn
bool MyDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
{
  wxDiagram::OnShapeLoad(db, shape, expr);
  wxChar *label = NULL;
  expr.AssignAttributeValue(_T("label"), &label);
  MyEvtHandler *handler = new MyEvtHandler(&shape, &shape, wxString(label));
  shape.SetEventHandler(handler);

  if (label)
    delete[] label;
  return true;
}
コード例 #7
0
ファイル: composit.cpp プロジェクト: kleopatra999/pgadmin3
void wxDivisionShape::Copy(wxShape &copy)
{
	wxCompositeShape::Copy(copy);

	wxASSERT( copy.IsKindOf(CLASSINFO(wxDivisionShape)) ) ;

	wxDivisionShape &divisionCopy = (wxDivisionShape &) copy;

	divisionCopy.m_leftSideStyle = m_leftSideStyle;
	divisionCopy.m_topSideStyle = m_topSideStyle;
	divisionCopy.m_leftSideColour = m_leftSideColour;
	divisionCopy.m_topSideColour = m_topSideColour;

	divisionCopy.m_leftSidePen = m_leftSidePen;
	divisionCopy.m_topSidePen = m_topSidePen;
	divisionCopy.m_handleSide = m_handleSide;

	// Division geometry copying is handled at the wxCompositeShape level.
}
コード例 #8
0
ファイル: composit.cpp プロジェクト: kleopatra999/pgadmin3
void wxCompositeShape::Copy(wxShape &copy)
{
	wxRectangleShape::Copy(copy);

	wxASSERT( copy.IsKindOf(CLASSINFO(wxCompositeShape)) ) ;

	wxCompositeShape &compositeCopy = (wxCompositeShape &) copy;

	// Associate old and new copies for compositeCopying constraints and division geometry
	oglObjectCopyMapping.Append((long)this, &compositeCopy);

	// Copy the children
	wxNode *node = m_children.GetFirst();
	while (node)
	{
		wxShape *object = (wxShape *)node->GetData();
		wxShape *newObject = object->CreateNewCopy(FALSE, FALSE);
		if (newObject->GetId() == 0)
			newObject->SetId(wxNewId());

		newObject->SetParent(&compositeCopy);
		compositeCopy.m_children.Append(newObject);

		// Some m_children may be divisions
		if (m_divisions.Member(object))
			compositeCopy.m_divisions.Append(newObject);

		oglObjectCopyMapping.Append((long)object, newObject);

		node = node->GetNext();
	}

	// Copy the constraints
	node = m_constraints.GetFirst();
	while (node)
	{
		wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();

		wxShape *newConstraining = (wxShape *)(oglObjectCopyMapping.Find((long)constraint->m_constrainingObject)->GetData());

		wxList newConstrainedList;
		wxNode *node2 = constraint->m_constrainedObjects.GetFirst();
		while (node2)
		{
			wxShape *constrainedObject = (wxShape *)node2->GetData();
			wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->GetData());
			newConstrainedList.Append(newConstrained);
			node2 = node2->GetNext();
		}

		wxOGLConstraint *newConstraint = new wxOGLConstraint(constraint->m_constraintType, newConstraining,
		        newConstrainedList);
		newConstraint->m_constraintId = constraint->m_constraintId;
		if (!constraint->m_constraintName.IsEmpty())
		{
			newConstraint->m_constraintName = constraint->m_constraintName;
		}
		newConstraint->SetSpacing(constraint->m_xSpacing, constraint->m_ySpacing);
		compositeCopy.m_constraints.Append(newConstraint);

		node = node->GetNext();
	}

	// Now compositeCopy the division geometry
	node = m_divisions.GetFirst();
	while (node)
	{
		wxDivisionShape *division = (wxDivisionShape *)node->GetData();
		wxNode *node1 = oglObjectCopyMapping.Find((long)division);
		wxNode *leftNode = NULL;
		wxNode *topNode = NULL;
		wxNode *rightNode = NULL;
		wxNode *bottomNode = NULL;
		if (division->GetLeftSide())
			leftNode = oglObjectCopyMapping.Find((long)division->GetLeftSide());
		if (division->GetTopSide())
			topNode = oglObjectCopyMapping.Find((long)division->GetTopSide());
		if (division->GetRightSide())
			rightNode = oglObjectCopyMapping.Find((long)division->GetRightSide());
		if (division->GetBottomSide())
			bottomNode = oglObjectCopyMapping.Find((long)division->GetBottomSide());
		if (node1)
		{
			wxDivisionShape *newDivision = (wxDivisionShape *)node1->GetData();
			if (leftNode)
				newDivision->SetLeftSide((wxDivisionShape *)leftNode->GetData());
			if (topNode)
				newDivision->SetTopSide((wxDivisionShape *)topNode->GetData());
			if (rightNode)
				newDivision->SetRightSide((wxDivisionShape *)rightNode->GetData());
			if (bottomNode)
				newDivision->SetBottomSide((wxDivisionShape *)bottomNode->GetData());
		}
		node = node->GetNext();
	}
}
コード例 #9
0
bool wxDiagram::OnShapeLoad(wxExprDatabase& WXUNUSED(db), wxShape& shape, wxExpr& expr)
{
  shape.ReadAttributes(&expr);
  return true;
}