VSTGUI 4.10
Graphical User Interface Framework not only for VST plugins
Loading...
Searching...
No Matches
GridLayouter Class Reference

grid view layouter More...

#include <gridlayouter.h>

+ Inheritance diagram for GridLayouter:

Public Types

using LayoutData = std::vector<std::pair<CRect, std::optional<ViewLayout>>>
 
- Public Types inherited from IViewLayouter
using Children = CViewContainer::ViewList
 

Public Member Functions

 GridLayouter (const GridLayoutProperties &props={})
 
void setProperties (const GridLayoutProperties &props)
 
const GridLayoutPropertiesgetProperties () const
 
GridLayoutPropertiesgetProperties ()
 
bool applyLayout (CViewContainer &container, const Children &children, const ViewLayout &layout) override
 apply the previously calculated layout
 
std::optional< ViewLayoutcalculateLayout (const CViewContainer &view, const Children &children, const CRect &newSize) override
 calculate the layout of the view.
 
- Public Member Functions inherited from ReferenceCounted< int32_t >
 ReferenceCounted ()=default
 
virtual ~ReferenceCounted () noexcept=default
 
 ReferenceCounted (const ReferenceCounted &)
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
 ReferenceCounted ()=default
 
 ReferenceCounted (const ReferenceCounted &)
 
virtual ~ReferenceCounted () noexcept=default
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
void forget () override
 decrease refcount and delete object if refcount == 0
 
void remember () override
 increase refcount
 
virtual int32_t getNbReference () const
 get refcount
 
void forget () override
 decrease refcount and delete object if refcount == 0
 
void remember () override
 increase refcount
 
virtual int32_t getNbReference () const
 get refcount
 

Detailed Description

grid view layouter

Member Typedef Documentation

◆ LayoutData

using LayoutData = std::vector<std::pair<CRect, std::optional<ViewLayout>>>

Constructor & Destructor Documentation

◆ GridLayouter()

GridLayouter ( const GridLayoutProperties & props = {})

Member Function Documentation

◆ applyLayout()

bool applyLayout ( CViewContainer & view,
const Children & children,
const ViewLayout & layout )
overridevirtual

apply the previously calculated layout

Parameters
viewthe view to apply the layout to
childrenthe children of the view
layoutthe layout to apply
Returns
true if the layout was applied successfully, false otherwise

Implements IViewLayouter.

◆ calculateLayout()

std::optional< ViewLayout > calculateLayout ( const CViewContainer & view,
const Children & children,
const CRect & newSize )
overridevirtual

calculate the layout of the view.

Note that the returned layout may have a different size than the newSize parameter when the layout is not possible with the given size.

Parameters
viewthe view to calculate the layout for
childrenthe children of the view
newSizethe new size of the view
Returns
the calculated layout or std::nullopt if the layout could not be calculated

Implements IViewLayouter.

◆ getProperties() [1/2]

GridLayoutProperties & getProperties ( )

◆ getProperties() [2/2]

const GridLayoutProperties & getProperties ( ) const

◆ setProperties()

void setProperties ( const GridLayoutProperties & props)

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