Hi, I'm new to this forum, but I've been playing around with WDL for a few years now. Thought I'd join up to ask a few questions that have been bugging me for a while, see how different users tackle similar situations.
First off, I've been trying to build a GUI with some tab panels, with each panel having a unique set of controls. I've tried to implement this using the IAutoGUI class, but when the plugin instantiates, even though the first panel is active, all of the controls for every panel are visible until an OnMouseDown call is received for panel one. Means the GUI is an absolute mess of controls until the panel is clicked...
As an example, I use something like this in my plugin's constructor:
Code:
IGraphics* pGraphics = MakeGraphics(this, kWidth, kHeight);
pGraphics->AttachPanelBackground(&COLOR_WHITE);
AGPanelTabs* pPanel = new AGPanelTabs(this, IRECT(10, 10, 300, 300), &mText, &mBGColor, &mFGColor, &mOnColor);
pGraphics->AttachControl(pPanel);
const char* pLabel1 = "Tab 1";
AGTab* pTab1 = new AGTab(IRECT(10, 10, 40, 30), pLabel1);
pPanel->AddTab(pTab1);
const char* pLabel2 = "Tab 2";
AGTab* pTab2 = new AGTab(IRECT(40, 10, 70, 30), pLabel2);
pPanel->AddTab(pTab2);
GetParam(kGain1)->InitDouble("Gain 1", 50., 0., 100.0, 0.01, "%");
GetParam(kGain1)->SetShape(2.);
GetParam(kGain2)->InitDouble("Gain 2", 50., 0., 100.0, 0.01, "%");
GetParam(kGain2)->SetShape(2.);
AGKnobControl* AGKnob1 = new AGKnobControl(this, IRECT(10, 50, 50, 100), kGain1, &mText, &mBGColor, &mFGColor, 15);
pGraphics->AttachControl(AGKnob1);
AGKnobControl* AGKnob2 = new AGKnobControl(this, IRECT(50, 50, 90, 100), kGain2, &mText, &mBGColor, &mFGColor, 15);
pGraphics->AttachControl(AGKnob2);
pTab1->mParamsToMux.Add(kGain1);
pTab2->mParamsToMux.Add(kGain2);
pGraphics->HandleMouseOver(true);
What am I doing wrong?
I have also tried writing a custom OnMouseOut method within IAutoGUI to initialise the first tab as active with controls hidden when first instantiated, but no joy. Maybe I'm just doing something wrong or I just don't get what IAutoGUI is for at all.
I could probably get the task done quicker by adding radio buttons as panels and then hiding the controls individually in OnParamChange, but it doesn't look as neat and ends up being fragmented across the entire plugin .cpp file.
Anybody out there who can shed some light?