@@ -56,9 +56,30 @@ namespace cycfi::elements
56
56
bool enabled : 1 ;
57
57
};
58
58
59
- class basic_button
60
- : public proxy_base
61
- , public receiver<bool >
59
+ /* *
60
+ * \class basic_button
61
+ *
62
+ * \brief
63
+ * A class that represents a basic GUI button, acting as a proxy which
64
+ * delegates the rendering to a "button styler".
65
+ *
66
+ * The `basic_button` class is a foundational class for creating a GUI
67
+ * button. This class is a proxy which delegates the rendering of the
68
+ * actual button to a button styler subject. This division of
69
+ * responsibilities allows for more flexibility in dictating the
70
+ * button's appearance and interaction. The `basic_button` class
71
+ * handles user interactions, while the button styler manages the
72
+ * button's visual presentation. With this pattern, different stylers
73
+ * can be implemented for various visual representations, for instance,
74
+ * plain buttons, radio buttons, slide switches, checkboxes, and more.
75
+ *
76
+ * The communication with the "button styler" is done via the
77
+ * `receiver<button_state>` API. This API provides a means for the
78
+ * `basic_button` to update the button styler about changes in button's
79
+ * state (such as on/off value, highlight, enabled state etc.) enabling
80
+ * the styler to adjust the visual representation accordingly.
81
+ */
82
+ class basic_button : public proxy_base , public receiver <bool >
62
83
{
63
84
public:
64
85
@@ -95,13 +116,6 @@ namespace cycfi::elements
95
116
button_state _state;
96
117
};
97
118
98
- inline void basic_button::edit (view& view_, bool val)
99
- {
100
- if (on_click)
101
- on_click (val);
102
- receiver<bool >::notify_edit (view_);
103
- }
104
-
105
119
// //////////////////////////////////////////////////////////////////////////
106
120
// Toggle Button
107
121
// //////////////////////////////////////////////////////////////////////////
0 commit comments