X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/42cfaf8cd4464466398ed888cb2caa5ee360c7ef..77902671753529da1345efb71ff6017cb882bedc:/utils/ogl/src/lines.h diff --git a/utils/ogl/src/lines.h b/utils/ogl/src/lines.h index e15a64b93d..9619bf75cf 100644 --- a/utils/ogl/src/lines.h +++ b/utils/ogl/src/lines.h @@ -88,6 +88,7 @@ class wxArrowHead: public wxObject }; // Line object +class wxLabelShape; class wxLineShape: public wxShape { DECLARE_DYNAMIC_CLASS(wxLineShape) @@ -107,7 +108,9 @@ class wxLineShape: public wxShape 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); @@ -139,8 +142,11 @@ class wxLineShape: public wxShape // 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; } @@ -183,10 +189,9 @@ class wxLineShape: public wxShape 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); @@ -271,15 +276,11 @@ protected: // 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