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 wxLineControlPoint
: public wxControlPoint
22 DECLARE_DYNAMIC_CLASS(wxLineControlPoint
)
23 friend class wxLineShape
;
26 wxLineControlPoint(wxShapeCanvas
*the_canvas
= NULL
, wxShape
*object
= NULL
, double size
= 0.0,
27 double x
= 0.0, double y
= 0.0, int the_type
= 0);
28 ~wxLineControlPoint();
30 void OnDraw(wxDC
& dc
);
31 void OnDragLeft(bool draw
, double x
, double y
, int keys
=0, int attachment
= 0);
32 void OnBeginDragLeft(double x
, double y
, int keys
=0, int attachment
= 0);
33 void OnEndDragLeft(double x
, double y
, int keys
=0, int attachment
= 0);
35 // Obsolete (left-dragging now moves attachment point to new relative position OR new
38 void OnDragRight(bool draw
, double x
, double y
, int keys
=0, int attachment
= 0);
39 void OnBeginDragRight(double x
, double y
, int keys
=0, int attachment
= 0);
40 void OnEndDragRight(double x
, double y
, int keys
=0, int attachment
= 0);
46 wxRealPoint
* m_point
; // Line point
47 wxRealPoint m_originalPos
;
52 * Temporary arc label object
55 class wxLabelShape
: public wxRectangleShape
57 DECLARE_DYNAMIC_CLASS(wxLabelShape
)
60 wxLabelShape(wxLineShape
*parent
= NULL
, wxShapeRegion
*region
= NULL
, double w
= 0.0, double h
= 0.0);
63 void OnDraw(wxDC
& dc
);
64 void OnDrawContents(wxDC
& dc
);
65 void OnLeftClick(double x
, double y
, int keys
= 0, int attachment
= 0);
66 void OnRightClick(double x
, double y
, int keys
= 0, int attachment
= 0);
67 void OnDragLeft(bool draw
, double x
, double y
, int keys
=0, int attachment
= 0);
68 void OnBeginDragLeft(double x
, double y
, int keys
=0, int attachment
= 0);
69 void OnEndDragLeft(double x
, double y
, int keys
=0, int attachment
= 0);
70 bool OnMovePre(wxDC
& dc
, double x
, double y
, double old_x
, double old_y
, bool display
= TRUE
);
73 wxLineShape
* m_lineShape
;
74 wxShapeRegion
* m_shapeRegion
;
79 * Get the point on the given line (x1, y1) (x2, y2)
80 * distance 'length' along from the end,
81 * returned values in x and y
84 void GetPointOnLine(double x1
, double y1
, double x2
, double y2
,
85 double length
, double *x
, double *y
);