18#include "AViewContainer.h"
19#include "ARadioButton.h"
20#include "AUI/Model/AListModel.h"
21#include <AUI/Layout/AHorizontalLayout.h>
22#include <AUI/Layout/AVerticalLayout.h>
23#include <AUI/Model/IListModel.h>
32class API_AUI_VIEWS ARadioGroup:
public AViewContainer {
38 template<
typename... RadioButtons>
39 explicit ARadioGroup(RadioButtons&&... radioButtons): ARadioGroup() {
40 setLayout(std::make_unique<AVerticalLayout>());
41 setViews({ std::forward<RadioButtons>(radioButtons)... });
44 ~ARadioGroup()
override;
52 &ARadioGroup::getSelectedId,
53 &ARadioGroup::setSelectedId,
60 if (
auto rb = _cast<ARadioButton>(v)) {
61 mGroup->addRadioButton(rb);
67 void setModel(
const _<IListModel<AString>>& model);
69 [[nodiscard]]
bool isSelected()
const {
70 return mGroup->isSelected();
72 [[nodiscard]]
int getSelectedId()
const {
73 return mGroup->getSelectedId();
75 void setSelectedId(
int id)
const;
82namespace declarative {
83 struct RadioGroup: aui::ui_building::view_container_layout<AVerticalLayout, ARadioGroup> {
85 struct Horizontal: aui::ui_building::view_container_layout<AHorizontalLayout, ARadioGroup> {
Places views in a row.
Definition AHorizontalLayout.h:42
A group of radio buttons.
Definition ARadioGroup.h:32
auto selectionId() const
Selected id property.
Definition ARadioGroup.h:49
A std::vector with AUI extensions.
Definition AVector.h:39
Places views in a column.
Definition AVerticalLayout.h:41
void setViews(AVector< _< AView > > views)
Replace views.
Definition AViewContainerBase.cpp:618
void setLayout(_unique< ALayout > layout)
Set new layout manager for this AViewContainerBase. DESTROYS OLD LAYOUT MANAGER WITH ITS VIEWS!...
Definition AViewContainerBase.cpp:177
void addView(const _< AView > &view)
Add view to the container.
Definition AViewContainerBase.cpp:145
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:178
ASignal< Args... > emits
A signal declaration.
Definition ASignal.h:348
Property implementation to use with custom getter/setter.
Definition AProperty.h:308
Definition ARadioGroup.h:85
Definition ARadioGroup.h:83