Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions
Visualization::BorderFormElement Class Reference

The border form element is a placeholder form element that can be used to make Anchor Layouts stretchable. More...

Inheritance diagram for Visualization::BorderFormElement:
Visualization::SuperFormElement< BorderFormElement, FormElement > Visualization::FormElement

Public Member Functions

 BorderFormElement ()=default
 
 BorderFormElement (const BorderFormElement &)=default
 
virtual ~BorderFormElement ()
 
virtual BorderFormElementclone () const override
 Copy this element and all its children into a new element tree. More...
 
virtual void computeSize (Item *item, int availableWidth, int availableHeight) override
 Method called inside the item's updateGeometry method to compute it's size and position it's child elements. More...
 
virtual bool isEmpty (const Item *item) const override
 Method called inside the item's isEmpty method, and by some layout form elements. More...
 
BorderFormElementoperator= (const BorderFormElement &)=delete
 
virtual bool sizeDependsOnParent (const Item *item) const override
 Method called inside the item's sizeDependsOnParent method, and by some layout form elements. More...
 
- Public Member Functions inherited from Visualization::SuperFormElement< BorderFormElement, FormElement >
BorderFormElementsetBottomMargin (int bottom)
 Sets the bottom margin of this form element. More...
 
BorderFormElementsetLeftMargin (int left)
 Sets the left margin of this form element. More...
 
BorderFormElementsetMargins (int left, int top, int right, int bottom)
 Sets the left, top, right and bottom margins to the respective values. More...
 
BorderFormElementsetMargins (int margin)
 Sets all the margins of this form element to the value specified as margin. More...
 
BorderFormElementsetRightMargin (int right)
 Sets the right margin of this form element. More...
 
BorderFormElementsetTopMargin (int top)
 Sets the top margin of this form element. More...
 
- Public Member Functions inherited from Visualization::FormElement
 FormElement ()=default
 
 FormElement (const FormElement &other)
 
virtual ~FormElement ()
 
virtual QList< const Item *const DeclarativeItemBase::* > allHandledChildPointers ()
 Returns a list of all pointer to child items of this form. More...
 
FormElementcloneIfAlreadyUsed ()
 
virtual void destroyChildItems (Item *item, QList< const Item *const DeclarativeItemBase::* > handledChildren)
 This method is recursively called on all form elements to destroy all the information they might have about a specific item. More...
 
virtual bool elementOrChildHasFocus (Item *item) const
 Method called inside the item's elementOrChildHasFocus and by some layout form elements. More...
 
int height (Item *item) const
 Returns the cached height of this form element for the specified item. More...
 
bool isFormRoot () const
 
FormElementoperator= (const FormElement &)=delete
 
FormElementparent () const
 
QPoint pos (Item *item) const
 Returns the cached position of this form element for the specified item. More...
 
virtual QList< ItemRegionregions (DeclarativeItemBase *item, int parentX=0, int parentY=0)
 Method called inside the item's regions method and returns cursor and item regions of all contained form elements for this item. More...
 
FormElementsetBottomMargin (int bottom)
 Sets the bottom margin of this form element. More...
 
FormElementsetFormRoot ()
 Sets this element to be a formRoot. More...
 
virtual void setItemPositions (Item *item, int parentX=0, int parentY=0)
 Method called inside the item's updateGeometry method to recursively position it's child items relative to the item's position. More...
 
FormElementsetLeftMargin (int left)
 Sets the left margin of this form element. More...
 
FormElementsetMargins (int left, int top, int right, int bottom)
 Sets the left, top, right and bottom margins to the respective values. More...
 
FormElementsetMargins (int margin)
 Sets all the margins of this form element to the value specified as margin. More...
 
void setPos (Item *item, const QPoint &position)
 Caches the position of this form element for the specified item. More...
 
FormElementsetRightMargin (int right)
 Sets the right margin of this form element. More...
 
FormElementsetTopMargin (int top)
 Sets the top margin of this form element. More...
 
virtual QList< FormElement * > shapeElements ()
 Returns the list of shape elements inside this form element. More...
 
QSize size (Item *item) const
 Returns the cached size of this form element for the specified item. More...
 
virtual void synchronizeWithItem (Item *item)
 Method called inside the item's determineChildren method to let the form element and it's children update their information about items and nodes belonging to this item. More...
 
int width (Item *item) const
 Returns the cached width of this form element for the specified item. More...
 
int x (Item *item) const
 Returns the cached position on the x-axis of this form element for the specified item. More...
 
int xEnd (Item *item) const
 Returns the cached position on the x-axis where this form element ends for the specified item. More...
 
int y (Item *item) const
 Returns the cached position on the y-axis of this form element for the specified item. More...
 
int yEnd (Item *item) const
 Returns the cached position on the y-axis where this form element ends for the specified item. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Visualization::FormElement
void addChild (FormElement *child)
 Adds a child to the list of children. More...
 
int bottomMargin ()
 Returns the bottom margin. More...
 
const QVector< FormElement * > & children () const
 Returns the list of children. More...
 
int leftMargin ()
 Returns the left margin. More...
 
void removeChild (FormElement *child)
 Removes a child from the list of children. More...
 
int rightMargin ()
 Returns the right margin. More...
 
void setSize (Item *item, const QSize &size)
 Caches the size of this form element for the specified item. More...
 
int topMargin ()
 Returns the top margin. More...
 

Detailed Description

The border form element is a placeholder form element that can be used to make Anchor Layouts stretchable.

Use a single BorderFormElement in anchor constraints to attach other elements to the different edges of the item. The size of the BorderFormElement is automatically set by the Anchor Layout to match the size of the item.

Using a BorderFormElement in an Anchor Layout will automatically make the Anchor Layout stretchable.

Constructor & Destructor Documentation

◆ BorderFormElement() [1/2]

Visualization::BorderFormElement::BorderFormElement ( )
default

◆ BorderFormElement() [2/2]

Visualization::BorderFormElement::BorderFormElement ( const BorderFormElement )
default

◆ ~BorderFormElement()

Visualization::BorderFormElement::~BorderFormElement ( )
virtual

Member Function Documentation

◆ clone()

BorderFormElement * Visualization::BorderFormElement::clone ( ) const
overridevirtual

Copy this element and all its children into a new element tree.

Implements Visualization::FormElement.

◆ computeSize()

void Visualization::BorderFormElement::computeSize ( Item item,
int  availableWidth,
int  availableHeight 
)
overridevirtual

Method called inside the item's updateGeometry method to compute it's size and position it's child elements.

The arguments availableWidth and availableHeight are similar to those of Item::updateGeometry. If they are zero, the form element calculates its minimum size, if it they are bigger, the element tries to stretch/grow to this size, but not further.

Implements Visualization::FormElement.

◆ isEmpty()

bool Visualization::BorderFormElement::isEmpty ( const Item item) const
overridevirtual

Method called inside the item's isEmpty method, and by some layout form elements.

It recursively determines whether the form element is empty for the specified item.

Reimplemented from Visualization::FormElement.

◆ operator=()

BorderFormElement& Visualization::BorderFormElement::operator= ( const BorderFormElement )
delete

◆ sizeDependsOnParent()

bool Visualization::BorderFormElement::sizeDependsOnParent ( const Item item) const
overridevirtual

Method called inside the item's sizeDependsOnParent method, and by some layout form elements.

If the form element returns true it can be, that computeSize is called on it a second time with non-zero availableWidth and availableHeight.

Implements Visualization::FormElement.