I’m trying to create 2 custom property components, i did one and it’s working with one but. Everytime i click on the component (it’s a colour selector) the PropertyPanel deletes my PropertyComponent and re-creates it, so i don’t have fluid mouse movement. The deletion happens only if i change the Value that is passed to the PropertyComponent constructor. It’s very simple but i guess i’m missing something very obvious as usual:
CtrlrColourPropertyComponent::CtrlrColourPropertyComponent (const Value &v, const String &propertyName)
: PropertyComponent (propertyName), val(v), cs(ColourSelector::showColourspace)
{
preferredHeight = 128;
addAndMakeVisible (&cs);
cs.addChangeListener (this);
}
CtrlrColourPropertyComponent::~CtrlrColourPropertyComponent()
{
}
void CtrlrColourPropertyComponent::refresh()
{
cs.setCurrentColour (Colour::fromString (val.toString()));
}
void CtrlrColourPropertyComponent::changeListenerCallback (ChangeBroadcaster* source)
{
val = cs.getCurrentColour().toString();
}