]>
Commit | Line | Data |
---|---|---|
1fc25a89 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: constrnt.h | |
3 | // Purpose: OGL constraint definitions | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 12/07/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
2ba06d5a | 9 | // Licence: wxWindows licence |
1fc25a89 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _OGL_CONSTRNT_H_ | |
13 | #define _OGL_CONSTRNT_H_ | |
14 | ||
5f331691 | 15 | |
1fc25a89 JS |
16 | /* |
17 | * OGL Constraints | |
18 | * | |
19 | */ | |
20 | ||
5f331691 | 21 | class WXDLLIMPEXP_OGL wxOGLConstraintType: public wxObject |
1fc25a89 JS |
22 | { |
23 | DECLARE_DYNAMIC_CLASS(wxOGLConstraintType) | |
24 | public: | |
9e053640 RD |
25 | wxOGLConstraintType(int type = 0, const wxString& name = wxEmptyString, |
26 | const wxString& phrase = wxEmptyString); | |
1fc25a89 JS |
27 | ~wxOGLConstraintType(); |
28 | ||
29 | public: | |
30 | int m_type; // E.g. gyCONSTRAINT_CENTRED_VERTICALLY | |
31 | wxString m_name; // E.g. "Centre vertically" | |
32 | wxString m_phrase; // E.g. "centred vertically with respect to", "left of" | |
33 | ||
34 | }; | |
35 | ||
36 | extern wxList* wxOGLConstraintTypes; | |
37 | ||
38 | #define gyCONSTRAINT_CENTRED_VERTICALLY 1 | |
39 | #define gyCONSTRAINT_CENTRED_HORIZONTALLY 2 | |
40 | #define gyCONSTRAINT_CENTRED_BOTH 3 | |
41 | #define gyCONSTRAINT_LEFT_OF 4 | |
42 | #define gyCONSTRAINT_RIGHT_OF 5 | |
43 | #define gyCONSTRAINT_ABOVE 6 | |
44 | #define gyCONSTRAINT_BELOW 7 | |
45 | #define gyCONSTRAINT_ALIGNED_TOP 8 | |
46 | #define gyCONSTRAINT_ALIGNED_BOTTOM 9 | |
47 | #define gyCONSTRAINT_ALIGNED_LEFT 10 | |
48 | #define gyCONSTRAINT_ALIGNED_RIGHT 11 | |
49 | ||
50 | // Like aligned, but with the objects centred on the respective edge | |
51 | // of the reference object. | |
52 | #define gyCONSTRAINT_MIDALIGNED_TOP 12 | |
53 | #define gyCONSTRAINT_MIDALIGNED_BOTTOM 13 | |
54 | #define gyCONSTRAINT_MIDALIGNED_LEFT 14 | |
55 | #define gyCONSTRAINT_MIDALIGNED_RIGHT 15 | |
56 | ||
5f331691 | 57 | class WXDLLIMPEXP_OGL wxOGLConstraint: public wxObject |
1fc25a89 JS |
58 | { |
59 | DECLARE_DYNAMIC_CLASS(wxOGLConstraint) | |
60 | public: | |
9e053640 RD |
61 | wxOGLConstraint() { |
62 | m_xSpacing = 0.0; m_ySpacing = 0.0; m_constraintType = 0; | |
63 | m_constraintName = wxEmptyString; m_constraintId = 0; | |
64 | m_constrainingObject = NULL; } | |
1fc25a89 JS |
65 | wxOGLConstraint(int type, wxShape *constraining, wxList& constrained); |
66 | ~wxOGLConstraint(); | |
67 | ||
2ba06d5a | 68 | // Returns true if anything changed |
1fc25a89 JS |
69 | bool Evaluate(); |
70 | inline void SetSpacing(double x, double y) { m_xSpacing = x; m_ySpacing = y; }; | |
71 | bool Equals(double a, double b); | |
72 | ||
73 | double m_xSpacing; | |
74 | double m_ySpacing; | |
75 | int m_constraintType; | |
76 | wxString m_constraintName; | |
77 | long m_constraintId; | |
78 | wxShape* m_constrainingObject; | |
79 | wxList m_constrainedObjects; | |
80 | ||
81 | }; | |
82 | ||
83 | void OGLInitializeConstraintTypes(); | |
84 | void OGLCleanUpConstraintTypes(); | |
85 | ||
86 | #endif | |
87 | // _OGL_CONSTRNT_H_ |