MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / createComponentForProperty

Method createComponentForProperty

Source/Core/CtrlrIDManager.cpp:119–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118
119PropertyComponent *CtrlrIDManager::createComponentForProperty (const Identifier &propertyName,
120 const ValueTree &propertyElement,
121 CtrlrPanel *panel,
122 StringArray *possibleChoices,
123 StringArray *possibleValues)
124{
125 ValueTree identifierDefinition = ctrlrIdTree.getChildWithProperty (Ids::name, propertyName.toString());
126
127 StringArray choices;
128 Array <var> values;
129
130 if (possibleChoices != nullptr && possibleChoices->size() > 0)
131 {
132 choices = *possibleChoices;
133 }
134 else
135 {
136 choices = getChoicesArray(identifierDefinition);
137 }
138
139 if (possibleValues != nullptr && possibleValues->size() > 0)
140 {
141 values = toValueList(*possibleValues);
142 }
143 else
144 {
145 values = toValueList(getValuesArray(identifierDefinition));
146 }
147
148 return (new CtrlrPropertyComponent (propertyName, propertyElement, identifierDefinition, panel, &choices, &values));
149}
150
151const String CtrlrIDManager::typeToString (const PropertyType t)
152{

Callers 2

setTreeMethod · 0.80
CtrlrSettingsMethod · 0.80

Calls 2

toStringMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected