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