setMouseEnabled(): how to use it?

A User Interface Toolkit mainly for Audio Plug-Ins (VST, AudioUnit, etc).
User avatar
jhox
Posts: 1
Joined: Wed Jun 22, 2016 7:43 am

setMouseEnabled(): how to use it?

Postby jhox » Mon Feb 13, 2017 5:30 pm

Hi,

I like to set control B (AnimKnob) disabled if control A (OnOffButton) is set to 'On' (value 1.0f).

It works when I click control A.
It doesn't work when
a) the plugin is loaded the first time
b) a preset is loaded
c) switching between generic editor - plugin editor (without changing a pramater value)

Code (VST3.6.6, VSTGUI4.3):
...
void ViewController::valueChanged(CControl* pControl)
{
float ctrlValue = pControl->getValue();
switch (pControl->getTag())
{
case kParamDriveMode:// control A
{
CControl* ct =getControlByTag(kParamDriveModeCoeff);// control B
if (ct) {
//ct->setVisible((ctrlValue == 1.0f));
ct->setMouseEnabled((ctrlValue == 1.0f));
}
break;
}
...

In debug mode (VS 2015, Win 10) I can see that in any case the values are setting correctly.
But even when I set the background image or call setDirty(), invalid(), valueChanged(): it doesn't work.

setVisible() instead of setMouseEnabled() works - but I don't like to hide the control.

What do I miss?

Thank you.

Return to “VSTGUI”

Who is online

Users browsing this forum: No registered users and 1 guest