wx.IndividualLayoutConstraint

Inheritance diagram for wx.IndividualLayoutConstraint:



Description

Objects of this class are stored in the wx.LayoutConstraint class as one of eight possible constraints that a window can be involved in.

Constraints are initially set to have the relationship wx.Unconstrained, which means that their values should be calculated by looking at known constraints.

Constraint Flags

The Edge specifies the type of edge or dimension of a window.

Edges Description
wx.Left The left edge.
wx.Top The top edge.
wx.Right The right edge.
wx.Bottom The bottom edge.
wx.CentreX The x-coordinate of the centre of the window.
wx.CentreY The y-coordinate of the centre of the window.

The Relationship specifies the relationship that this edge or dimension has with another specified edge or dimension. Normally, the user doesn’t use these directly because functions such as Below and RightOf are a convenience for using the more general Set function.

Relationships Description
wx.Unconstrained The edge or dimension is unconstrained (the default for edges.)
wx.AsIs The edge or dimension is to be taken from the current window position or size (the default for dimensions.)
wx.Above The edge should be above another edge.
wx.Below The edge should be below another edge.
wx.LeftOf The edge should be to the left of another edge.
wx.RightOf The edge should be to the right of another edge.
wx.SameAs The edge or dimension should be the same as another edge or dimension.
wx.PercentOf The edge or dimension should be a percentage of another edge or dimension.
wx.Absolute The edge or dimension should be a given absolute value.

Derived From

Class API

Methods

__init__()
No docstrings available for this method.

Above(otherWin, margin=0)

Constrains this edge to be above the given window, with an optional margin. Implicitly, this is relative to the top edge of the other window.

Parameters:


Absolute(value)

Constrains this edge or dimension to be the given absolute value.

Parameters:

  • value (int)

AsIs()

Sets this edge or constraint to be whatever the window’s value is at the moment.

If either of the width and height constraints are as is, the window will not be resized, but moved instead. This is important when considering panel items which are intended to have a default size, such as a button, which may take its size from the size of the button label.


Below(otherWin, margin=0)

Constrains this edge to be below the given window, with an optional margin. Implicitly, this is relative to the bottom edge of the other window.

Parameters:


GetDone()
No docstrings available for this method.

GetEdge(which, thisWin, other)

Get the value of this edge or dimension, or if this is not determinable, -1.

Parameters:


Returns:

int


GetMargin()
No docstrings available for this method.

GetMyEdge()
No docstrings available for this method.

GetOtherEdge()
No docstrings available for this method.

GetOtherWindow()
No docstrings available for this method.

GetPercent()
No docstrings available for this method.

GetRelationship()
No docstrings available for this method.

GetValue()
No docstrings available for this method.

LeftOf(otherWin, margin=0)

Constrains this edge to be to the left of the given window, with an optional margin. Implicitly, this is relative to the left edge of the other window.

Parameters:


PercentOf(otherWin, edge, per)

Constrains this edge or dimension to be to a percentage of the given window, with an optional margin.

Parameters:


ResetIfWin(otherW)

Reset constraint if it mentions otherW.

Parameters:


Returns:

bool


RightOf(otherWin, margin=0)

Constrains this edge to be to the right of the given window, with an optional margin. Implicitly, this is relative to the right edge of the other window.

Parameters:


SameAs(otherWin)

Constrains this edge or dimension to be to the same as the edge of the given window, with an optional margin.

Parameters:


SatisfyConstraint(constraints, win)

Try to satisfy constraint.

Parameters:


Returns:

bool


Set(rel)

Sets the properties of the constraint. Normally called by one of the convenience functions such as Above, RightOf, SameAs.

Parameters:

  • rel (int)

SetDone(d)

Parameters:

  • d (bool)

SetEdge(which)

Parameters:

  • which (int)

SetMargin(m)

Parameters:

  • m (int)

SetRelationship(r)

Parameters:

  • r (int)

SetValue(v)

Parameters:

  • v (int)

Unconstrained()
Sets this edge or dimension to be unconstrained, that is, dependent on other edges and dimensions from which this value can be deduced.

Properties

Done
See GetDone and SetDone
Margin
See GetMargin and SetMargin
MyEdge
See GetMyEdge
OtherEdge
See GetOtherEdge
OtherWindow
See GetOtherWindow
Percent
See GetPercent
Relationship
See GetRelationship and SetRelationship
Value
See GetValue and SetValue