};
// Line object
+class wxLabelShape;
class wxLineShape: public wxShape
{
DECLARE_DYNAMIC_CLASS(wxLineShape)
void OnDrawControlPoints(wxDC& dc);
void OnEraseControlPoints(wxDC& dc);
void OnErase(wxDC& dc);
- virtual inline void OnMoveControlPoint(int WXUNUSED(which), double WXUNUSED(x), double WXUNUSED(y)) {}
+ virtual bool OnMoveControlPoint(int WXUNUSED(which), double WXUNUSED(x), double WXUNUSED(y)) { return FALSE; }
+ virtual bool OnMoveMiddleControlPoint(wxDC& dc, wxLineControlPoint* lpt, const wxRealPoint& pt);
+ virtual bool OnLabelMovePre(wxDC& dc, wxLabelShape* labelShape, double x, double y, double old_x, double old_y, bool display);
void OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void GetBoundingBoxMin(double *w, double *h);
void FormatText(wxDC& dc, const wxString& s, int regionId = 0);
// position is 0 (middle), 1 (start), 2 (end)
void GetLabelPosition(int position, double *x, double *y);
+ // Can override this to create a different class of label shape
+ virtual wxLabelShape* OnCreateLabelShape(wxLineShape *parent = NULL, wxShapeRegion *region = NULL, double w = 0.0, double h = 0.0);
+
// Straighten verticals and horizontals
- virtual void Straighten(wxDC& dc);
+ virtual void Straighten(wxDC* dc = NULL);
// Not implemented
inline void SetMaintainStraightLines(bool flag) { m_maintainStraightLines = flag; }
bool HitTest(double x, double y, int *attachment, double *distance);
#ifdef PROLOGIO
- // Prolog database stuff
- virtual char *GetFunctor();
- virtual void WritePrologAttributes(wxExpr *clause);
- virtual void ReadPrologAttributes(wxExpr *clause);
+ // I/O
+ virtual void WriteAttributes(wxExpr *clause);
+ virtual void ReadAttributes(wxExpr *clause);
#endif
virtual void FindNth(wxShape *image, int *nth, int *no_arcs, bool incoming);
// probably be the same)
wxList* m_lineControlPoints;
- double m_arrowSpacing; // Separation between adjacent arrows
+ double m_arrowSpacing; // Separation between adjacent arrows
wxShape* m_to;
wxShape* m_from;
-/*
- double m_actualTextWidth; // Space the text takes up
- double m_actualTextHeight; // (depends on text content unlike nodes)
-*/
int m_attachmentTo; // Attachment point at one end
int m_attachmentFrom; // Attachment point at other end