AUI Framework
master
Cross-platform module-based framework for developing C++20 desktop applications
AProgressBar.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
#pragma once
13
14
#include <AUI/View/AViewContainer.h>
15
#include <AUI/Traits/values.h>
16
24
class
API_AUI_VIEWS
AProgressBar
:
public
AViewContainerBase
{
25
public
:
26
class
Inner
:
public
AView
{
27
public
:
28
~Inner
()
override
;
29
};
30
~AProgressBar
()
override
;
31
36
void
setValue
(
aui::float_within_0_1
value) {
37
mValue = value;
38
updateInnerWidth();
39
redraw
();
40
41
emit
valueChanged(value);
42
}
43
44
[[nodiscard]]
45
aui::float_within_0_1
value() const noexcept {
46
return
mValue;
47
}
48
49
[[nodiscard]]
50
const
_<Inner>
& innerView() const noexcept {
51
return
mInner;
52
}
53
54
public
:
55
AProgressBar
();
56
57
void
setSize(glm::ivec2 size)
override
;
58
void
render
(
ARenderContext
context)
override
;
59
60
private
:
61
aui::float_within_0_1
mValue = 0.f;
62
void
updateInnerWidth();
63
_<Inner>
mInner;
64
65
66
signals:
67
emits<aui::float_within_0_1>
valueChanged;
68
};
69
70
AProgressBar::Inner
Definition:
AProgressBar.h:26
AProgressBar
A progress bar.
Definition:
AProgressBar.h:24
AProgressBar::setValue
void setValue(aui::float_within_0_1 value)
Definition:
AProgressBar.h:36
ASignal< Args... >
AViewContainerBase
A view that represents a set of views.
Definition:
AViewContainerBase.h:68
AViewContainerBase::render
void render(ARenderContext context) override
Draws this AView. Noone should call this function except rendering routine.
Definition:
AViewContainerBase.cpp:233
AView
Base class of all UI objects.
Definition:
AView.h:77
AView::redraw
void redraw()
Request window manager to redraw this AView.
Definition:
AView.cpp:68
_
An std::weak_ptr with AUI extensions.
Definition:
SharedPtrTypes.h:177
emit
#define emit
emits the specified signal in context of this object.
Definition:
AObject.h:196
ARenderContext
Render context passed to AView::render.
Definition:
ARenderContext.h:43
aui::ranged_number
Clamps the possible values for a number to the specified range: [min;max].
Definition:
values.h:452