]> git.saurik.com Git - wxWidgets.git/blob - utils/ogl/src/linesp.h
Added SetFont to most controls and controls sample
[wxWidgets.git] / utils / ogl / src / linesp.h
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 #ifdef __GNUG__
16 #pragma interface "linesp.h"
17 #endif
18
19 class wxLineShape;
20 class wxLineControlPoint: public wxControlPoint
21 {
22 DECLARE_DYNAMIC_CLASS(wxLineControlPoint)
23 friend class wxLineShape;
24 public:
25
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();
29
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);
34
35 // Obsolete (left-dragging now moves attachment point to new relative position OR new
36 // attachment id)
37 #if 0
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);
41 #endif
42
43 public:
44
45 int m_type;
46 wxRealPoint* m_point; // Line point
47
48 };
49
50 /*
51 * Temporary arc label object
52 */
53
54 class wxLabelShape: public wxRectangleShape
55 {
56 DECLARE_DYNAMIC_CLASS(wxLabelShape)
57
58 public:
59 wxLabelShape(wxLineShape *parent = NULL, wxShapeRegion *region = NULL, double w = 0.0, double h = 0.0);
60 ~wxLabelShape();
61
62 void OnDraw(wxDC& dc);
63 void OnDrawContents(wxDC& dc);
64 void OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
65 void OnRightClick(double x, double y, int keys = 0, int attachment = 0);
66 void OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
67 void OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
68 void OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
69 bool OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
70
71 public:
72 wxLineShape* m_lineShape;
73 wxShapeRegion* m_shapeRegion;
74
75 };
76
77 /*
78 * Get the point on the given line (x1, y1) (x2, y2)
79 * distance 'length' along from the end,
80 * returned values in x and y
81 */
82
83 void GetPointOnLine(double x1, double y1, double x2, double y2,
84 double length, double *x, double *y);
85
86 #endif
87 // _OGL_LINESP_H_
88