TermOx
Public Types | Public Member Functions | Public Attributes | List of all members
ox::Cycle_stack< Child > Class Template Reference

A layout::Stack with an interface to cycle through each Widget in the stack. More...

#include <cycle_stack.hpp>

Inheritance diagram for ox::Cycle_stack< Child >:
ox::Pair< Layout_t, First, Second >

Public Types

using Parameters = typename layout::Stack< Child >::Parameters
 

Public Member Functions

 Cycle_stack (Parameters parameters)
 
template<typename... Widget_t>
 Cycle_stack (std::pair< Glyph_string, std::unique_ptr< Widget_t >>... children)
 
template<typename Widget_t = Child, typename... Args>
auto make_page (Glyph_string title, Args &&... args) -> Widget_t &
 Construct a new Widget_t object and add it to the end of the Stack. More...
 
auto append_page (Glyph_string title, std::unique_ptr< Child > widget) -> Child &
 Append a page to the Stack. More...
 
- Public Member Functions inherited from ox::Pair< Layout_t, First, Second >
 Pair ()
 Widgets are default constructed.
 
 Pair (Parameters p)
 
 Pair (typename First::Parameters a, typename Second::Parameters b)
 Widgets are constructed with passed in First/Second::Parameters objects.
 
 Pair (std::unique_ptr< First > a, std::unique_ptr< Second > b)
 Existing Widgets are moved into the Pair.
 
template<std::size_t Index>
auto get () -> auto &
 Get child by index.
 
template<std::size_t Index>
auto get () const -> auto const &
 Get child by index.
 

Public Attributes

detail::CS_top_rowtop_row = this->first
 
layout::Stack< Child > & stack = this->second
 
- Public Attributes inherited from ox::Pair< Layout_t, First, Second >
First & first
 
Second & second
 

Detailed Description

template<typename Child = Widget>
class ox::Cycle_stack< Child >

A layout::Stack with an interface to cycle through each Widget in the stack.

Member Function Documentation

◆ append_page()

template<typename Child = Widget>
auto ox::Cycle_stack< Child >::append_page ( Glyph_string  title,
std::unique_ptr< Child >  widget 
) -> Child&
inline

Append a page to the Stack.

title is passed to the Cycle_box associated with this page.

◆ make_page()

template<typename Child = Widget>
template<typename Widget_t = Child, typename... Args>
auto ox::Cycle_stack< Child >::make_page ( Glyph_string  title,
Args &&...  args 
) -> Widget_t&
inline

Construct a new Widget_t object and add it to the end of the Stack.

Returns a reference to this newly created page. title is passed to the Cycle_box to display when this page is active.


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