1 #ifndef TERMOX_WIDGET_WIDGETS_BUTTON_LIST_HPP
2 #define TERMOX_WIDGET_WIDGETS_BUTTON_LIST_HPP
6 #include <signals_light/signal.hpp>
8 #include <termox/widget/layouts/horizontal.hpp>
9 #include <termox/widget/layouts/opposite.hpp>
10 #include <termox/widget/layouts/passive.hpp>
11 #include <termox/widget/layouts/vertical.hpp>
12 #include <termox/widget/pair.hpp>
13 #include <termox/widget/pipe.hpp>
14 #include <termox/widget/widget.hpp>
15 #include <termox/widget/widgets/button.hpp>
16 #include <termox/widget/widgets/scrollbar.hpp>
18 namespace ox::detail {
20 template <
template <
typename>
class Layout_t>
23 sl::Signal<void(std::u32string
const& name)> button_pressed;
26 auto add_button(std::u32string
const& name) ->
Button&;
29 template <
template <
typename>
class Layout_t>
31 :
Pair<Layout_t<Widget>, Just_a_button_list<Layout_t>, Widget> {
33 Widget& buffer = this->second;
41 template <
template <
typename>
class Layout_t>
43 :
public Pair<layout::Opposite_t<Layout_t<Widget>>,
45 detail::Just_a_button_list_and_buffer<Layout_t>> {
49 Widget& buffer = this->second.buffer;
52 sl::Signal<void(std::u32string
const& name)>& button_pressed =
53 buttons.button_pressed;
56 Color scrollbar_bg = Color::Background;
57 Color scrollbar_fg = Color::Foreground;
62 Color scrollbar_fg = Color::Foreground);
79 template <
template <
typename>
class Layout_t>
80 [[nodiscard]]
auto button_list(
82 -> std::unique_ptr<Button_list<Layout_t>>;
84 using VButton_list = Button_list<layout::Vertical>;
85 using HButton_list = Button_list<layout::Horizontal>;
88 [[nodiscard]]
auto vbutton_list(VButton_list::Parameters p = {})
89 -> std::unique_ptr<VButton_list>;
92 [[nodiscard]]
auto hbutton_list(HButton_list::Parameters p = {})
93 -> std::unique_ptr<HButton_list>;
Color numbers [0 - 180] are valid.
Definition: color.hpp:16
Definition: passive.hpp:34
Heterogeneous pair of Widgets within a Layout.
Definition: pair.hpp:14