Envision
A visual programming IDE for object-oriented languages
|
An anchor is a constraint on how two elements are positioned relative to each other along one axis. More...
Public Types | |
enum class | Orientation : int { Auto , Horizontal , Vertical } |
Public Member Functions | |
AnchorLayoutAnchor (const AnchorLayoutAnchor &)=default | |
AnchorLayoutAnchor (float relativePlaceEdgePosition, FormElement *placeElement, int offset, float relativeFixedEdgePosition, FormElement *fixedElement) | |
virtual | ~AnchorLayoutAnchor () |
virtual AnchorLayoutAnchor * | clone () const |
bool | dependsOn (AnchorLayoutAnchor *other, QList< AnchorLayoutAnchor * > &allConstraints) |
Returns whether this anchor depends on other, given the list of all anchors (allConstraints). More... | |
int | execute (Item *item, Orientation orientation) |
Returns the position on the orientation axis of the element to be placed, assuming its size for item was already calculated, and the position on the orientation axis of the fixed element is already fixed for item. More... | |
FormElement * | fixedElement () const |
Returns the fixed element. More... | |
int | offset () const |
Returns the offset. More... | |
AnchorLayoutAnchor & | operator= (const AnchorLayoutAnchor &)=delete |
FormElement * | placeElement () const |
Returns the place element. More... | |
float | relativeFixedEdgePosition () const |
Returns the relative fixed edge position. More... | |
float | relativePlaceEdgePosition () const |
Returns the relative place edge position. More... | |
Private Member Functions | |
void | setFixedElement (FormElement *el) |
void | setPlaceElement (FormElement *el) |
Private Attributes | |
FormElement * | fixedElement_ {} |
int | offset_ {} |
FormElement * | placeElement_ {} |
float | relativeFixedEdgePosition_ {} |
float | relativePlaceEdgePosition_ {} |
Friends | |
class | AnchorLayoutFormElement |
An anchor is a constraint on how two elements are positioned relative to each other along one axis.
This class holds information about one such constraint. Also, if there are no circular dependencies on the axis to compute, and the fixed element of this class is really already fixed, the method execute can be used to calculate the position of the place element.
|
strong |
Visualization::AnchorLayoutAnchor::AnchorLayoutAnchor | ( | float | relativePlaceEdgePosition, |
FormElement * | placeElement, | ||
int | offset, | ||
float | relativeFixedEdgePosition, | ||
FormElement * | fixedElement | ||
) |
|
default |
|
virtual |
|
virtual |
bool Visualization::AnchorLayoutAnchor::dependsOn | ( | AnchorLayoutAnchor * | other, |
QList< AnchorLayoutAnchor * > & | allConstraints | ||
) |
Returns whether this anchor depends on other, given the list of all anchors (allConstraints).
int Visualization::AnchorLayoutAnchor::execute | ( | Item * | item, |
Orientation | orientation | ||
) |
Returns the position on the orientation axis of the element to be placed, assuming its size for item was already calculated, and the position on the orientation axis of the fixed element is already fixed for item.
|
inline |
Returns the fixed element.
|
inline |
Returns the offset.
|
delete |
|
inline |
Returns the place element.
|
inline |
Returns the relative fixed edge position.
|
inline |
Returns the relative place edge position.
|
inlineprivate |
|
inlineprivate |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |