| @@ -209,11 +209,9 @@ ChoicePropertyComponent::~ChoicePropertyComponent() | |||||
| void ChoicePropertyComponent::initialiseComboBox (const Value& v) | void ChoicePropertyComponent::initialiseComboBox (const Value& v) | ||||
| { | { | ||||
| if (v != Value()) | if (v != Value()) | ||||
| { | |||||
| comboBox.setSelectedId (v.getValue(), dontSendNotification); | comboBox.setSelectedId (v.getValue(), dontSendNotification); | ||||
| comboBox.getSelectedIdAsValue().referTo (v); | |||||
| } | |||||
| comboBox.getSelectedIdAsValue().referTo (v); | |||||
| comboBox.setEditableText (false); | comboBox.setEditableText (false); | ||||
| addAndMakeVisible (comboBox); | addAndMakeVisible (comboBox); | ||||
| } | } | ||||
| @@ -222,10 +220,12 @@ void ChoicePropertyComponent::refreshChoices() | |||||
| { | { | ||||
| comboBox.clear(); | comboBox.clear(); | ||||
| for (auto choice : choices) | |||||
| for (int i = 0; i < choices.size(); ++i) | |||||
| { | { | ||||
| const auto& choice = choices[i]; | |||||
| if (choice.isNotEmpty()) | if (choice.isNotEmpty()) | ||||
| comboBox.addItem (choice, choices.indexOf (choice) + 1); | |||||
| comboBox.addItem (choice, i + 1); | |||||
| else | else | ||||
| comboBox.addSeparator(); | comboBox.addSeparator(); | ||||
| } | } | ||||