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