6 #ifndef GDCORE_PROPERTYDESCRIPTOR
7 #define GDCORE_PROPERTYDESCRIPTOR
10 #include "GDCore/Project/MeasurementUnit.h"
11 #include "GDCore/Project/QuickCustomization.h"
12 #include "GDCore/String.h"
15 class SerializerElement;
23 : value(value), label(label) {}
25 const gd::String& GetValue()
const {
return value; }
26 const gd::String& GetLabel()
const {
return label; }
47 : currentValue(propertyValue),
53 hasImpactOnOtherProperties(false),
64 hasImpactOnOtherProperties(false),
106 description = description_;
129 extraInformation = info;
141 extraInformation.push_back(info);
150 measurementUnit = measurementUnit_;
154 const gd::String& GetValue()
const {
return currentValue; }
155 const gd::String& GetType()
const {
return type; }
156 const gd::String& GetLabel()
const {
return label; }
157 const gd::String& GetDescription()
const {
return description; }
158 const gd::String& GetGroup()
const {
return group; }
160 return measurementUnit;
163 const std::vector<gd::String>& GetExtraInfo()
const {
164 return extraInformation;
167 std::vector<gd::String>& GetExtraInfo() {
return extraInformation; }
169 const std::vector<PropertyDescriptorChoice>& GetChoices()
const {
223 hasImpactOnOtherProperties = enable;
228 return quickCustomizationVisibility;
231 PropertyDescriptor& SetQuickCustomizationVisibility(
233 quickCustomizationVisibility = visibility;
243 virtual void SerializeTo(SerializerElement& element)
const;
248 virtual void UnserializeFrom(
const SerializerElement& element);
253 virtual void SerializeValuesTo(SerializerElement& element)
const;
258 virtual void UnserializeValuesFrom(
const SerializerElement& element);
269 std::vector<PropertyDescriptorChoice>
271 std::vector<gd::String>
277 bool hasImpactOnOtherProperties;
A unit of measurement.
Definition: MeasurementUnit.h:24
Definition: PropertyDescriptor.h:20
Used to describe a property shown in a property grid.
Definition: PropertyDescriptor.h:38
PropertyDescriptor & SetValue(gd::String value)
Change the value displayed in the property grid.
Definition: PropertyDescriptor.h:77
bool IsHidden() const
Check if the property should be shown or hidden in the editor.
Definition: PropertyDescriptor.h:184
PropertyDescriptor & SetHasImpactOnOtherProperties(bool enable)
Set if the property has impact on other properties - which means a change must re-render other proper...
Definition: PropertyDescriptor.h:222
bool IsDeprecated() const
Check if the property is deprecated.
Definition: PropertyDescriptor.h:197
PropertyDescriptor & SetHidden(bool enable=true)
Set if the property should be shown or hidden in the editor.
Definition: PropertyDescriptor.h:176
PropertyDescriptor & SetExtraInfo(const std::vector< gd::String > &info)
Set and replace the additional information for the property.
Definition: PropertyDescriptor.h:128
PropertyDescriptor & SetGroup(gd::String group_)
Change the group where this property is displayed to the user, if any.
Definition: PropertyDescriptor.h:114
PropertyDescriptor & SetDeprecated(bool enable=true)
Set if the property is deprecated.
Definition: PropertyDescriptor.h:189
bool HasImpactOnOtherProperties() const
Check if the property has impact on other properties - which means a change must re-render other prop...
Definition: PropertyDescriptor.h:216
bool IsAdvanced() const
Check if the property is marked as advanced.
Definition: PropertyDescriptor.h:210
PropertyDescriptor()
Empty constructor creating an empty property to be displayed.
Definition: PropertyDescriptor.h:60
PropertyDescriptor & SetMeasurementUnit(const gd::MeasurementUnit &measurementUnit_)
Change the unit of measurement of the property value.
Definition: PropertyDescriptor.h:148
PropertyDescriptor & SetAdvanced(bool enable=true)
Set if the property is marked as advanced.
Definition: PropertyDescriptor.h:202
PropertyDescriptor(gd::String propertyValue)
Create a property being a simple gd::String with the specified value.
Definition: PropertyDescriptor.h:46
PropertyDescriptor & SetType(gd::String type_)
Change the type of the value displayed in the property grid.
Definition: PropertyDescriptor.h:89
PropertyDescriptor & AddExtraInfo(const gd::String &info)
Add an information about the property.
Definition: PropertyDescriptor.h:140
PropertyDescriptor & SetDescription(gd::String description_)
Change the description displayed to the user, if any.
Definition: PropertyDescriptor.h:105
PropertyDescriptor & SetLabel(gd::String label_)
Change the label displayed in the property grid.
Definition: PropertyDescriptor.h:97
Definition: QuickCustomization.h:6
Visibility
Definition: QuickCustomization.h:8
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24