Project Alice
Loading...
Searching...
No Matches
ui::piechart< T > Class Template Reference

#include <gui_element_types.hpp>

Inheritance diagram for ui::piechart< T >:
Collaboration diagram for ui::piechart< T >:

Classes

struct  entry
 

Public Member Functions

void update_chart (sys::state &state)
 
void on_create (sys::state &state) noexcept override
 
void render (sys::state &state, int32_t x, int32_t y) noexcept override
 
void update_tooltip (sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept override
 
virtual void populate_tooltip (sys::state &state, T t, float percentage, text::columnar_layout &contents) noexcept
 
tooltip_behavior has_tooltip (sys::state &state) noexcept override
 
message_result test_mouse (sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept override
 
message_result on_lbutton_down (sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
 
message_result on_rbutton_down (sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept override
 
- Public Member Functions inherited from ui::element_base
bool is_visible () const
 
void set_visible (sys::state &state, bool vis)
 
 element_base ()
 
virtual mouse_probe impl_probe_mouse (sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept
 
virtual message_result impl_on_lbutton_down (sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept
 
virtual message_result impl_on_lbutton_up (sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods, bool under_mouse) noexcept
 
virtual message_result impl_on_rbutton_down (sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept
 
virtual message_result impl_on_key_down (sys::state &state, sys::virtual_key key, sys::key_modifiers mods) noexcept
 
virtual message_result impl_on_scroll (sys::state &state, int32_t x, int32_t y, float amount, sys::key_modifiers mods) noexcept
 
virtual message_result impl_on_mouse_move (sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept
 
virtual void impl_on_update (sys::state &state) noexcept
 
message_result impl_get (sys::state &state, Cyto::Any &payload) noexcept
 
virtual message_result impl_set (sys::state &state, Cyto::Any &payload) noexcept
 
virtual void impl_render (sys::state &state, int32_t x, int32_t y) noexcept
 
virtual void impl_on_reset_text (sys::state &state) noexcept
 
virtual void impl_on_drag_finish (sys::state &state) noexcept
 
virtual tooltip_behavior has_tooltip (sys::state &state) noexcept
 
virtual void update_tooltip (sys::state &state, int32_t x, int32_t y, text::columnar_layout &contents) noexcept
 
virtual std::unique_ptr< element_baseremove_child (element_base *child) noexcept
 
virtual void move_child_to_front (element_base *child) noexcept
 
virtual void move_child_to_back (element_base *child) noexcept
 
virtual void add_child_to_front (std::unique_ptr< element_base > child) noexcept
 
virtual void add_child_to_back (std::unique_ptr< element_base > child) noexcept
 
virtual element_baseget_child_by_name (sys::state const &state, std::string_view name) noexcept
 
virtual element_baseget_child_by_index (sys::state const &state, int32_t index) noexcept
 
virtual ~element_base ()
 

Public Attributes

ogl::data_texture data_texture { resolution, channels }
 
std::vector< entrydistribution
 
float radius = 0.f
 
- Public Attributes inherited from ui::element_base
element_data base_data
 
element_baseparent = nullptr
 
uint8_t flags = 0
 

Static Public Attributes

static constexpr int32_t resolution = 200
 
static constexpr size_t channels = 3
 
- Static Public Attributes inherited from ui::element_base
static constexpr uint8_t is_invisible_mask = 0x01
 

Additional Inherited Members

- Protected Member Functions inherited from ui::element_base
virtual message_result test_mouse (sys::state &state, int32_t x, int32_t y, mouse_probe_type type) noexcept
 
virtual message_result on_lbutton_down (sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept
 
virtual message_result on_lbutton_up (sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods, bool under_mouse) noexcept
 
virtual message_result on_rbutton_down (sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept
 
virtual message_result on_key_down (sys::state &state, sys::virtual_key key, sys::key_modifiers mods) noexcept
 
virtual message_result on_scroll (sys::state &state, int32_t x, int32_t y, float amount, sys::key_modifiers mods) noexcept
 
virtual message_result on_mouse_move (sys::state &state, int32_t x, int32_t y, sys::key_modifiers mods) noexcept
 
virtual message_result get (sys::state &state, Cyto::Any &payload) noexcept
 
virtual message_result set (sys::state &state, Cyto::Any &payload) noexcept
 
virtual void render (sys::state &state, int32_t x, int32_t y) noexcept
 
virtual void on_update (sys::state &state) noexcept
 
virtual void on_create (sys::state &state) noexcept
 
virtual void on_drag (sys::state &state, int32_t oldx, int32_t oldy, int32_t x, int32_t y, sys::key_modifiers mods) noexcept
 
virtual void on_text (sys::state &state, char32_t ch) noexcept
 
virtual void on_visible (sys::state &state) noexcept
 
virtual void on_hide (sys::state &state) noexcept
 
virtual void on_reset_text (sys::state &state) noexcept
 
virtual focus_result on_get_focus (sys::state &state) noexcept
 
virtual void on_lose_focus (sys::state &state) noexcept
 
virtual void on_drag_finish (sys::state &state) noexcept
 

Detailed Description

template<class T>
class ui::piechart< T >

Definition at line 708 of file gui_element_types.hpp.

Member Function Documentation

◆ has_tooltip()

template<class T >
tooltip_behavior ui::piechart< T >::has_tooltip ( sys::state state)
inlineoverridevirtualnoexcept

Reimplemented from ui::element_base.

Definition at line 733 of file gui_element_types.hpp.

◆ on_create()

template<class T >
void ui::piechart< T >::on_create ( sys::state state)
overridevirtualnoexcept

Reimplemented from ui::element_base.

Reimplemented in ui::pop_issues_piechart, ui::pop_ideology_piechart, and ui::pop_distribution_piechart< T, Multiple >.

Definition at line 1281 of file gui_element_types.cpp.

Here is the caller graph for this function:

◆ on_lbutton_down()

template<class T >
message_result ui::piechart< T >::on_lbutton_down ( sys::state state,
int32_t  x,
int32_t  y,
sys::key_modifiers  mods 
)
inlineoverridevirtualnoexcept

Reimplemented from ui::element_base.

Definition at line 745 of file gui_element_types.hpp.

◆ on_rbutton_down()

template<class T >
message_result ui::piechart< T >::on_rbutton_down ( sys::state state,
int32_t  x,
int32_t  y,
sys::key_modifiers  mods 
)
inlineoverridevirtualnoexcept

Reimplemented from ui::element_base.

Definition at line 748 of file gui_element_types.hpp.

◆ populate_tooltip()

template<class T >
void ui::piechart< T >::populate_tooltip ( sys::state state,
t,
float  percentage,
text::columnar_layout contents 
)
virtualnoexcept

Reimplemented in ui::pop_satisfaction_piechart< Strata >.

Definition at line 1368 of file gui_element_types.cpp.

Here is the call graph for this function:

◆ render()

template<class T >
void ui::piechart< T >::render ( sys::state state,
int32_t  x,
int32_t  y 
)
overridevirtualnoexcept

Reimplemented from ui::element_base.

Definition at line 1275 of file gui_element_types.cpp.

Here is the call graph for this function:

◆ test_mouse()

template<class T >
message_result ui::piechart< T >::test_mouse ( sys::state state,
int32_t  x,
int32_t  y,
mouse_probe_type  type 
)
inlineoverridevirtualnoexcept

Reimplemented from ui::element_base.

Definition at line 736 of file gui_element_types.hpp.

◆ update_chart()

template<class T >
void ui::piechart< T >::update_chart ( sys::state state)

Definition at line 1289 of file gui_element_types.cpp.

Here is the caller graph for this function:

◆ update_tooltip()

template<class T >
void ui::piechart< T >::update_tooltip ( sys::state state,
int32_t  x,
int32_t  y,
text::columnar_layout contents 
)
overridevirtualnoexcept

Reimplemented from ui::element_base.

Definition at line 1345 of file gui_element_types.cpp.

Member Data Documentation

◆ channels

template<class T >
constexpr size_t ui::piechart< T >::channels = 3
staticconstexpr

Definition at line 712 of file gui_element_types.hpp.

◆ data_texture

template<class T >
ogl::data_texture ui::piechart< T >::data_texture { resolution, channels }

Definition at line 722 of file gui_element_types.hpp.

◆ distribution

template<class T >
std::vector<entry> ui::piechart< T >::distribution

Definition at line 723 of file gui_element_types.hpp.

◆ radius

template<class T >
float ui::piechart< T >::radius = 0.f

Definition at line 724 of file gui_element_types.hpp.

◆ resolution

template<class T >
constexpr int32_t ui::piechart< T >::resolution = 200
staticconstexpr

Definition at line 711 of file gui_element_types.hpp.


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