Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_UI
LumaScroller.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
ivorium_graphics/ivorium_graphics.hpp
>
4
5
namespace
iv
6
{
7
15
class
LumaScroller
:
public
ProtectedSlot
,
protected
PrivValAttr_Owner
16
{
17
public
:
18
ClientMarker
cm
;
19
using
ProtectedSlot::instance
;
20
21
LumaScroller
(
Instance
* );
22
23
// initialization parameters
24
PrivValAttr< SlotChild * >
child
;
25
26
// utility methods
27
template
<
class
T,
class
... CArgs >
28
T *
createChild
( CArgs
const
& ... cargs );
29
30
protected
:
31
// ProtectedSlot
32
virtual
void
first_pass_impl
(
ElementRenderer
* )
override
;
33
34
// PrivValAttr_Owner
35
virtual
void
PrivValAttr_Modified
(
Attribute
* )
override
;
36
37
private
:
38
Heap
heap;
39
AnimHeap
aheap;
40
Scroller
* scroller;
41
};
42
45
template
<
class
T,
class
... CArgs >
46
T *
LumaScroller::createChild
( CArgs
const
& ... cargs )
47
{
48
static_assert( std::is_base_of< SlotChild, T >::value,
"Child must inherit SlotChild."
);
49
auto
t = this->heap.
createClient
< T >( cargs ... );
50
this->
child
.Modify( &this->
cm
, t );
51
return
t;
52
}
53
54
}