]> git.saurik.com Git - wxWidgets.git/blame - utils/ogl/src/linesp.h
Added wxWindow::Center
[wxWidgets.git] / utils / ogl / src / linesp.h
CommitLineData
0fc1a713
JS
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
2bb0cd28 19class wxLineShape;
0fc1a713
JS
20class wxLineControlPoint: public wxControlPoint
21{
22 DECLARE_DYNAMIC_CLASS(wxLineControlPoint)
2bb0cd28 23 friend class wxLineShape;
0fc1a713
JS
24 public:
25
26 wxLineControlPoint(wxShapeCanvas *the_canvas = NULL, wxShape *object = NULL, float size = 0.0,
27 float x = 0.0, float y = 0.0, int the_type = 0);
28 ~wxLineControlPoint();
29
30 void OnDraw(wxDC& dc);
31 void OnDragLeft(bool draw, float x, float y, int keys=0, int attachment = 0);
32 void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
33 void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
34
35 void OnDragRight(bool draw, float x, float y, int keys=0, int attachment = 0);
36 void OnBeginDragRight(float x, float y, int keys=0, int attachment = 0);
37 void OnEndDragRight(float x, float y, int keys=0, int attachment = 0);
38
39public:
40
41 int m_type;
42 wxRealPoint* m_point; // Line point
43
44};
45
46/*
47 * Temporary arc label object
48 */
49
50class wxLabelShape: public wxRectangleShape
51{
52 DECLARE_DYNAMIC_CLASS(wxLabelShape)
53
54 public:
55 wxLabelShape(wxLineShape *parent = NULL, wxShapeRegion *region = NULL, float w = 0.0, float h = 0.0);
56 ~wxLabelShape();
57
58 void OnDraw(wxDC& dc);
59 void OnDrawContents(wxDC& dc);
60 void OnLeftClick(float x, float y, int keys = 0, int attachment = 0);
61 void OnRightClick(float x, float y, int keys = 0, int attachment = 0);
62 void OnDragLeft(bool draw, float x, float y, int keys=0, int attachment = 0);
63 void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
64 void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
65 bool OnMovePre(wxDC& dc, float x, float y, float old_x, float old_y, bool display = TRUE);
66
67public:
68 wxLineShape* m_lineShape;
69 wxShapeRegion* m_shapeRegion;
70
71};
72
73/*
74 * Get the point on the given line (x1, y1) (x2, y2)
75 * distance 'length' along from the end,
76 * returned values in x and y
77 */
78
79void GetPointOnLine(float x1, float y1, float x2, float y2,
80 float length, float *x, float *y);
81
82#endif
83 // _OGL_LINESP_H_
84