AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
activated.h
1/*
2 * AUI Framework - Declarative UI toolkit for modern C++20
3 * Copyright (C) 2020-2024 Alex2772 and Contributors
4 *
5 * SPDX-License-Identifier: MPL-2.0
6 *
7 * This Source Code Form is subject to the terms of the Mozilla Public
8 * License, v. 2.0. If a copy of the MPL was not distributed with this
9 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 */
11
12//
13// Created by alex2 on 02.01.2021.
14//
15
16#pragma once
17
18
19namespace ass {
20 template<typename Base>
21 struct activated: Base {
22 template<typename... Args>
23 activated(Args&&... args):
24 Base(std::forward<Args>(args)...)
25 {
26
27 }
28
29 bool isStateApplicable(AView* view) override {
30 return Base::isStateApplicable(view) && view->isPressed();
31 }
32
33 void setupConnections(AView* view, const _<AAssHelper>& helper) override {
34 Base::setupConnections(view, helper);
35 view->pressedState.clearAllConnectionsWith(helper.get());
36 AObject::connect(view->pressedState, slot(helper)::onInvalidateStateAss);
37 }
38 };
39}
Base class of all UI objects.
Definition: AView.h:77
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
API_AUI_CORE const ACommandLineArgs & args() noexcept
Definition: OSAndroid.cpp:29
#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: activated.h:21