-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathScale.hpp
More file actions
63 lines (50 loc) · 1.68 KB
/
Scale.hpp
File metadata and controls
63 lines (50 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// AmigaOS MUI C++ wrapper
//
// (c) 2022-2026 TDolphin
//
#pragma once
#include "Area.hpp"
namespace MUI
{
/// @brief Wrapper for MUIC_Scale - a percentage scale running from 0% to 100%.
/// The scale is typically used below another object such as a gauge and adapts its detail
/// automatically to the available layout space.
class Scale : public Area
{
public:
explicit Scale(Object *pMuiObject)
: Area(pMuiObject)
{
}
// instanceOf
const static std::string className;
static inline bool instanceOf(Object *pMuiObject)
{
return MUI::instanceOf(pMuiObject, className.c_str());
}
// is/get/set (attributes), all setters return object reference
/// @brief [ @b MUIA_Scale_Horiz ] Get whether the scale is horizontal.
bool getHoriz() const;
/// @brief [ @b MUIA_Scale_Horiz ] Set whether the scale is horizontal or vertical.
Scale &setHoriz(const bool horiz);
};
template <typename T, typename U> class ScaleBuilderTemplate : public AreaBuilderTemplate<T, U>
{
public:
ScaleBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Scale)
: AreaBuilderTemplate<T, U>(uniqueId, muiClassName)
{
}
/// @brief [ @b MUIA_Scale_Horiz ] Set whether the initial scale is horizontal or vertical.
T &tagHoriz(const bool horiz);
};
class ScaleBuilder : public ScaleBuilderTemplate<ScaleBuilder, Scale>
{
public:
ScaleBuilder();
};
}
#define MUI_SCALE_TPP_INCLUDE
#include "Scale.tpp"
#undef MUI_SCALE_TPP_INCLUDE