1 #ifndef CPPURSES_DEMOS_PALETTE_COLOR_DEFINITION_SETTER_HPP
2 #define CPPURSES_DEMOS_PALETTE_COLOR_DEFINITION_SETTER_HPP
3 #include <cctype>
4 #include <string>
5 
6 #include <cppurses/painter/color.hpp>
7 #include <cppurses/painter/painter.hpp>
8 #include <cppurses/widget/layouts/vertical.hpp>
9 #include <cppurses/widget/widgets/confirm_button.hpp>
10 #include <cppurses/widget/widgets/line_edit.hpp>
11 #include <cppurses/widget/widgets/text_display.hpp>
12 
13 #include "color_control.hpp"
14 #include "color_display.hpp"
15 #include "export_panel.hpp"
16 
17 namespace palette {
18 
19 /// Provides interface and implementation of setting a specific color value.
20 class Color_definition_setter : public cppurses::layout::Vertical {
21     cppurses::Color current_color_{cppurses::Color::White};
22 
23     Color_display& color_display_{
24         this->make_child<Color_display>(current_color_)};
25 
26     Color_control& color_control_{this->make_child<Color_control>()};
27 
28     Export_panel& export_panel_{this->make_child<Export_panel>()};
29 
30    public:
31     Color_definition_setter();
32 
33     /// Change the color you are setting the definition of.
34     void change_current_color(cppurses::Color color);
35 
36     /// Return the color you are setting the definition of.
current_color() const37     cppurses::Color current_color() const { return current_color_; }
38 };
39 
40 }  // namespace palette
41 #endif  // CPPURSES_DEMOS_PALETTE_COLOR_DEFINITION_SETTER_HPP
42