Envision
A visual programming IDE for object-oriented languages
|
Public Member Functions | |
AnchorLayoutFormElement () | |
AnchorLayoutFormElement (const AnchorLayoutFormElement &other) | |
virtual | ~AnchorLayoutFormElement () |
virtual AnchorLayoutFormElement * | clone () const override |
virtual void | computeSize (Item *item, int availableWidth, int availableHeight) override |
AnchorLayoutFormElement & | operator= (const AnchorLayoutFormElement &)=delete |
AnchorLayoutFormElement * | put (PlaceEdge placeEdge, FormElement *placeElement, AtEdge atEdge, FormElement *fixedElement) |
Add an anchor to the layout, placing the placeEdge of the placeElement at the atEdge of the fixedElement. More... | |
AnchorLayoutFormElement * | put (PlaceEdge placeEdge, FormElement *placeElement, float relativeEdgePosition, FormElement *fixedElement) |
Add an anchor to the layout, placing the placeEdge of the placeElement at the position fixedElement.position + fixedElement.size * relativeEdge in the axis given by the placeEdge. More... | |
AnchorLayoutFormElement * | put (PlaceEdge placeEdge, FormElement *placeElement, int offset, FromEdge fromEdge, FormElement *fixedElement) |
Add an anchor to the layout, placing the placeEdge of the placeElement offset units from the fromEdge of the fixedElement. More... | |
virtual bool | sizeDependsOnParent (const Item *item) const override |
![]() | |
AnchorLayoutFormElement * | setHasCursorWhenEmpty (std::function< bool(Item *item)> hasCursorWhenEmptyGetter) |
Sets a getter (cursorWhenEmptyGetter) for checking if the element should have cursors when empty dynamically while rendering. More... | |
AnchorLayoutFormElement * | setNoBoundaryCursors (std::function< bool(Item *item)> noBoundaryCursorsGetter) |
Sets a getter (noBoundaryCursorsGetter) for checking if the element should not have any boundary cursors dynamically while rendering. More... | |
AnchorLayoutFormElement * | setNoInnerCursors (std::function< bool(Item *item)> noInnerCursorsGetter) |
Sets a getter (noInnerCursorsGetter) for checking if the element should not have any inner cursors dynamically while rendering. More... | |
AnchorLayoutFormElement * | setNotLocationEquivalentCursors (std::function< bool(Item *item)> notLocationEquivalentCursorsGetter) |
Sets a getter (notLocationEquivalentGetter) for checking if the element's cursors are not location equivalent dynamically while rendering. More... | |
![]() | |
NewFormElement * | setBottomMargin (int bottom) |
Sets the bottom margin of this form element. More... | |
NewFormElement * | setLeftMargin (int left) |
Sets the left margin of this form element. More... | |
NewFormElement * | setMargins (int left, int top, int right, int bottom) |
Sets the left, top, right and bottom margins to the respective values. More... | |
NewFormElement * | setMargins (int margin) |
Sets all the margins of this form element to the value specified as margin. More... | |
NewFormElement * | setRightMargin (int right) |
Sets the right margin of this form element. More... | |
NewFormElement * | setTopMargin (int top) |
Sets the top margin of this form element. More... | |
Private Types | |
enum | Edge { Left , Right , Center , VCenter , HCenter , Top , Bottom } |
Private Member Functions | |
void | addConstraint (QList< AnchorLayoutAnchor * > &constraints, AnchorLayoutAnchor::Orientation orientation, float relativePlaceEdgePosition, FormElement *placeElement, int offset, float relativeFixedEdgePosition, FormElement *fixedElement) |
Adds a constraint, consisting of the orientation, the relativePlaceEdgePosition, the placeElement, the offset, the relativeFixedEdgePosition, and the fixedElement to the list of constraints. More... | |
void | cloneConstraints (QList< AnchorLayoutAnchor * > &thisConstraints, const QList< AnchorLayoutAnchor * > &otherConstraints, QMap< FormElement *, FormElement * > &matching) |
Clones one set of constraints. More... | |
FormElement * | findChildMatch (FormElement *element) |
Finds the proper match for element when putting it into the anchor layout. More... | |
AnchorLayoutAnchor::Orientation | inferOrientation (Edge firstEdge, Edge secondEdge) |
Computes orientation of firstEdge and secondEdge, fails if orientation cannot be inferred (both are Center) of if the edges have conflicting orientations (e.g. More... | |
AnchorLayoutAnchor::Orientation | orientation (Edge edge) |
Returns the orientation of the given edge. More... | |
int | placeElements (QList< AnchorLayoutAnchor * > &constraints, AnchorLayoutAnchor::Orientation orientation, Item *item) |
Computes the positions in the orientation of all the elements for this item, using the list of constraints. More... | |
AnchorLayoutFormElement * | put (AnchorLayoutAnchor::Orientation orientation, float relativePlaceEdgePosition, FormElement *placeElement, int offset, float relativeFixedEdgePosition, FormElement *fixedElement) |
General method, that all the other put methods get translated to. More... | |
float | relativePosition (Edge edge) |
Returns the relative position in an element of this edge. More... | |
void | sortConstraints (QList< AnchorLayoutAnchor * > &constraints, AnchorLayoutAnchor::Orientation orientation) |
Sorts the constraints by what needs to be done first. More... | |
Private Attributes | |
BorderFormElement * | borderFormElement_ {} |
QMap< FormElement *, FormElement * > | externalMatches_ {} |
QList< AnchorLayoutAnchor * > | horizontalConstraints_ {} |
AnchorLayoutConstraintSolver * | horizontalSolver_ {} |
bool | needsHorizontalSolver_ {} |
bool | needsVerticalSolver_ {} |
QList< AnchorLayoutAnchor * > | verticalConstraints_ {} |
AnchorLayoutConstraintSolver * | verticalSolver_ {} |
|
private |
Visualization::AnchorLayoutFormElement::AnchorLayoutFormElement | ( | ) |
Visualization::AnchorLayoutFormElement::AnchorLayoutFormElement | ( | const AnchorLayoutFormElement & | other | ) |
|
virtual |
|
private |
Adds a constraint, consisting of the orientation, the relativePlaceEdgePosition, the placeElement, the offset, the relativeFixedEdgePosition, and the fixedElement to the list of constraints.
|
overridevirtual |
|
private |
Clones one set of constraints.
|
overridevirtual |
|
private |
Finds the proper match for element when putting it into the anchor layout.
When putting an element into an Anchor layout sveral situations can occur:
|
private |
Computes orientation of firstEdge and secondEdge, fails if orientation cannot be inferred (both are Center) of if the edges have conflicting orientations (e.g.
Orientation::Left and Orientation::Top). Returns either Orientation::Horizontal or Orientation::Vertical.
|
delete |
|
private |
Returns the orientation of the given edge.
(E.g. horizontal for left, vertical for top, ...) If the orientation is not given for this edge (i.e. it is center), returns Orientation::Auto.
|
private |
Computes the positions in the orientation of all the elements for this item, using the list of constraints.
|
private |
General method, that all the other put methods get translated to.
It puts an anchor in the orientation, and places the relativePlaceEdgePosition of placeElement offset from the relativeFixedEdgePositon of the fixedElement.
If any of placeElement or fixedElement are already used elsewhere (have a parent or are a form root) then they are first cloned, and the corresponding clone is used for the anchor instead.
Returns a pointer to this AnchorLayoutElement.
AnchorLayoutFormElement * Visualization::AnchorLayoutFormElement::put | ( | PlaceEdge | placeEdge, |
FormElement * | placeElement, | ||
AtEdge | atEdge, | ||
FormElement * | fixedElement | ||
) |
Add an anchor to the layout, placing the placeEdge of the placeElement at the atEdge of the fixedElement.
Returns a pointer to this AnchorLayoutElement.
AnchorLayoutFormElement * Visualization::AnchorLayoutFormElement::put | ( | PlaceEdge | placeEdge, |
FormElement * | placeElement, | ||
float | relativeEdgePosition, | ||
FormElement * | fixedElement | ||
) |
Add an anchor to the layout, placing the placeEdge of the placeElement at the position fixedElement.position + fixedElement.size * relativeEdge in the axis given by the placeEdge.
Returns a pointer to this AnchorLayoutElement.
AnchorLayoutFormElement * Visualization::AnchorLayoutFormElement::put | ( | PlaceEdge | placeEdge, |
FormElement * | placeElement, | ||
int | offset, | ||
FromEdge | fromEdge, | ||
FormElement * | fixedElement | ||
) |
Add an anchor to the layout, placing the placeEdge of the placeElement offset units from the fromEdge of the fixedElement.
Returns a pointer to this AnchorLayoutElement.
|
private |
Returns the relative position in an element of this edge.
(0 for left, 0.5 for center, 1 for right, ...)
|
overridevirtual |
|
private |
Sorts the constraints by what needs to be done first.
Also detects if there is a circular dependency, and the linear programming solver needs to be used.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |