Package wx :: Class IndividualLayoutConstraint
[frames | no frames]

Type IndividualLayoutConstraint

object --+    
         |    
    Object --+
             |
            IndividualLayoutConstraint


Objects of this class are stored in the wx.LayoutConstraints class as one of eight possible constraints that a window can be involved in. You will never need to create an instance of wx.IndividualLayoutConstraint, rather you should create a wx.LayoutConstraints instance and use the individual contstraints that it contains.

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

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

Edges

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

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.

See Also:

wx.LayoutConstraints, wx.Window.SetConstraints

Method Summary
  __init__(self)
  Above(self, sibling, marg)
Constrains this edge to be above the given window, with an optional margin.
  Absolute(self, val)
Constrains this edge or dimension to be the given absolute value.
  AsIs(self)
Sets this edge or constraint to be whatever the window's value is at the moment.
  Below(self, sibling, marg)
Constrains this edge to be below the given window, with an optional margin.
bool GetDone(self)
int GetEdge(self, which, thisWin, other)
Get the value of this edge or dimension, or if this is not determinable, -1.
int GetMargin(self)
int GetMyEdge(self)
int GetOtherEdge(self)
Window GetOtherWindow(self)
int GetPercent(self)
int GetRelationship(self)
int GetValue(self)
  LeftOf(self, sibling, marg)
Constrains this edge to be to the left of the given window, with an optional margin.
  PercentOf(self, otherW, wh, per)
Constrains this edge or dimension to be to a percentage of the given window, with an optional margin.
bool ResetIfWin(self, otherW)
Reset constraint if it mentions otherWin
  RightOf(self, sibling, marg)
Constrains this edge to be to the right of the given window, with an optional margin.
  SameAs(self, otherW, edge, marg)
Constrains this edge or dimension to be to the same as the edge of the given window, with an optional margin.
bool SatisfyConstraint(self, constraints, win)
Try to satisfy constraint
  Set(self, rel, otherW, otherE, val, marg)
Sets the properties of the constraint.
  SetDone(self, d)
  SetEdge(self, which)
  SetMargin(self, m)
  SetRelationship(self, r)
  SetValue(self, v)
  Unconstrained(self)
Sets this edge or dimension to be unconstrained, that is, dependent on other edges and dimensions from which this value can be deduced.

Property Summary
  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
  thisown: The membership flag
  Value: See GetValue and SetValue

Method Details

Above(self, sibling, marg=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:
sibling
           (type=Window)

marg
           (type=int)

Absolute(self, val)

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

Parameters:
val
           (type=int)

AsIs(self)

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(self, sibling, marg=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:
sibling
           (type=Window)

marg
           (type=int)

GetEdge(self, which, thisWin, other)

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

Parameters:
which
           (type=int)

thisWin
           (type=Window)

other
           (type=Window)

Returns:
int

LeftOf(self, sibling, marg=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:
sibling
           (type=Window)

marg
           (type=int)

PercentOf(self, otherW, wh, per)

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

Parameters:
otherW
           (type=Window)

wh
           (type=int)

per
           (type=int)

ResetIfWin(self, otherW)

Reset constraint if it mentions otherWin

Parameters:
otherW
           (type=Window)

Returns:
bool

RightOf(self, sibling, marg=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:
sibling
           (type=Window)

marg
           (type=int)

SameAs(self, otherW, edge, marg=0)

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

Parameters:
otherW
           (type=Window)

edge
           (type=int)

marg
           (type=int)

SatisfyConstraint(self, constraints, win)

Try to satisfy constraint

Parameters:
constraints
           (type=LayoutConstraints)

win
           (type=Window)

Returns:
bool

Set(self, rel, otherW, otherE, val=0, marg=wxLAYOUT_DEFAULT_MARGIN)

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

Parameters:
rel
           (type=int)

otherW
           (type=Window)

otherE
           (type=int)

val
           (type=int)

marg
           (type=int)

Unconstrained(self)

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


Property Details

Done

See GetDone and SetDone

Get Method:
GetDone(self)
Set Method:
SetDone(self, d)

Margin

See GetMargin and SetMargin

Get Method:
GetMargin(self)
Set Method:
SetMargin(self, m)

MyEdge

See GetMyEdge

Get Method:
GetMyEdge(self)

OtherEdge

See GetOtherEdge

Get Method:
GetOtherEdge(self)

OtherWindow

See GetOtherWindow

Get Method:
GetOtherWindow(self)

Percent

See GetPercent

Get Method:
GetPercent(self)

Relationship

See GetRelationship and SetRelationship

Get Method:
GetRelationship(self)
Set Method:
SetRelationship(self, r)

thisown

The membership flag

Value

See GetValue and SetValue

Get Method:
GetValue(self)
Set Method:
SetValue(self, v)

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:13:29 2007 http://epydoc.sf.net