csEvtHandler& csCopy = (csEvtHandler&) copy;
csCopy.m_label = m_label;
}
-
+
void csEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, int WXUNUSED(attachment))
{
wxClientDC dc(GetShape()->GetCanvas());
}
else
{
+#if wxUSE_STATUSBAR
((wxFrame*)wxGetApp().GetTopWindow())->SetStatusText(m_label);
+#endif // wxUSE_STATUSBAR
}
}
wxClientDC dc(GetShape()->GetCanvas());
GetShape()->GetCanvas()->PrepareDC(dc);
- wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+ wxPen dottedPen(*wxBLACK, 1, wxDOT);
dc.SetLogicalFunction(OGLRBLF);
dc.SetPen(dottedPen);
double xp, yp;
wxClientDC dc(GetShape()->GetCanvas());
GetShape()->GetCanvas()->PrepareDC(dc);
- wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+ wxPen dottedPen(*wxBLACK, 1, wxDOT);
dc.SetLogicalFunction(OGLRBLF);
dc.SetPen(dottedPen);
double xp, yp;
// Check if we're on an object
int new_attachment;
wxShape *otherShape = canvas->FindFirstSensitiveShape(x, y, &new_attachment, OP_DRAG_RIGHT);
-
+
if (otherShape && !otherShape->IsKindOf(CLASSINFO(wxLineShape)))
{
wxLineShape* theShape = new csLineShape;
dc.SetLogicalFunction(OGLRBLF);
- wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+ wxPen dottedPen(*wxBLACK, 1, wxDOT);
dc.SetPen(dottedPen);
dc.SetBrush(* wxTRANSPARENT_BRUSH);
GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h);
// Draw bounding box for other selected shapes
- wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
+ wxObjectList::compatibility_iterator node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node)
{
wxShape* shape = (wxShape*) node->GetData();
dc.SetLogicalFunction(OGLRBLF);
- wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+ wxPen dottedPen(*wxBLACK, 1, wxDOT);
dc.SetPen(dottedPen);
dc.SetBrush((* wxTRANSPARENT_BRUSH));
GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h);
// Draw bounding box for other selected shapes
- wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
+ wxObjectList::compatibility_iterator node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node)
{
wxShape* shape = (wxShape*) node->GetData();
new csCommandState(ID_CS_MOVE, newShape, GetShape()));
// Move line points
- wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
+ wxObjectList::compatibility_iterator node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node)
{
wxShape* shape = (wxShape*) node->GetData();
{
wxLineShape* newLineShape = (wxLineShape*) lineShape->CreateNewCopy();
- wxNode *node1 = newLineShape->GetLineControlPoints()->GetFirst();
+ wxObjectList::compatibility_iterator node1 = newLineShape->GetLineControlPoints()->GetFirst();
while (node1)
{
wxRealPoint *point = (wxRealPoint *)node1->GetData();
/*
* Diagram
*/
-
+
bool csDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
{
wxDiagram::OnShapeSave(db, shape, expr);
expr.GetAttributeValue(_T("label"), label);
csEvtHandler *handler = new csEvtHandler(&shape, &shape, label);
shape.SetEventHandler(handler);
-
+
return true;
}
break;
double theta = shape->GetRotation();
- const double myPi = 3.1415926535897932384626433832795 ;
+ const double myPi = M_PI;
double ninetyDegrees = myPi/2.0;
wxString opStr;