]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: linesp.h | |
3 | // Purpose: Lines private header file | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 12/07/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _OGL_LINESP_H_ | |
13 | #define _OGL_LINESP_H_ | |
14 | ||
15 | #if defined(__GNUG__) && !defined(__APPLE__) | |
16 | #pragma interface "linesp.h" | |
17 | #endif | |
18 | ||
19 | ||
20 | class WXDLLIMPEXP_OGL wxLineShape; | |
21 | class WXDLLIMPEXP_OGL wxLineControlPoint: public wxControlPoint | |
22 | { | |
23 | DECLARE_DYNAMIC_CLASS(wxLineControlPoint) | |
24 | friend class WXDLLIMPEXP_OGL wxLineShape; | |
25 | public: | |
26 | ||
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(); | |
30 | ||
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); | |
35 | ||
36 | // Obsolete (left-dragging now moves attachment point to new relative position OR new | |
37 | // attachment id) | |
38 | #if 0 | |
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); | |
42 | #endif | |
43 | ||
44 | public: | |
45 | ||
46 | int m_type; | |
47 | wxRealPoint* m_point; // Line point | |
48 | wxRealPoint m_originalPos; | |
49 | ||
50 | }; | |
51 | ||
52 | /* | |
53 | * Temporary arc label object | |
54 | */ | |
55 | ||
56 | class WXDLLIMPEXP_OGL wxLabelShape: public wxRectangleShape | |
57 | { | |
58 | DECLARE_DYNAMIC_CLASS(wxLabelShape) | |
59 | ||
60 | public: | |
61 | wxLabelShape(wxLineShape *parent = NULL, wxShapeRegion *region = NULL, double w = 0.0, double h = 0.0); | |
62 | ~wxLabelShape(); | |
63 | ||
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); | |
72 | ||
73 | public: | |
74 | wxLineShape* m_lineShape; | |
75 | wxShapeRegion* m_shapeRegion; | |
76 | ||
77 | }; | |
78 | ||
79 | /* | |
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 | |
83 | */ | |
84 | ||
85 | void GetPointOnLine(double x1, double y1, double x2, double y2, | |
86 | double length, double *x, double *y); | |
87 | ||
88 | #endif | |
89 | // _OGL_LINESP_H_ | |
90 |