15#include "AUI/Common/AString.h"
16#include "AUI/Render/IRenderer.h"
17#include "AUI/Layout/AHorizontalLayout.h"
19#include "AViewContainer.h"
20#include "AUI/ASS/Selector/AAssSelector.h"
36 bool isDefault()
const noexcept {
40 void setDefault(
bool isDefault =
true);
65namespace declarative {
71 Button(
const char*
text) : layouted_container_factory<AHorizontalLayout, AButtonEx>({
Label{
text}}) {}
75namespace ass::button {
78 _unique<IAssSubSelector> mWrapped;
82 Default(T value): mWrapped(
new T(std::move(value))) {}
85 bool isPossiblyApplicable(
AView* view)
override {
86 return mWrapped->isPossiblyApplicable(view) &&
dynamic_cast<AButton*
>(view);
89 bool isStateApplicable(
AView* view)
override {
90 if (!mWrapped->isStateApplicable(view))
93 if (
auto c =
dynamic_cast<AButton*
>(view)) {
94 return c->isDefault();
100 IAssSubSelector::setupConnections(view, helper);
101 mWrapped->setupConnections(view, helper);
103 if (
auto c =
dynamic_cast<AButton*
>(view)) {
104 c->defaultState.clearAllConnectionsWith(helper.get());
105 AObject::connect(
c->defaultState,
slot(helper)::onInvalidateStateAss);
Represents an abstract text display view.
Definition: AAbstractLabel.h:30
bool consumesClick(const glm::ivec2 &pos) override
Determines whether this AView processes this click or passes it thru.
Definition: AAbstractLabel.cpp:241
Definition: AFieldSignalEmitter.h:51
Represents a Unicode character string.
Definition: AString.h:37
A trivial modifiable view that represents a set of views.
Definition: AViewContainer.h:33
Base class of all UI objects.
Definition: AView.h:77
void addAssName(const AString &assName)
Adds an ASS class to this AView.
Definition: AView.cpp:281
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
Definition: AAssSelector.h:28
#define slot(v)
Passes some variable and type of the variable separated by comma. It's convenient to use with the con...
Definition: kAUI.h:90
Definition: class_of.h:57
Definition: Declarative.h:173
Definition: Declarative.h:91