-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSelectgroup.hpp
More file actions
84 lines (67 loc) · 2.49 KB
/
Selectgroup.hpp
File metadata and controls
84 lines (67 loc) · 2.49 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//
// AmigaOS MUI C++ wrapper
//
// (c) 2022-2026 TDolphin
//
#pragma once
#include "Group.hpp"
#ifdef MUIC_Selectgroup
#include "ValueTypes/Selectgroup/Active.hpp"
namespace MUI
{
/// @brief Selectgroup objects combine radio buttons and labels or other visible objects into a group of selectable options.
class Selectgroup : public Group
{
public:
explicit Selectgroup(Object *pMuiObject)
: Group(pMuiObject)
{
}
Selectgroup(const Root &root)
: Group(root.muiObject())
{
}
const static std::string className;
static inline bool instanceOf(Object *pMuiObject)
{
return MUI::instanceOf(pMuiObject, className.c_str());
}
static inline bool instanceOf(const Root &object)
{
return MUI::instanceOf(object.muiObject(), className.c_str());
}
// is/get/set (attributes), all setters return object reference
/// @brief [ @b MUIA_Selectgroup_Active ]
/// Returns the number of the currently active entry (0-based index).
long getActive() const;
/// @brief [ @b MUIA_Selectgroup_Active ]
/// Set the number of the active entry. Valid range is 0 to NumEntries-1.
Selectgroup &setActive(const long active);
/// @brief [ @b MUIA_Selectgroup_Active ] (typed)
/// Set the active entry using special values (Next, Prev).
Selectgroup &setActive(const enum Selectgroup_Active active);
};
template <typename T, typename U> class SelectgroupBuilderTemplate : public GroupBuilderTemplate<T, U>
{
public:
SelectgroupBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Selectgroup)
: GroupBuilderTemplate<T, U>(uniqueId, muiClassName)
{
}
/// @brief [ @b MUIA_Selectgroup_Active ]
/// Set the number of the initially active entry. Valid range is 0 to NumEntries-1.
T &tagActive(const long active);
/// @brief [ @b MUIA_Selectgroup_Active ] (typed)
/// Set the initially active entry using special values (Next, Prev).
T &tagActive(const enum Selectgroup_Active active);
};
class SelectgroupBuilder : public SelectgroupBuilderTemplate<SelectgroupBuilder, Selectgroup>
{
public:
SelectgroupBuilder();
};
}
#define MUI_SELECTGROUP_TPP_INCLUDE
#include "Selectgroup.tpp"
#undef MUI_SELECTGROUP_TPP_INCLUDE
#endif // MUIC_Selectgroup