66 struct no_title_bar : std::logic_error {
no_title_bar() : std::logic_error{
"neogfx::i_standard_layout_container::no_title_bar" } {} };
67 struct no_status_bar : std::logic_error {
no_status_bar() : std::logic_error{
"neogfx::i_standard_layout_container::no_status_bar" } {} };
195 return static_cast<autoscale>(~static_cast<uint32_t>(aLhs));
200 return static_cast<autoscale>(
static_cast<uint32_t
>(aLhs) |
static_cast<uint32_t
>(aRhs));
205 return static_cast<autoscale>(
static_cast<uint32_t
>(aLhs) &
static_cast<uint32_t
>(aRhs));
222 return static_cast<layout_direction>(
static_cast<uint32_t
>(aLhs) |
static_cast<uint32_t
>(aRhs));
227 return static_cast<layout_direction>(
static_cast<uint32_t
>(aLhs) &
static_cast<uint32_t
>(aRhs));
291 template <
typename ItemType>
294 auto item = make_ref<ItemType>();
295 return static_cast<ItemType&
>(
add(item));
297 template <
typename ItemType>
300 return static_cast<ItemType&
>(
add(to_abstract(static_pointer_cast<i_layout_item>(aItem))));
302 template <
typename ItemType>
305 return static_cast<ItemType&
>(
add_at(aPosition, to_abstract(static_pointer_cast<i_layout_item>(aItem))));
307 template <
typename ItemType>
310 return static_cast<ItemType&
>(
add(to_abstract(static_pointer_cast<i_layout_item>(aItem))));
312 template <
typename ItemType>
315 return static_cast<ItemType&
>(
add_at(aPosition, to_abstract(static_pointer_cast<i_layout_item>(aItem))));
317 template <
typename ItemType,
typename... Args>
320 auto newItem = make_ref<ItemType>(std::forward<Args>(args)...);
324 template <
typename ItemType,
typename... Args>
327 auto newItem = make_ref<ItemType>(std::forward<Args>(args)...);
329 if (aPosition <
count())
331 add_at(aPosition, newItem);
334 template <
typename ItemType>
337 if (aPosition <
count())
339 return static_cast<ItemType&
>(
add_at(aPosition, aItem));
341 template <
typename ItemType>
344 if (aPosition <
count())
346 return static_cast<ItemType&
>(
add_at(aPosition, static_pointer_cast<i_layout_item>(aItem)));
348 template <
typename W
idgetT>
353 template <
typename W
idgetT>
361 while (l->has_parent_layout() && &l->parent_widget() == &aAncestor.
parent_widget())
363 l = &l->parent_layout();
384 auto const& item = aLayout.
item_at(itemIndex);
387 totalWeight += item.weight();
397 auto const& item = aLayout.
item_at(itemIndex);
400 totalSize += (item.has_fixed_size() ? item.fixed_size() : item.extents());
402 auto result = (aItem.has_fixed_size() ? aItem.fixed_size() : aItem.extents()) / totalSize;
403 if (std::isnan(result.cx))
405 if (std::isnan(result.cy))
i_layout_item abstract_type
virtual const i_widget & parent_widget() const =0
virtual void enable(bool aEnable)=0
virtual neogfx::autoscale autoscale() const =0
virtual void set_spacing(optional_size const &sSpacing, bool aUpdateLayout=true)=0
virtual i_spacer & add_spacer_at(layout_item_index aPosition)=0
WidgetT & get_widget_at(layout_item_index aIndex)
ItemType & add(ref_ptr< ItemType > const &aItem)
virtual i_layout_item & add(i_ref_ptr< i_layout_item > const &aItem)=0
virtual neogfx::alignment alignment() const =0
ItemType & add_at(layout_item_index aPosition, ref_ptr< ItemType > const &aItem)
virtual void remove_at(layout_item_index aIndex)=0
virtual layout_direction direction() const =0
virtual const i_layout & get_layout_at(layout_item_index aIndex) const =0
virtual i_layout_item & add_at(layout_item_index aPosition, i_ref_ptr< i_layout_item > const &aItem)=0
virtual void set_alignment(optional_alignment const &aAlignment, bool aUpdateLayout=true)=0
ItemType & replace_item_at(layout_item_index aPosition, i_ref_ptr< ItemType > const &aItem)
virtual layout_item_index count() const =0
virtual void layout_items(const point &aPosition, const size &aSize)=0
virtual bool enabled() const =0
virtual i_widget & get_widget_at(layout_item_index aIndex)=0
virtual bool remove(i_layout_item &aItem)=0
virtual void set_ignore_child_visibility(bool aIgnoreChildVisibility)=0
ItemType & emplace_at(layout_item_index aPosition, Args &&... args)
ItemType & emplace(Args &&... args)
virtual bool is_widget_at(layout_item_index aIndex) const =0
virtual i_layout_item & item_at(layout_item_index aIndex)=0
virtual void validate()=0
virtual i_layout & get_layout_at(layout_item_index aIndex)=0
virtual i_spacer & add_spacer()=0
virtual void move_all_to(i_layout &aDestination)=0
virtual optional_layout_item_index find(const i_layout_item &aItem) const =0
virtual bool has_alignment() const =0
virtual bool has_spacing() const =0
virtual visibility_constraint child_visibility() const =0
virtual ~i_layout()=default
const WidgetT & get_widget_at(layout_item_index aIndex) const
ItemType & add(i_ref_ptr< ItemType > const &aItem)
virtual layout_item_index index_of(const i_layout_item &aItem) const =0
virtual void set_always_use_spacing(bool aAlwaysUseSpacing)=0
virtual void remove_all()=0
virtual void invalidate(bool aDeferLayout=true)=0
virtual bool always_use_spacing() const =0
virtual bool invalidated() const =0
ItemType & add_at(layout_item_index aPosition, i_ref_ptr< ItemType > const &aItem)
virtual void set_autoscale(neogfx::autoscale aAutoscale, bool aUpdateLayout=true)=0
virtual const i_widget & get_widget_at(layout_item_index aIndex) const =0
bool is_descendent_of(const i_layout &aAncestor) const
virtual size spacing() const =0
ItemType & replace_item_at(layout_item_index aPosition, ItemType &&aItem)
virtual i_layout_item & add(i_layout_item &aItem)=0
virtual bool ignore_child_visibility() const =0
virtual i_layout_item & add_at(layout_item_index aPosition, i_layout_item &aItem)=0
virtual const i_layout_item & item_at(layout_item_index aIndex) const =0
const i_layout & non_client_layout() const
const i_layout & dock_layout(dock_area aDockArea=dock_area::Left) const
virtual const i_layout & layout(standard_layout aStandardLayout, layout_position aPosition=layout_position::None) const =0
i_layout & title_bar_layout()
virtual void set_status_bar(i_status_bar &aStatusBar)=0
virtual ~i_standard_layout_container()=default
const i_layout & status_bar_layout() const
const i_layout & title_bar_layout() const
i_layout & toolbar_layout(layout_position aPosition=layout_position::Top)
virtual void set_title_bar(i_title_bar &aTitleBar)=0
static layout_position to_position(dock_area aDockArea)
virtual const i_widget & client_widget() const =0
virtual bool is_widget() const =0
virtual i_layout & layout(standard_layout aStandardLayout, layout_position aPosition=layout_position::None)=0
i_layout & status_bar_layout()
virtual void set_client(i_ref_ptr< i_widget > const &aClient)=0
const i_layout & client_layout() const
virtual i_widget & client_widget()=0
i_layout & dock_layout(layout_position aPosition=layout_position::Left)
const i_layout & dock_layout(layout_position aPosition=layout_position::Left) const
virtual void set_title_bar(i_ref_ptr< i_title_bar > const &aTitleBar)=0
i_layout & dock_layout(dock_area aDockArea=dock_area::Left)
i_layout & button_box_layout()
virtual i_title_bar & title_bar()=0
virtual i_widget & as_widget()=0
virtual void set_status_bar(i_ref_ptr< i_status_bar > const &aStatusBar)=0
virtual void set_client(i_widget &aClient)=0
i_layout & non_client_layout()
i_layout & client_layout()
virtual bool has_layout(standard_layout aStandardLayout) const =0
virtual i_status_bar & status_bar()=0
const i_layout & button_box_layout() const
virtual bool has_client_widget() const =0
virtual const i_status_bar & status_bar() const =0
const i_layout & menu_layout() const
virtual const i_widget & as_widget() const =0
const i_layout & toolbar_layout(layout_position aPosition=layout_position::Top) const
virtual const i_title_bar & title_bar() const =0
scoped_layout_items(bool aForceRefresh=false)
~scoped_query_ideal_size()
scoped_query_ideal_size()
constexpr style_aspect operator&(style_aspect aLhs, style_aspect aRhs)
size total_child_weight(const i_layout &aLayout)
audio_channel operator~(audio_channel lhs)
uint32_t layout_item_index
size calculate_relative_weight(const i_layout &aLayout, const i_layout_item &aItem)
constexpr style_aspect operator|(style_aspect aLhs, style_aspect aRhs)
std::optional< layout_item_index > optional_layout_item_index
#define declare_event(declName,...)
standard_layout_not_found()