1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _constraints.i
3 // Purpose: SWIG interface defs for the layout constraints
7 // Created: 3-July-1997
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
21 //---------------------------------------------------------------------------
27 wxLeft, wxTop, wxRight, wxBottom, wxWidth, wxHeight,
28 wxCentre, wxCenter = wxCentre, wxCentreX, wxCentreY
45 // wxIndividualLayoutConstraint: a constraint on window position
46 class wxIndividualLayoutConstraint : public wxObject
49 // wxIndividualLayoutConstraint();
50 // ~wxIndividualLayoutConstraint();
52 void Set(wxRelationship rel, wxWindow *otherW, wxEdge otherE, int val = 0, int marg = wxLAYOUT_DEFAULT_MARGIN);
55 // Sibling relationships
57 void LeftOf(wxWindow *sibling, int marg = 0);
58 void RightOf(wxWindow *sibling, int marg = 0);
59 void Above(wxWindow *sibling, int marg = 0);
60 void Below(wxWindow *sibling, int marg = 0);
63 // 'Same edge' alignment
65 void SameAs(wxWindow *otherW, wxEdge edge, int marg = 0);
67 // The edge is a percentage of the other window's edge
68 void PercentOf(wxWindow *otherW, wxEdge wh, int per);
71 // Edge has absolute value
73 void Absolute(int val);
76 // Dimension is unconstrained
78 void Unconstrained() { relationship = wxUnconstrained; }
81 // Dimension is 'as is' (use current size settings)
83 void AsIs() { relationship = wxAsIs; }
88 wxWindow *GetOtherWindow();
89 wxEdge GetMyEdge() const;
90 void SetEdge(wxEdge which);
93 void SetMargin(int m);
95 int GetPercent() const;
96 int GetOtherEdge() const;
99 wxRelationship GetRelationship();
100 void SetRelationship(wxRelationship r);
102 // Reset constraint if it mentions otherWin
103 bool ResetIfWin(wxWindow *otherW);
105 // Try to satisfy constraint
106 bool SatisfyConstraint(wxLayoutConstraints *constraints, wxWindow *win);
108 // Get the value of this edge or dimension, or if this
109 // is not determinable, -1.
110 int GetEdge(wxEdge which, wxWindow *thisWin, wxWindow *other) const;
115 // wxLayoutConstraints: the complete set of constraints for a window
116 class wxLayoutConstraints : public wxObject
121 wxIndividualLayoutConstraint left;
122 wxIndividualLayoutConstraint top;
123 wxIndividualLayoutConstraint right;
124 wxIndividualLayoutConstraint bottom;
126 wxIndividualLayoutConstraint width;
127 wxIndividualLayoutConstraint height;
128 // Centre constraints
129 wxIndividualLayoutConstraint centreX;
130 wxIndividualLayoutConstraint centreY;
133 wxLayoutConstraints();
137 bool, SatisfyConstraints(wxWindow *win, int *OUTPUT),
138 "SatisfyConstraints(Window win) -> (areSatisfied, noChanges)");
140 bool AreSatisfied() const;
143 //---------------------------------------------------------------------------