Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
UIProperty.h
Go to the documentation of this file.
1#pragma once
2
3#include <SDL/TSdlAnyInstance.h>
4#include <SDL/sdl_fwd.h>
5
6#include <string>
7
8namespace ph::editor
9{
10
11class UIProperty final
12{
13public:
14 UIProperty(SdlNonConstInstance instance, std::string fieldName);
15 UIProperty(SdlNonConstInstance instance, const SdlField* field);
16
19 UIProperty& withDisplayName(std::string displayName);
20
23 UIProperty& withHelpMessage(std::string helpMessage);
24
25 const SdlField* getField() const;
26 SdlNativeData getData() const;
27 const std::string& getFieldName() const;
28 const std::string& getDisplayName() const;
29 const std::string& getHelpMessage() const;
30 UIProperty& setReadOnly(bool inIsReadOnly);
31 bool isReadOnly() const;
32
33private:
34 static std::string getHelpMessage(const SdlField* field);
35
36 SdlNonConstInstance m_instance;
37 const SdlField* m_field;
38 std::string m_fieldName;
39 std::string m_displayName;
40 std::string m_helpMessage;
41 bool m_isReadOnly;
42};
43
44inline const SdlField* UIProperty::getField() const
45{
46 return m_field;
47}
48
49inline const std::string& UIProperty::getFieldName() const
50{
51 return m_fieldName;
52}
53
54inline const std::string& UIProperty::getDisplayName() const
55{
56 return m_displayName;
57}
58
59inline const std::string& UIProperty::getHelpMessage() const
60{
61 return m_helpMessage;
62}
63
64inline bool UIProperty::isReadOnly() const
65{
66 return m_isReadOnly;
67}
68
69}// end namespace ph::editor
Definition UIProperty.h:12
const std::string & getFieldName() const
Definition UIProperty.h:49
const std::string & getDisplayName() const
Definition UIProperty.h:54
UIProperty & setReadOnly(bool inIsReadOnly)
Definition UIProperty.cpp:70
const SdlField * getField() const
Definition UIProperty.h:44
bool isReadOnly() const
Definition UIProperty.h:64
UIProperty & withHelpMessage(std::string helpMessage)
Supply custom help message.
Definition UIProperty.cpp:52
SdlNativeData getData() const
Definition UIProperty.cpp:59
UIProperty & withDisplayName(std::string displayName)
Supply custom display name.
Definition UIProperty.cpp:45
const std::string & getHelpMessage() const
Definition UIProperty.h:59
UIProperty(SdlNonConstInstance instance, std::string fieldName)
Definition UIProperty.cpp:12
Definition ph_editor.h:10