1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: OGL constraint definitions
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _OGL_CONSTRNT_H_
13 #define _OGL_CONSTRNT_H_
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "constrnt.h"
25 class WXDLLIMPEXP_OGL wxOGLConstraintType
: public wxObject
27 DECLARE_DYNAMIC_CLASS(wxOGLConstraintType
)
29 wxOGLConstraintType(int type
= 0, const wxString
& name
= wxEmptyString
,
30 const wxString
& phrase
= wxEmptyString
);
31 ~wxOGLConstraintType();
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"
40 extern wxList
* wxOGLConstraintTypes
;
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
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
61 class WXDLLIMPEXP_OGL wxOGLConstraint
: public wxObject
63 DECLARE_DYNAMIC_CLASS(wxOGLConstraint
)
66 m_xSpacing
= 0.0; m_ySpacing
= 0.0; m_constraintType
= 0;
67 m_constraintName
= wxEmptyString
; m_constraintId
= 0;
68 m_constrainingObject
= NULL
; }
69 wxOGLConstraint(int type
, wxShape
*constraining
, wxList
& constrained
);
72 // Returns TRUE if anything changed
74 inline void SetSpacing(double x
, double y
) { m_xSpacing
= x
; m_ySpacing
= y
; };
75 bool Equals(double a
, double b
);
80 wxString m_constraintName
;
82 wxShape
* m_constrainingObject
;
83 wxList m_constrainedObjects
;
87 void OGLInitializeConstraintTypes();
88 void OGLCleanUpConstraintTypes();