Skip to main content

ferroui_controls/
group_box.rs

1use crate::primitives::{HeaderedContentControl, TemplatedControlImpl};
2use crate::{ContentControlImpl, ControlImpl};
3use ferroui_base::input::InputElementImpl;
4use ferroui_base::interactivity::InteractiveImpl;
5use ferroui_base::layout::LayoutableImpl;
6use ferroui_base::{ferro_class, ferro_impl_classes, instantiate, FerroObjectImpl, Ref, StyledElementImpl, VisualImpl};
7
8/// A headered content control that groups related content.
9#[repr(C)]
10pub struct GroupBox {
11    base: HeaderedContentControl,
12}
13
14ferro_class!(GroupBox: HeaderedContentControl);
15ferroui_base::ferro_class_info!(GroupBox { new: GroupBox::new });
16ferro_impl_classes!(
17    GroupBox: FerroObjectImpl,
18    StyledElementImpl,
19    VisualImpl,
20    LayoutableImpl,
21    InteractiveImpl,
22    InputElementImpl,
23    ControlImpl,
24    TemplatedControlImpl,
25    ContentControlImpl
26);
27
28impl GroupBox {
29    /// Creates the class data; see [`ferroui_base::FerroObject::construct`].
30    pub fn construct() -> Self {
31        Self { base: HeaderedContentControl::construct() }
32    }
33
34    pub fn new() -> Ref<Self> {
35        instantiate(Self::construct())
36    }
37}