-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPanel.hpp
More file actions
76 lines (61 loc) · 1.96 KB
/
Panel.hpp
File metadata and controls
76 lines (61 loc) · 1.96 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
//
// AmigaOS MUI C++ wrapper
//
// (c) 2022-2026 TDolphin
//
#pragma once
#include "Group.hpp"
#ifdef MUIC_Panel
namespace MUI
{
class Application;
class Window;
/// @brief MUI Panel class wrapper.
/// Abstract base class for ASL-like selector panels.
class Panel : public Group
{
public:
explicit Panel(Object *pMuiObject)
: Group(pMuiObject)
{
}
Panel(const Root &root)
: Group(root.muiObject())
{
}
// instanceOf
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());
}
// methods, some returns object reference
#ifdef MUIM_Panel_Run
/// @brief [ @b MUIM_Panel_Run ]
/// Opens the panel window and "runs" the panel asynchronously to the main MUI application in a separate process.
/// If your panel needs some special setup then do that before passing the method to Panel class.
/// @param app The application object to let the panel run asynchronously to the main application.
/// @param win The window object containing the panel object.
/// @return true if "running" the panel succeeded, false otherwise.
bool Run(Application &app, Window &win);
#endif
};
template <typename T, typename U> class PanelBuilderTemplate : public GroupBuilderTemplate<T, U>
{
public:
PanelBuilderTemplate(const std::string &uniqueId = MUI::EmptyUniqueId, const std::string &muiClassName = MUIC_Panel)
: GroupBuilderTemplate<T, U>(uniqueId, muiClassName)
{
}
};
class PanelBuilder : public PanelBuilderTemplate<PanelBuilder, Panel>
{
public:
PanelBuilder();
};
}
#endif