Sparkle 0.0.1
Loading...
Searching...
No Matches
spk::GridLayout Class Reference

Layout arranging elements in a grid by cell position. More...

#include <spk_grid_layout.hpp>

Inheritance diagram for spk::GridLayout:
Inheritance graph
Collaboration diagram for spk::GridLayout:
Collaboration graph

Public Member Functions

void addElement (const Vector2UInt &p_position, ResizableElement *p_element, const SizePolicy &p_sizePolicy)
 Adds an element at a grid position.
void clear ()
 Removes all grid elements.
void setGeometry (const Extend2D &p_extend) override
 Sets the layout geometry and positions elements.
Public Member Functions inherited from spk::Layout
void setPadding (const spk::Vector2UInt &p_padding)
 Sets layout padding between elements.
const spk::Vector2UIntpadding () const
 Returns layout padding.
void clear ()
 Removes all elements from the layout.
template<typename TExtra>
void addElement (ResizableElement *p_element, const SizePolicy &p_sizePolicy, TExtra &&p_extra)
 Adds an element with extra layout data.
void addElement (ResizableElement *p_element, const SizePolicy &p_sizePolicy)
 Adds an element with a size policy.
Public Member Functions inherited from spk::ResizableElement
SizeHintsizeHint ()
 Returns mutable size hint data.
const SizeHintsizeHint () const
 Returns const size hint data.

Additional Inherited Members

Protected Types inherited from spk::Layout
using ElementContainer = std::vector<Element>
 Container type used to store elements.
Protected Member Functions inherited from spk::Layout
const ElementContainer_elements () const
 Returns the stored elements.
Protected Attributes inherited from spk::Layout
ElementContainer _elementContainer
 Stored layout elements.

Detailed Description

Layout arranging elements in a grid by cell position.

See also
Layout
grid.addElement({0, 0}, widget, spk::Layout::SizePolicy::Extend);
Layout arranging elements in a grid by cell position.
Definition spk_grid_layout.hpp:27
void addElement(const Vector2UInt &p_position, ResizableElement *p_element, const SizePolicy &p_sizePolicy)
Adds an element at a grid position.
Definition spk_grid_layout.hpp:267

Member Function Documentation

◆ addElement()

void spk::GridLayout::addElement ( const Vector2UInt & p_position,
ResizableElement * p_element,
const SizePolicy & p_sizePolicy )
inline

Adds an element at a grid position.

Parameters
p_positionGrid cell coordinates.
p_elementElement pointer.
p_sizePolicySize policy to apply.
Here is the call graph for this function:

◆ setGeometry()

void spk::GridLayout::setGeometry ( const Extend2D & p_extend)
inlineoverridevirtual

Sets the layout geometry and positions elements.

Parameters
p_extendLayout geometry.

Implements spk::ResizableElement.

Here is the call graph for this function:

The documentation for this class was generated from the following file: