neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neogfx::layout Class Reference

#include <layout.hpp>

Inheritance diagram for neogfx::layout:
neogfx::layout_item< object< i_layout > > neogfx::anchorable< Base > neogfx::border_layout neogfx::flow_layout neogfx::grid_layout neogfx::horizontal_layout neogfx::stack_layout neogfx::vertical_layout neogfx::size_policy_of_parent< neogfx::vertical_layout >

Classes

struct  column_major
 
struct  common_axis_policy
 
struct  row_major
 

Public Types

typedef i_layout abstract_type
 
- Public Types inherited from neogfx::anchorable< Base >
typedef neolib::map< string, i_anchor * > anchor_map_type
 

Public Member Functions

 layout (optional_alignment const &aAlignment={})
 
 layout (i_widget &aOwner, optional_alignment const &aAlignment={})
 
 layout (i_layout &aParent, optional_alignment const &aAlignment={})
 
 layout (const layout &)=delete
 
 ~layout ()
 
bool has_parent_layout () const final
 
const i_layoutparent_layout () const final
 
i_layoutparent_layout () final
 
void set_parent_layout (i_layout *aParentLayout) final
 
bool has_parent_widget () const final
 
const i_widgetparent_widget () const final
 
i_widgetparent_widget () final
 
void set_parent_widget (i_widget *aParentWidget) final
 
i_layout_itemadd (i_layout_item &aItem) override
 
i_layout_itemadd_at (layout_item_index aPosition, i_layout_item &aItem) override
 
i_layout_itemadd (i_ref_ptr< i_layout_item > const &aItem) override
 
i_layout_itemadd_at (layout_item_index aPosition, i_ref_ptr< i_layout_item > const &aItem) override
 
void remove_at (layout_item_index aIndex) override
 
bool remove (i_layout_item &aItem) override
 
void remove_all () override
 
void move_all_to (i_layout &aDestination) override
 
layout_item_index count () const override
 
layout_item_index index_of (const i_layout_item &aItem) const override
 
optional_layout_item_index find (const i_layout_item &aItem) const override
 
bool is_widget_at (layout_item_index aIndex) const override
 
const i_layout_itemitem_at (layout_item_index aIndex) const override
 
i_layout_itemitem_at (layout_item_index aIndex) override
 
const i_widgetget_widget_at (layout_item_index aIndex) const override
 
i_widgetget_widget_at (layout_item_index aIndex) override
 
const i_layoutget_layout_at (layout_item_index aIndex) const override
 
i_layoutget_layout_at (layout_item_index aIndex) override
 
neogfx::margin margin () const override
 
neogfx::padding padding () const override
 
layout_direction direction () const override
 
bool has_spacing () const override
 
size spacing () const override
 
void set_spacing (optional_size const &aSpacing, bool aUpdateLayout=true) override
 
bool always_use_spacing () const override
 
void set_always_use_spacing (bool aAlwaysUseSpacing) override
 
bool has_alignment () const override
 
neogfx::alignment alignment () const override
 
void set_alignment (optional_alignment const &aAlignment, bool aUpdateLayout=true) override
 
neogfx::autoscale autoscale () const override
 
void set_autoscale (neogfx::autoscale aAutoscale, bool aUpdateLayout=true) override
 
visibility_constraint child_visibility () const override
 
bool ignore_child_visibility () const override
 
void set_ignore_child_visibility (bool aIgnoreChildVisibility) override
 
void enable (bool aEnable) override
 
bool enabled () const override
 
bool invalidated () const override
 
void invalidate (bool aDeferLayout=true) override
 
void validate () override
 
void set_extents (const size &aExtents) override
 
neogfx::size_policy size_policy () const override
 
bool device_metrics_available () const override
 
const i_device_metricsdevice_metrics () const override
 
void layout_as (const point &aPosition, const size &aSize) override
 
void fix_weightings (bool aRecalculate=true) override
 
bool visible () const override
 
virtual const i_widgetget_widget_at (layout_item_index aIndex) const=0
 
virtual i_widgetget_widget_at (layout_item_index aIndex)=0
 
template<typename WidgetT >
const WidgetT & get_widget_at (layout_item_index aIndex) const
 
template<typename WidgetT >
WidgetT & get_widget_at (layout_item_index aIndex)
 
virtual void enable (bool aEnable)=0
 
void enable ()
 
virtual i_layout_itemadd (i_layout_item &aItem)=0
 
virtual i_layout_itemadd (i_ref_ptr< i_layout_item > const &aItem)=0
 
template<typename ItemType >
ItemType & add ()
 
template<typename ItemType >
ItemType & add (i_ref_ptr< ItemType > const &aItem)
 
template<typename ItemType >
ItemType & add (ref_ptr< ItemType > const &aItem)
 
virtual i_layout_itemadd_at (layout_item_index aPosition, i_layout_item &aItem)=0
 
virtual i_layout_itemadd_at (layout_item_index aPosition, i_ref_ptr< i_layout_item > const &aItem)=0
 
template<typename ItemType >
ItemType & add_at (layout_item_index aPosition, i_ref_ptr< ItemType > const &aItem)
 
template<typename ItemType >
ItemType & add_at (layout_item_index aPosition, ref_ptr< ItemType > const &aItem)
 
- Public Member Functions inherited from neogfx::layout_item< object< i_layout > >
 layout_item ()
 
 ~layout_item ()
 
const i_stringid () const final
 
void set_id (const i_string &aId) final
 
bool is_cache () const final
 
bool is_layout () const final
 
const i_layoutas_layout () const final
 
i_layoutas_layout () final
 
bool is_spacer () const final
 
const i_spacer & as_spacer () const final
 
i_spacer & as_spacer () final
 
bool is_widget () const override
 
const i_widgetas_widget () const override
 
i_widgetas_widget () override
 
bool has_parent_layout_item () const final
 
const i_layout_itemparent_layout_item () const final
 
i_layout_itemparent_layout_item () final
 
bool has_layout_manager () const final
 
const i_widgetlayout_manager () const final
 
i_widgetlayout_manager () final
 
void update_layout (bool aDeferLayout=true, bool aAncestors=false) final
 
point origin () const final
 
void reset_origin () const final
 
point position () const final
 
size extents () const final
 
bool has_size_policy () const noexcept override
 
neogfx::size_policy size_policy () const override
 
void set_size_policy (const optional_size_policy &aSizePolicy, bool aUpdateLayout=true) override
 
bool has_weight () const noexcept override
 
size weight () const override
 
void set_weight (optional_size const &aWeight, bool aUpdateLayout=true) override
 
bool has_ideal_size () const noexcept override
 
bool is_ideal_size_constrained () const noexcept override
 
size ideal_size (optional_size const &aAvailableSpace={}) const override
 
void set_ideal_size (optional_size const &aIdealSize, bool aUpdateLayout=true) override
 
bool has_minimum_size () const noexcept override
 
bool is_minimum_size_constrained () const noexcept override
 
size minimum_size (optional_size const &aAvailableSpace={}) const override
 
void set_minimum_size (optional_size const &aMinimumSize, bool aUpdateLayout=true) override
 
bool has_maximum_size () const noexcept override
 
bool is_maximum_size_constrained () const noexcept override
 
size maximum_size (optional_size const &aAvailableSpace={}) const override
 
void set_maximum_size (optional_size const &aMaximumSize, bool aUpdateLayout=true) override
 
bool has_fixed_size () const noexcept override
 
size fixed_size (optional_size const &aAvailableSpace={}) const override
 
void set_fixed_size (optional_size const &aFixedSize, bool aUpdateLayout=true)
 
bool has_transformation () const noexcept override
 
mat33 const & transformation (bool aCombineAncestorTransformations=false) const override
 
void set_transformation (optional_mat33 const &aTransformation, bool aUpdateLayout=true) override
 
bool has_margin () const noexcept override
 
neogfx::margin margin () const override
 
void set_margin (optional_margin const &aMargin, bool aUpdateLayout=true) override
 
bool has_border () const noexcept override
 
neogfx::border border () const override
 
void set_border (optional_border const &aBorder, bool aUpdateLayout=true) override
 
bool has_padding () const noexcept override
 
neogfx::padding padding () const override
 
void set_padding (optional_padding const &aPadding, bool aUpdateLayout=true) override
 
void invalidate_combined_transformation () override
 
void fix_weightings (bool aRecalculate=true) override
 
i_anchor & anchor_to (i_anchorable &aRhs, i_string const &aLhsAnchor, anchor_constraint_function aLhsFunction, i_string const &aRhsAnchor, anchor_constraint_function aRhsFunction) override
 
- Public Member Functions inherited from neogfx::anchorable< Base >
 ~anchorable ()
 
i_anchor & anchor_to (i_anchorable &aRhs, const i_string &aLhsAnchor, anchor_constraint_function aLhsFunction, const i_string &aRhsAnchor, anchor_constraint_function aRhsFunction) override
 
const anchor_map_typeanchors () const override
 
anchor_map_typeanchors () override
 

Protected Types

enum  item_type_e { ItemTypeNone = 0x00 , ItemTypeWidget = 0x01 , ItemTypeLayout = 0x02 , ItemTypeSpacer = 0x04 }
 
typedef ref_ptr< i_layout_item_cacheitem
 
typedef std::list< itemitem_list
 

Protected Member Functions

void layout_item_enabled (i_layout_item &aItem) override
 
void layout_item_disabled (i_layout_item &aItem) override
 
item_list::const_iterator cbegin () const
 
item_list::const_iterator cend () const
 
item_list::const_iterator begin () const
 
item_list::const_iterator end () const
 
item_list::iterator begin ()
 
item_list::iterator end ()
 
item_list::const_reverse_iterator rbegin () const
 
item_list::const_reverse_iterator rend () const
 
item_list::reverse_iterator rbegin ()
 
item_list::reverse_iterator rend ()
 
item_list::const_iterator find_item (const i_layout_item &aItem) const
 
item_list::iterator find_item (i_layout_item &aItem)
 
const item_listitems () const
 
item_listitems ()
 
virtual void remove (item_list::iterator aItem)
 
uint32_t spacer_count () const
 
uint32_t items_visible (item_type_e aItemType=static_cast< item_type_e >(ItemTypeWidget|ItemTypeLayout)) const
 
template<typename AxisPolicy >
size do_minimum_size (optional_size const &aAvailableSpace) const
 
template<typename AxisPolicy >
size do_maximum_size (optional_size const &aAvailableSpace) const
 
template<typename AxisPolicy >
void do_layout_items (const point &aPosition, const size &aSize)
 
- Protected Member Functions inherited from neogfx::layout_item< object< i_layout > >
void set_position (const point &aPosition) override
 
void set_extents (const size &aExtents) override
 
point unconstrained_origin () const override
 
point unconstrained_position () const override
 
void layout_item_enabled (i_layout_item &aItem) override
 
void layout_item_disabled (i_layout_item &aItem) override
 

Additional Inherited Members

- Public Attributes inherited from neogfx::layout_item< object< i_layout > >
define_property(property_category::soft_geometry, point, Position, position) define_property(property_category cache< pointiOrigin
 
cache< mat33iCombinedTransformation
 

Detailed Description

Definition at line 39 of file layout.hpp.

Member Typedef Documentation

◆ abstract_type

Definition at line 49 of file layout.hpp.

◆ item

Definition at line 51 of file layout.hpp.

◆ item_list

typedef std::list<item> neogfx::layout::item_list
protected

Definition at line 52 of file layout.hpp.

Member Enumeration Documentation

◆ item_type_e

Enumerator
ItemTypeNone 
ItemTypeWidget 
ItemTypeLayout 
ItemTypeSpacer 

Definition at line 53 of file layout.hpp.

Constructor & Destructor Documentation

◆ layout() [1/4]

neogfx::layout::layout ( optional_alignment const &  aAlignment = {})

◆ layout() [2/4]

neogfx::layout::layout ( i_widget aOwner,
optional_alignment const &  aAlignment = {} 
)

◆ layout() [3/4]

neogfx::layout::layout ( i_layout aParent,
optional_alignment const &  aAlignment = {} 
)

◆ layout() [4/4]

neogfx::layout::layout ( const layout )
delete

◆ ~layout()

neogfx::layout::~layout ( )

Member Function Documentation

◆ add() [1/7]

template<typename ItemType >
ItemType & neogfx::i_layout::add ( )
inline

Definition at line 292 of file i_layout.hpp.

◆ add() [2/7]

i_layout_item & neogfx::layout::add ( i_layout_item aItem)
override

◆ add() [3/7]

virtual i_layout_item & neogfx::i_layout::add ( i_layout_item aItem)

◆ add() [4/7]

i_layout_item & neogfx::layout::add ( i_ref_ptr< i_layout_item > const &  aItem)
override

◆ add() [5/7]

virtual i_layout_item & neogfx::i_layout::add ( i_ref_ptr< i_layout_item > const &  aItem)

◆ add() [6/7]

template<typename ItemType >
ItemType & neogfx::i_layout::add ( i_ref_ptr< ItemType > const &  aItem)
inline

Definition at line 298 of file i_layout.hpp.

◆ add() [7/7]

template<typename ItemType >
ItemType & neogfx::i_layout::add ( ref_ptr< ItemType > const &  aItem)
inline

Definition at line 308 of file i_layout.hpp.

◆ add_at() [1/6]

i_layout_item & neogfx::layout::add_at ( layout_item_index  aPosition,
i_layout_item aItem 
)
override

◆ add_at() [2/6]

virtual i_layout_item & neogfx::i_layout::add_at ( layout_item_index  aPosition,
i_layout_item aItem 
)

◆ add_at() [3/6]

i_layout_item & neogfx::layout::add_at ( layout_item_index  aPosition,
i_ref_ptr< i_layout_item > const &  aItem 
)
override

◆ add_at() [4/6]

virtual i_layout_item & neogfx::i_layout::add_at ( layout_item_index  aPosition,
i_ref_ptr< i_layout_item > const &  aItem 
)

◆ add_at() [5/6]

template<typename ItemType >
ItemType & neogfx::i_layout::add_at ( layout_item_index  aPosition,
i_ref_ptr< ItemType > const &  aItem 
)
inline

Definition at line 303 of file i_layout.hpp.

◆ add_at() [6/6]

template<typename ItemType >
ItemType & neogfx::i_layout::add_at ( layout_item_index  aPosition,
ref_ptr< ItemType > const &  aItem 
)
inline

Definition at line 313 of file i_layout.hpp.

◆ alignment()

neogfx::alignment neogfx::layout::alignment ( ) const
override

◆ always_use_spacing()

bool neogfx::layout::always_use_spacing ( ) const
override

◆ autoscale()

neogfx::autoscale neogfx::layout::autoscale ( ) const
override

◆ begin() [1/2]

item_list::iterator neogfx::layout::begin ( )
protected

◆ begin() [2/2]

item_list::const_iterator neogfx::layout::begin ( ) const
protected

◆ cbegin()

item_list::const_iterator neogfx::layout::cbegin ( ) const
protected

◆ cend()

item_list::const_iterator neogfx::layout::cend ( ) const
protected

◆ child_visibility()

visibility_constraint neogfx::layout::child_visibility ( ) const
override

◆ count()

layout_item_index neogfx::layout::count ( ) const
override

◆ device_metrics()

const i_device_metrics & neogfx::layout::device_metrics ( ) const
override

◆ device_metrics_available()

bool neogfx::layout::device_metrics_available ( ) const
override

◆ direction()

layout_direction neogfx::layout::direction ( ) const
override

◆ do_layout_items()

template<typename AxisPolicy >
void neogfx::layout::do_layout_items ( const point aPosition,
const size aSize 
)
protected

◆ do_maximum_size()

template<typename AxisPolicy >
size neogfx::layout::do_maximum_size ( optional_size const &  aAvailableSpace) const
protected

◆ do_minimum_size()

template<typename AxisPolicy >
size neogfx::layout::do_minimum_size ( optional_size const &  aAvailableSpace) const
protected

◆ enable() [1/3]

void neogfx::i_layout::enable ( )
inline

Definition at line 369 of file i_layout.hpp.

◆ enable() [2/3]

void neogfx::layout::enable ( bool  aEnable)
override

◆ enable() [3/3]

virtual void neogfx::i_layout::enable ( bool  aEnable)

◆ enabled()

bool neogfx::layout::enabled ( ) const
override

◆ end() [1/2]

item_list::iterator neogfx::layout::end ( )
protected

◆ end() [2/2]

item_list::const_iterator neogfx::layout::end ( ) const
protected

◆ find()

optional_layout_item_index neogfx::layout::find ( const i_layout_item aItem) const
override

◆ find_item() [1/2]

item_list::const_iterator neogfx::layout::find_item ( const i_layout_item aItem) const
protected

◆ find_item() [2/2]

item_list::iterator neogfx::layout::find_item ( i_layout_item aItem)
protected

◆ fix_weightings()

void neogfx::layout::fix_weightings ( bool  aRecalculate = true)
override

◆ get_layout_at() [1/2]

const i_layout & neogfx::layout::get_layout_at ( layout_item_index  aIndex) const
override

◆ get_layout_at() [2/2]

i_layout & neogfx::layout::get_layout_at ( layout_item_index  aIndex)
override

◆ get_widget_at() [1/6]

template<typename WidgetT >
WidgetT & neogfx::i_layout::get_widget_at ( layout_item_index  aIndex)
inline

Definition at line 354 of file i_layout.hpp.

◆ get_widget_at() [2/6]

template<typename WidgetT >
const WidgetT & neogfx::i_layout::get_widget_at ( layout_item_index  aIndex) const
inline

Definition at line 349 of file i_layout.hpp.

◆ get_widget_at() [3/6]

const i_widget & neogfx::layout::get_widget_at ( layout_item_index  aIndex) const
override

◆ get_widget_at() [4/6]

virtual const i_widget & neogfx::i_layout::get_widget_at ( layout_item_index  aIndex) const

◆ get_widget_at() [5/6]

i_widget & neogfx::layout::get_widget_at ( layout_item_index  aIndex)
override

◆ get_widget_at() [6/6]

virtual i_widget & neogfx::i_layout::get_widget_at ( layout_item_index  aIndex)

◆ has_alignment()

bool neogfx::layout::has_alignment ( ) const
override

◆ has_parent_layout()

bool neogfx::layout::has_parent_layout ( ) const
final

◆ has_parent_widget()

bool neogfx::layout::has_parent_widget ( ) const
final

◆ has_spacing()

bool neogfx::layout::has_spacing ( ) const
override

◆ ignore_child_visibility()

bool neogfx::layout::ignore_child_visibility ( ) const
override

◆ index_of()

layout_item_index neogfx::layout::index_of ( const i_layout_item aItem) const
override

◆ invalidate()

void neogfx::layout::invalidate ( bool  aDeferLayout = true)
override

◆ invalidated()

bool neogfx::layout::invalidated ( ) const
override

◆ is_widget_at()

bool neogfx::layout::is_widget_at ( layout_item_index  aIndex) const
override

◆ item_at() [1/2]

const i_layout_item & neogfx::layout::item_at ( layout_item_index  aIndex) const
override

◆ item_at() [2/2]

i_layout_item & neogfx::layout::item_at ( layout_item_index  aIndex)
override

◆ items() [1/2]

item_list & neogfx::layout::items ( )
protected

◆ items() [2/2]

const item_list & neogfx::layout::items ( ) const
protected

◆ items_visible()

uint32_t neogfx::layout::items_visible ( item_type_e  aItemType = static_cast< item_type_e >(ItemTypeWidget|ItemTypeLayout)) const
protected

◆ layout_as()

void neogfx::layout::layout_as ( const point aPosition,
const size aSize 
)
override

◆ layout_item_disabled()

void neogfx::layout::layout_item_disabled ( i_layout_item aItem)
overrideprotected

◆ layout_item_enabled()

void neogfx::layout::layout_item_enabled ( i_layout_item aItem)
overrideprotected

◆ margin()

neogfx::margin neogfx::layout::margin ( ) const
override

◆ move_all_to()

void neogfx::layout::move_all_to ( i_layout aDestination)
override

◆ padding()

neogfx::padding neogfx::layout::padding ( ) const
override

◆ parent_layout() [1/2]

const i_layout & neogfx::layout::parent_layout ( ) const
final

◆ parent_layout() [2/2]

i_layout & neogfx::layout::parent_layout ( )
final

◆ parent_widget() [1/2]

const i_widget & neogfx::layout::parent_widget ( ) const
final

◆ parent_widget() [2/2]

i_widget & neogfx::layout::parent_widget ( )
final

◆ rbegin() [1/2]

item_list::reverse_iterator neogfx::layout::rbegin ( )
protected

◆ rbegin() [2/2]

item_list::const_reverse_iterator neogfx::layout::rbegin ( ) const
protected

◆ remove() [1/2]

bool neogfx::layout::remove ( i_layout_item aItem)
override

◆ remove() [2/2]

virtual void neogfx::layout::remove ( item_list::iterator  aItem)
protectedvirtual

Reimplemented in neogfx::grid_layout.

◆ remove_all()

void neogfx::layout::remove_all ( )
override

◆ remove_at()

void neogfx::layout::remove_at ( layout_item_index  aIndex)
override

◆ rend() [1/2]

item_list::reverse_iterator neogfx::layout::rend ( )
protected

◆ rend() [2/2]

item_list::const_reverse_iterator neogfx::layout::rend ( ) const
protected

◆ set_alignment()

void neogfx::layout::set_alignment ( optional_alignment const &  aAlignment,
bool  aUpdateLayout = true 
)
override

◆ set_always_use_spacing()

void neogfx::layout::set_always_use_spacing ( bool  aAlwaysUseSpacing)
override

◆ set_autoscale()

void neogfx::layout::set_autoscale ( neogfx::autoscale  aAutoscale,
bool  aUpdateLayout = true 
)
override

◆ set_extents()

void neogfx::layout::set_extents ( const size aExtents)
override

◆ set_ignore_child_visibility()

void neogfx::layout::set_ignore_child_visibility ( bool  aIgnoreChildVisibility)
override

◆ set_parent_layout()

void neogfx::layout::set_parent_layout ( i_layout aParentLayout)
final

◆ set_parent_widget()

void neogfx::layout::set_parent_widget ( i_widget aParentWidget)
final

◆ set_spacing()

void neogfx::layout::set_spacing ( optional_size const &  aSpacing,
bool  aUpdateLayout = true 
)
override

◆ size_policy()

neogfx::size_policy neogfx::layout::size_policy ( ) const
override

◆ spacer_count()

uint32_t neogfx::layout::spacer_count ( ) const
protected

◆ spacing()

size neogfx::layout::spacing ( ) const
override

◆ validate()

void neogfx::layout::validate ( )
override

◆ visible()

bool neogfx::layout::visible ( ) const
override

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