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