1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Lines private header file
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _OGL_LINESP_H_
13 #define _OGL_LINESP_H_
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "linesp.h"
20 class WXDLLIMPEXP_OGL wxLineShape
;
21 class WXDLLIMPEXP_OGL wxLineControlPoint
: public wxControlPoint
23 DECLARE_DYNAMIC_CLASS(wxLineControlPoint
)
24 friend class WXDLLIMPEXP_OGL wxLineShape
;
27 wxLineControlPoint(wxShapeCanvas
*the_canvas
= NULL
, wxShape
*object
= NULL
, double size
= 0.0,
28 double x
= 0.0, double y
= 0.0, int the_type
= 0);
29 ~wxLineControlPoint();
31 void OnDraw(wxDC
& dc
);
32 void OnDragLeft(bool draw
, double x
, double y
, int keys
=0, int attachment
= 0);
33 void OnBeginDragLeft(double x
, double y
, int keys
=0, int attachment
= 0);
34 void OnEndDragLeft(double x
, double y
, int keys
=0, int attachment
= 0);
36 // Obsolete (left-dragging now moves attachment point to new relative position OR new
39 void OnDragRight(bool draw
, double x
, double y
, int keys
=0, int attachment
= 0);
40 void OnBeginDragRight(double x
, double y
, int keys
=0, int attachment
= 0);
41 void OnEndDragRight(double x
, double y
, int keys
=0, int attachment
= 0);
47 wxRealPoint
* m_point
; // Line point
48 wxRealPoint m_originalPos
;
53 * Temporary arc label object
56 class WXDLLIMPEXP_OGL wxLabelShape
: public wxRectangleShape
58 DECLARE_DYNAMIC_CLASS(wxLabelShape
)
61 wxLabelShape(wxLineShape
*parent
= NULL
, wxShapeRegion
*region
= NULL
, double w
= 0.0, double h
= 0.0);
64 void OnDraw(wxDC
& dc
);
65 void OnDrawContents(wxDC
& dc
);
66 void OnLeftClick(double x
, double y
, int keys
= 0, int attachment
= 0);
67 void OnRightClick(double x
, double y
, int keys
= 0, int attachment
= 0);
68 void OnDragLeft(bool draw
, double x
, double y
, int keys
=0, int attachment
= 0);
69 void OnBeginDragLeft(double x
, double y
, int keys
=0, int attachment
= 0);
70 void OnEndDragLeft(double x
, double y
, int keys
=0, int attachment
= 0);
71 bool OnMovePre(wxDC
& dc
, double x
, double y
, double old_x
, double old_y
, bool display
= true);
74 wxLineShape
* m_lineShape
;
75 wxShapeRegion
* m_shapeRegion
;
80 * Get the point on the given line (x1, y1) (x2, y2)
81 * distance 'length' along from the end,
82 * returned values in x and y
85 void GetPointOnLine(double x1
, double y1
, double x2
, double y2
,
86 double length
, double *x
, double *y
);