-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRectangle.hpp
More file actions
67 lines (55 loc) · 2.23 KB
/
Rectangle.hpp
File metadata and controls
67 lines (55 loc) · 2.23 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
//
// AmigaOS MUI C++ wrapper
//
// (c) 2022-2026 TDolphin
//
#pragma once
#include "Area.hpp"
namespace MUI
{
/// @brief MUI Rectangle class wrapper.
/// A lightweight spacer/separator object used to influence MUI layout, optionally as horizontal/vertical bar.
class Rectangle : public Area
{
public:
explicit Rectangle(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_Rectangle_BarTitle ] Returns the title text drawn centered in group-title style on horizontal bar rectangles.
std::string getBarTitle() const;
/// @brief [ @b MUIA_Rectangle_HBar ] Returns whether this rectangle is configured to draw a horizontal bar.
bool isHBar() const;
/// @brief [ @b MUIA_Rectangle_VBar ] Returns whether this rectangle is configured to draw a vertical bar.
bool isVBar() const;
};
template <typename T, typename U> class RectangleBuilderTemplate : public AreaBuilderTemplate<T, U>
{
public:
RectangleBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Rectangle)
: AreaBuilderTemplate<T, U>(uniqueId, muiClassName)
{
}
/// @brief [ @b MUIA_Rectangle_BarTitle ] Sets the title text drawn in group-title style (primarily meaningful for horizontal bars).
T &tagBarTitle(const char *barTitle);
/// @brief [ @b MUIA_Rectangle_HBar ] Enables or disables drawing a horizontal bar in the middle of the rectangle.
T &tagHBar(const bool hBar);
/// @brief [ @b MUIA_Rectangle_VBar ] Enables or disables drawing a vertical bar in the middle of the rectangle.
T &tagVBar(const bool vBar);
};
class RectangleBuilder : public RectangleBuilderTemplate<RectangleBuilder, Rectangle>
{
public:
RectangleBuilder();
};
}
#define MUI_RECTANGLE_TPP_INCLUDE
#include "Rectangle.tpp"
#undef MUI_RECTANGLE_TPP_INCLUDE